Setup Tonder Provider
Property | Type | Required | Description |
---|---|---|---|
mode | 'development' | 'production' | 'sandbox' | Yes | Specifies the environment mode for the SDK. Use development for testing, production for live operations, or sandbox for isolated testing. |
apiKey | string | Yes | Your unique Tonder Public API key used to authenticate SDK requests. |
type | SDKType | Yes | Indicates the integration type. Options: INLINE for inline integration, LITE for lightweight use, or ENROLLMENT for enrollment workflows. |
returnURL | string | No | The URL to redirect users to after completing the 3DS authentication process. |
Obtain a Secure Token
Gather Payment and Customer Data
Create the Full Payment Screen
create
: Initializes the SDK with configuration.reset
: Resets the SDK state to its initial values and cleans up resources.payment
: Processes a payment using the configured payment data.IInlineCheckoutOptions
Option | Type | Required | Description |
---|---|---|---|
paymentData | IBaseProcessPaymentRequest | Yes | Contains the payment information, including customer and cart data necessary for the transaction. |
customization | IInlineCustomizationOptions | No | Options for customizing the user interface of the payment process. |
callbacks | IInlineCallbacks | No | Functions to handle callback events during the payment process, such as success or failure. |
returnURL | string | No | The URL to redirect users to after completing the 3D Secure (3DS) authentication process. |
Callbacks Structure
Callback | Parameters | Description | Return |
---|---|---|---|
beforePayment | none | Invoked before the payment process begins. Use this to display a loading state, validate data, or perform pre-payment tasks. | Promise |
onFinishPayment | response: IBaseResponse<ITransaction> | Triggered when the payment process is completed (either success or error). Provides transaction results or error details. | Promise |
beforeDeleteCard | none | Invoked before the delete card process starts. Use this to display a loading state, validate data, or perform pre-deletion tasks. | Promise |
onFinishDeleteCard | response: IBaseResponse<string> | Triggered when the card deletion process is completed (either success or error). | Promise |
Payment Data
Field | Type | Required | Description |
---|---|---|---|
email | string | Yes | Customer’s email address. |
firstName | string | Yes | Customer’s first name. |
lastName | string | Yes | Customer’s last name. |
phone | string | No | Customer’s contact phone number. |
address | string | No | Customer’s street address. |
city | string | No | Customer’s city. |
state | string | No | Customer’s state or province. |
country | string | No | Customer’s country. |
postCode | string | No | Customer’s postal or ZIP code. |
Field | Type | Required | Description |
---|---|---|---|
total | number | Yes | Total amount of the transaction. |
items | Array<IItem> | Yes | Array containing details of items in the cart. |
metadata | Record<string, any> | No | Additional custom data for the transaction. |
currency | string | No | Currency code for the transaction (default: MXN ). |
Field | Type | Required | Description |
---|---|---|---|
name | string | Yes | Name of the product. |
amount_total | number | Yes | Total amount for the item (calculated as quantity × price ). |
description | string | Yes | Brief description of the product. |
price_unit | number | Yes | Unit price of the product. |
product_reference | string | Yes | Unique identifier for the product. |
quantity | number | Yes | Quantity of the product being purchased. |
discount | number | No | Discount amount applied to this item. |
taxes | number | No | Tax amount applied to this item. |
Customization Options
Option | Type | Default | Description |
---|---|---|---|
saveCards.showSaveCardOption | boolean | true | Displays a checkbox allowing users to choose whether to save their card for future purchases. |
saveCards.showSaved | boolean | true | Shows a list of previously saved cards for the customer. |
saveCards.autoSave | boolean | false | Automatically saves the card without requiring the user to select the save option. |
saveCards.showDeleteOption | boolean | true | Displays a delete button for each saved card in the list. |
Option | Type | Default | Description |
---|---|---|---|
paymentButton.show | boolean | true | Controls the visibility of the payment button. |
paymentButton.text | string | 'Pagar' | Custom text displayed on the payment button. |
paymentButton.showAmount | boolean | true | Displays the payment amount on the button (e.g., “Pay $100”). |
Option | Type | Default | Description |
---|---|---|---|
paymentMethods.show | boolean | true | Controls the visibility of the alternative payment methods section. |
Option | Type | Default | Description |
---|---|---|---|
cardForm.show | boolean | true | Controls the visibility of the card input form. |
Option | Type | Default | Description |
---|---|---|---|
showMessages | boolean | true | Controls the visibility of error and success messages. |
labels | object | - | Custom labels for form fields (see Form Labels section). |
placeholders | object | - | Custom placeholder text for form inputs (see Form Placeholders section). |
styles | object | - | Custom styles for UI components (see Styling section). |
Form Labels & Placeholders
Property | Type | Default | Description |
---|---|---|---|
name | string | ”Titular de la tarjeta” | Label for the cardholder’s name field. |
cardNumber | string | ”Número de tarjeta” | Label for the card number field. |
cvv | string | ”CVV” | Label for the security code field. |
expiryDate | string | ”Fecha de expiración” | Label for the expiration date fields. |
Property | Type | Default | Description |
---|---|---|---|
name | string | ”Nombre como aparece en la tarjeta” | Placeholder for the cardholder’s name field. |
cardNumber | string | ”1234 1234 1234 1234” | Placeholder for the card number field. |
cvv | string | ”3-4 dígitos” | Placeholder for the security code field. |
expiryMonth | string | ”MM” | Placeholder for the expiration month field. |
expiryYear | string | ”AA” | Placeholder for the expiration year field. |
Styling
Component | Description | Properties |
---|---|---|
sdkCard | Main container of the SDK. | base: StylesBaseVariant |
Component | Description | Properties |
---|---|---|
cardForm | Card form section. | base: StylesBaseVariant |
inputStyles: CollectInputStylesVariant | ||
labelStyles: CollectInputStylesVariant | ||
errorStyles: StylesBaseVariant |
Component | Description | Properties |
---|---|---|
savedCards | Saved cards list section. | base: StylesBaseVariant |
radioBase: ViewStyle | ||
radioInner: ViewStyle | ||
radioSelected: ViewStyle | ||
cardIcon: ViewStyle | ||
deleteButton: ViewStyle | ||
deleteIcon: ViewStyle |
Component | Description | Properties |
---|---|---|
paymentMethods | Payment methods section. | base: StylesBaseVariant |
radioBase: ViewStyle | ||
radioInner: ViewStyle | ||
radioSelected: ViewStyle |
Component | Description | Properties |
---|---|---|
paymentRadio | Payment method selector. | base: StylesBaseVariant |
radioBase: ViewStyle | ||
radioInner: ViewStyle | ||
radioSelected: ViewStyle |
Component | Description | Properties |
---|---|---|
paymentButton | Payment button. | base: ViewStyle |
Component | Description | Properties |
---|---|---|
errorMessage | Error message display. | base: TextStyle |
Component | Description | Properties |
---|---|---|
successMessage | Success message display. | base: TextStyle |
Full customization example