Add the required ID to your HTML
tonder-checkout
ID to an empty div
, like the example below:Initialize Tonder's SDK Instance
Field | Description |
---|---|
mode | Environment mode. Options: stage , production , sandbox . Default: stage |
apiKey | The API key used for authentication and authorization. |
returnUrl | The URL to which the user is redirected after the checkout process, regardless of success or failure. |
customization | This object is designed to customize the behavior of the checkout. It is used to adjust both the interface options and operational parameters. Refer to the Customizations section for more details. |
styles | Custom styles object that allows you to customize the appearance of the inline checkout. It may include properties such as colors, fonts, and other styling options. Refer to the Styling section for more details. |
Configure checkout method (Optional)
configureCheckout
method to set initial customer information, such as their email address, allowing to retrieve the respectives user’s saved cards.Inject checkout method
injectCheckout
method with your inlineCheckout instance, with the code below:tonder-checkout
added in Step 1 to render the checkout elements, as exemplified by the image below:Add 3DS verification
verify3dsTransaction()
method to validate if the 3DS challenge was successful or not. Use the example below to call the method and handle the response as needed:Add a pay button
payment
method from the inlineCheckout
instance, sending the checkout data as payload, like presented below:Customer
Field | Description |
---|---|
firstName | The first name of the customer. |
lastName | The last name of the customer. |
country | The country of residence for the customer. |
address | The street address in the specified city for the customer. |
city | The city of residence for the customer. |
state | The state or region within the country for the customer. |
postCode | The postal code or ZIP code of the address for the customer. |
email | The email address for communication with the customer. |
phone | The contact phone number for the customer. |
Currency
Field | Description |
---|---|
currency | The currency used by the customer in ISO 4217 format. |
Cart
Field | Description |
---|---|
total | The total amount for the customer’s purchase. |
items | An array containing details of individual items in the purchase. |
items[n].description | The description of the first item. |
items[n].quantity | The quantity of the first item in the purchase. |
items[n].price_unit | The unit price of the first item. |
items[n].discount | The discount applied to the first item. |
items[n].taxes | The taxes applied to the first item. |
items[n].product_reference | The reference number of the product for the first item. |
items[n].name | The name of the first item (e.g., “T-Shirt”). |
items[n].amount_total | The total amount for the first item. |
checkoutData example