LiteCheckout class and the standalone validation helpers. Whether you’re implementing basic payment processing or advanced card management functionality, this documentation will help you understand the available methods and their usage.
LiteCheckout Class Methods
| Method | Description |
|---|---|
new LiteCheckout(config) | Constructor to create and initialise a new SDK instance |
configureCheckout(config) | Sets customer email and the secureToken required for card management |
injectCheckout() | Initialises the SDK’s hidden services. Must be called before other methods |
payment(paymentData) | Initiates a payment. Requires card details in the payload |
verify3dsTransaction() | Verifies the status of a 3D Secure transaction after redirection |
getCustomerCards() | Retrieves a list of saved cards for the configured customer |
saveCustomerCard(cardData) | Securely tokenizes and saves new card details |
removeCustomerCard(cardId) | Deletes a previously saved card using its unique skyflow_id |
Method Details
Each method in the Tonder JS Lite SDK serves a specific purpose in the payment integration workflow. Below you’ll find detailed information about each method, including their parameters, usage examples, and practical implementation guidance.new LiteCheckout(config)
new LiteCheckout(config)
Creates and initialises a new SDK instance with your API credentials and configuration options.The constructor accepts the following configuration parameters:
Here’s how to initialise the SDK with basic configuration:
| Parameter | Type | Required | Description |
|---|---|---|---|
apiKey | string | Yes | Your Tonder API key for authentication |
returnUrl | string | Yes | URL where users will be redirected after 3D Secure verification |
mode | string | Yes | Environment mode: 'development' or 'production' |
configureCheckout(config)
configureCheckout(config)
Sets customer email and the secure token required for card management operations.The configuration object accepts the following parameters:
Here’s how to configure the SDK for card management:
| Parameter | Type | Required | Description |
|---|---|---|---|
customer | object | Yes | Customer information including email |
customer.email | string | Yes | Customer’s email address |
secureToken | string | Yes | Secure token from your backend for card management |
injectCheckout()
injectCheckout()
Initialises the SDK’s hidden services. This method must be called before other methods can be used.This method doesn’t require any parameters. Simply call it to initialise the SDK:
payment(paymentData)
payment(paymentData)
Initiates a payment transaction using the provided customer, cart, and card data.The payment method expects a data object with the following structure:
Here’s a complete example of processing a payment:
| Parameter | Type | Required | Description |
|---|---|---|---|
paymentData | object | Yes | Payment information including customer, cart, and card details |
paymentData.customer | object | Yes | Customer information (firstName, email, etc.) |
paymentData.cart | object | Yes | Cart information (total, items) |
paymentData.currency | string | Yes | Currency code (e.g., ‘mxn’) |
paymentData.card | object | Yes | Card details (card_number, cvv, expiration_month, expiration_year, cardholder_name) |
verify3dsTransaction()
verify3dsTransaction()
Verifies the status of a 3D Secure transaction after the user is redirected back to your site.This method doesn’t require any parameters and should be called on your return page after 3D Secure verification:
saveCustomerCard(cardData)
saveCustomerCard(cardData)
Securely tokenizes and saves new card details for future use.The method expects a card data object with the following structure:
Here’s how to save a customer card:
| Parameter | Type | Required | Description |
|---|---|---|---|
cardData | object | Yes | Card information to be tokenized and saved |
cardData.card_number | string | Yes | The card number |
cardData.cvv | string | Yes | The CVV code |
cardData.expiration_month | string | Yes | Expiration month (MM format) |
cardData.expiration_year | string | Yes | Expiration year (YY format) |
cardData.cardholder_name | string | Yes | Cardholder’s name |
getCustomerCards()
getCustomerCards()
Retrieves a list of saved cards for the configured customer.This method doesn’t require any parameters and returns the customer’s saved cards:
removeCustomerCard(cardId)
removeCustomerCard(cardId)
Deletes a previously saved card using its unique skyflow_id.The method expects the following parameter:
Here’s how to remove a customer card:
| Parameter | Type | Required | Description |
|---|---|---|---|
cardId | string | Yes | The unique skyflow_id of the card to remove |
Validation Helper Functions
The SDK exports standalone functions to help you validate card information on the client side before submission.| Function | Description |
|---|---|
validateCardNumber(..) | Validates the card number using the Luhn algorithm |
validateCardholderName(..) | Checks if the cardholder name is not empty |
validateCVV(..) | Ensures the CVV is 3 or 4 digits |
validateExpirationDate(..) | Validates the expiration date in MM/YY format |
Next Steps
Now that you understand the available methods in the Tonder JS Lite SDK, you’re ready to implement advanced payment functionality in your web application. Here are the recommended next steps:- Learn how to make a payment using these methods with custom UI.
- Understand customisation options for building your own payment interface.
- Learn how to enroll payment methods for returning customers.

