createPurchaseButtonExperience returns the object with destroy property which can be called to remove purchase button from DOM when interaction with a button is no longer needed.
Initialization object properties
Element
required
DOM Element to render the purchase button in.
string
required
Supertab client ID with
live_ or test_ prefix. test_ means the
integration runs in test mode.string
required
Your website name displayed in the purchase dialog on confirmation screen.
string
required
URL path to your logo. Displayed on confirmation screen.
string
Offering ID to sell via the purchase button. If not supplied, the first website
offering is used.
string
Purchase button label. Default:
Put it on my tab.object
An object defining custom colors for the button.
text HEX code for text color. Default: #ffffffbackground HEX code for background color. Default: #0000000Callback functions
function
Called when the purchase is successfully completed.
function
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.
function
Called when a user dismisses the purchase flow.
function
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.