Skip to main content
This page provides a reference for the core methods available in the Ionic Lite SDK.

Core Methods

The Tonder Ionic Lite SDK (@tonder.io/ionic-lite-sdk) exposes the LiteCheckout class, which implements all the methods necessary for payment processing, card management, and configuration.

Method Details

Each method in the Tonder Ionic Lite SDK serves a specific purpose in the payment integration workflow. The Lite SDK includes all core payment methods plus additional methods for card management. Below you’ll find detailed information about each method, including their parameters, usage examples, and practical implementation guidance.
Creates a new instance of the LiteCheckout class with the necessary configuration for secure payment processing. This constructor establishes the connection with Tonder’s services and configures the payment environment.

LiteCheckout Parameter Table

ParameterTypeDescriptionRequired
apiKeyStringYour Tonder API key for authentication.Yes
returnUrlStringURL where the checkout form is mounted (used for 3DS redirect completion).No
modeStringOperating environment mode. Options: ‘product’ or ‘stage’.No
Here’s an example of how to initialize the LiteCheckout class:
const liteCheckout = new LiteCheckout({
  apiKey: "YOUR_API_KEY",
  returnUrl: "YOUR_RETURN_URL",
  mode: "stage"
});
Sets customer email and the secure token required for card management operations.
ParameterTypeDescription
configObjectConfiguration object with customer email and secure token
Here’s an example:
liteCheckout.configureCheckout({
  customer: {
    email: "example@email.com",
    secureToken: "e89eb18.." // Required for card management features
  }
});
Processes a payment transaction securely using the provided checkoutData collected from your custom UI.
ParameterTypeDescription
checkoutDataobjectCustomer, cart, and card information for the transaction
const response = await liteCheckout.payment({
  customer: { firstName: "Juan", email: "juan.hernandez@mail.com" },
  cart: { total: "399.00", items: [ /* ... */ ] },
  currency: "MXN",
  card: {
    card_number: "4111111111111111",
    cvv: "123",
    expiration_month: "12",
    expiration_year: "25",
    cardholder_name: "John Doe"
  }
});
Retrieves a list of saved cards for the configured customer.
ParameterTypeDescription
None-This method takes no parameters
const cards = await liteCheckout.getCustomerCards();
console.log("Saved cards:", cards);
Securely tokenizes and saves new card details for the customer.
ParameterTypeDescription
cardDataObjectCard information to be saved
const response = await liteCheckout.saveCustomerCard({
  card_number: "4111111111111111",
  cvv: "123",
  expiration_month: "12",
  expiration_year: "25",
  cardholder_name: "John Doe"
});
Deletes a previously saved card using its unique ID.
ParameterTypeDescription
cardIdStringUnique identifier of the card to remove
await liteCheckout.removeCustomerCard("card_abc123");
Verifies the status of a 3D Secure (3DS) transaction. This method should be called to handle the redirect return from a 3DS challenge.
ParameterTypeDescription
None-This method takes no parameters.
// The response status will be one of: ['Declined', 'Cancelled', 'Failed', 'Success', 'Pending', 'Authorized']
const response = await liteCheckout.verify3dsTransaction();
console.log("Verify 3ds response", response);

Next Steps

Now that you’re familiar with the available methods in the Ionic Lite SDK, explore these guides to enhance your implementation: