Skip to main content
This page provides a comprehensive reference for the core methods available in the InlineCheckout class. Whether you’re implementing basic payment processing or advanced checkout functionality, this documentation will help you understand the available methods and their usage.

Method Details

Each method in the Tonder JS Inline 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.
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:
Renders the pre-built, customizable checkout interface into the designated DOM element (for example: <div id="tonder-checkout"></div>).This method injects the checkout into the DOM. Ensure the target element exists (call after DOMContentLoaded or place the script after the target element) before calling injectCheckout().This method doesn’t require any parameters. Simply call it to render the checkout interface:
Initiates a payment transaction using the provided customer and cart data. This method processes the payment and handles the secure transaction flow.The payment method expects a data object with the following structure:Here’s a complete example of processing a payment:
Verifies the status of a 3D Secure transaction. This method should be called after injectCheckout() to handle 3DS verification if required. It returns a promise that resolves with the transaction response.The response status will be one of the following: ‘Declined’, ‘Cancelled’, ‘Failed’, ‘Success’, ‘Pending’, or ‘Authorized’.
Cleans up the SDK instance and removes UI components from the DOM. Use this method when you need to destroy the checkout interface.This method doesn’t require any parameters and can be called whenever you need to clean up the checkout interface:
Sets initial checkout data. This function allows you to set information, such as the customer’s email, which can be used to retrieve a list of saved cards.This method must be used to send all payment data (customer, cart, metadata, etc.) when you are using Tonder’s default payment button.

Next Steps

Now that you understand the available methods in the Tonder JS Inline SDK, you’re ready to implement payment processing in your web application. Here are the recommended next steps: