Purchase button
Use browser JS purchase button integration
Supertab purchase button renders a button in DOM. When clicked, it initiates the purchase flow. Throughout the customer’s journey, various events may occur. Callback functions, defined in the initialization object, are triggered for these events, enabling you to handle them as needed.
To get started with purchase button, first set up the experience. Once complete, the code snippet generated in the final step of the Experience Editor will look similar to the following:
Initialization object properties
DOM Element to render the purchase button in.
Supertab client ID with live_
or test_
prefix. test_
means the
integration runs in test mode.
Your site name displayed in the purchase dialog on confirmation screen.
URL path to your logo. Displayed on confirmation screen.
Offering ID to sell via the purchase button. If not supplied, the first site offering is used.
Purchase button label. Default: Put it on my tab
.
An object defining custom colors for the button.
text
HEX code for text color. Default: #ffffff
background
HEX code for background color. Default: #0000000
Callback functions
Called when the purchase is successfully completed.
Called when a user has prior entitlement to the offering and can access the content without a purchase. The prior entitlement may occur only for offerings with access managed by Supertab – currently time passes and subscriptions.
Called when a user dismisses the purchase flow.
Called when there was an unexpected error that prevents the purchase flow to continue. For example when wrong client ID and offering ID are supplied, or some API call failed because of network error.