Created
August 12, 2020 19:29
-
-
Save nicoespeon/edd4099a42f0c17097947b362d5fdb3f to your computer and use it in GitHub Desktop.
Params we use to instantiate the DropIn
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const checkout = new AdyenCheckout({ | |
"locale": "en", | |
"originKey": "...", | |
"environment": "test", | |
"translations": { | |
"en": { | |
"creditCard.holderName.invalid": "Oops! Something Went Wrong", | |
"creditCard.numberField.title": "Card Number", | |
"creditCard.numberField.placeholder": "•••• •••• •••• ••••", | |
"creditCard.numberField.invalid": "Oops! Something Went Wrong", | |
"creditCard.expiryDateField.title": "Expiry Date", | |
"creditCard.expiryDateField.placeholder": "MM / YY", | |
"creditCard.expiryDateField.invalid": "Oops! Something Went Wrong", | |
"creditCard.expiryDateField.month": "Month", | |
"creditCard.expiryDateField.month.placeholder": "MM", | |
"creditCard.expiryDateField.year.placeholder": "Year", | |
"creditCard.expiryDateField.year": "YY", | |
"creditCard.cvcField.title": "Security code", | |
"creditCard.cvcField.placeholder": "123", | |
"payButton": "Pay", | |
"installments": "Number of installments", | |
"creditCard.holderName": "Name on Card", | |
"creditCard.holderName.placeholder": "J. Smith", | |
"storeDetails": "Save for my next payment" | |
} | |
}, | |
"paymentMethodsResponse": { | |
"groups": [ | |
{ | |
"name": "Credit Card", | |
"types": ["visa", "mc", "amex", "discover", "maestro", "diners"] | |
} | |
], | |
"paymentMethods": [ | |
{ | |
"brands": ["visa", "mc", "amex", "discover", "maestro", "diners"], | |
"details": [ | |
{ "key": "number", "type": "text" }, | |
{ "key": "expiryMonth", "type": "text" }, | |
{ "key": "expiryYear", "type": "text" }, | |
{ "key": "cvc", "type": "text" }, | |
{ "key": "holderName", "optional": true, "type": "text" } | |
], | |
"name": "Credit Card", | |
"type": "scheme" | |
}, | |
{ | |
"details": [{ "key": "applepay.token", "type": "applePayToken" }], | |
"name": "Apple Pay", | |
"supportsRecurring": true, | |
"type": "applepay" | |
}, | |
{ | |
"configuration": { "merchantId": "1000" }, | |
"details": [ | |
{ "key": "paywithgoogle.token", "type": "payWithGoogleToken" } | |
], | |
"name": "Google Pay", | |
"supportsRecurring": true, | |
"type": "paywithgoogle" | |
} | |
] | |
} | |
}); | |
const dropin = checkout.create('dropin', { | |
"paymentMethodsConfiguration": { | |
"card": { | |
"enableStoreDetails": true, | |
"hasHolderName": true, | |
"hideCVC": false, | |
"holderNameRequired": true | |
}, | |
"applepay": { | |
"amount": 5160, | |
"totalPriceLabel": "Total", | |
"currencyCode": "USD", | |
"countryCode": "US", | |
"merchantCapabilities": ["supports3DS"], | |
"requiredBillingContactFields": ["name"], | |
"requiredShippingContactFields": [], | |
"lineItems": [ | |
{ "label": "Subtotal", "amount": 44.05 }, | |
{ "label": "Fees", "amount": 0.94 }, | |
{ "label": "Taxes", "amount": 6.61 } | |
], | |
"configuration": { | |
"merchantName": "Busbud", | |
"merchantIdentifier": "merchant.com.adyen.Busbud.test" | |
} | |
}, | |
"paywithgoogle": { | |
"environment": "TEST", | |
"amount": { "currency": "USD", "value": 5160 }, | |
"configuration": { | |
"gatewayMerchantId": "BusbudUSA", | |
"merchantName": "Busbud" | |
}, | |
"emailRequired": true | |
} | |
}, | |
"showStoredPaymentMethods": true | |
}).mount('#dropin-container'); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment