Callback function called when user leaves the purchase flow either as a result of successful purchase or cancellation.Returns a promise which resolves with the purchase button summary. See Purchase button summary for more details.
Specifies the nature and duration of purchased entitlement.Where you have chosen to have Supertab manage entitlements for you, customer’s purchasing such an offering will be granted entitlement to the content associated with the offering for the length of time specified.
The content key being purchased, if you have chosen to have Supertab manage customer entitlement for you.Example: "site.cf637646-71a4-430d-aaea-a66f1a48a83c"
Details of all purchases made by the customer through your merchant account. Purchases made with other merchant accounts are shown as a single purchase, which accumulates all totals into one and has a null value instead of a purchase ID.Each purchase in the array has the same structure as the previously described Purchase object.
const { destroy, initialState } = await supertabClient.createPurchaseButton({ containerElement: document.getElementById("supertab-button-container"), experienceId: "experience.abc", onDone: ({ priorEntitlement, purchase }) => { if (priorEntitlement) { // User has prior entitlement to the content. return; } if (purchase) { if (purchase.status === "completed") { // Purchase was completed successfully. } else { // Purchase was not completed. User may have // canceled the payment dialog if purchase // required payment. } } else { // User has canceled the flow and did not // attempt to purchase the offering. } }