Setup your development
To manually load Checkout.js, simply add the script link to the <head> of any page.- Open a secure payment iframe
- Receive payment session updates
- Track transaction creation
- Detect when the iframe is closed (manually or automatically) This version is best suited for basic payment flows where advanced event handling or KYC tracking is not required.
Usage
1. Required HTML Structure
Include a Buy Now button, a modal dialog, and an iframe container:
📝 Note: Root element ID must be tb_root — this is where the iframe will be injected.
2. Initialize and Use TBIframe
When the user clicks Buy Now, the following happens:
- A TBIframe instance is created.
- init() is called with the session URL.
- The iframe opens and loads the payment flow.
- During the payment lifecycle:
- onSessionUpdate is called when payment status changes
- onTransactionUpdate is called when a transaction is initiated
- onClose is called when the iframe closes
TBIframe API Reference
Constructor
- Initializes the
TBIframeinstance.
Methods
1. init
Loads the payment iframe and manages session updates and UI customization.
Parameters:
Options TBIframeOptions Properties:
Example:
2. close()
Closes the iframe and removes it from the DOM.Also triggers the
onClose callback if it was provided during init.