savePaymentMethod: true, then an upsell charge on page 2 using upsell.initialPaymentSession.
Live demo
Open the interactive upsell demo in the sandbox playground.
Current limitation: identifying upsell transactionsWidget upsells do not currently have a per-offer product name or label in the Paysight transaction view, and
upsellId is not displayed there.The initial payment and each upsell appear as separate transaction entries. Both are labelled SINGLE PURCHASE, unless the customer opts into a subscription on the initial payment, which is labelled OPT IN. These labels do not identify the upsell or its position in the chain.For now, compare transaction amounts with your configured checkout and upsell prices to identify the initial payment and upsells 1, 2, 3, and so on. Offers with the same price cannot be reliably distinguished by amount alone.We are working on adding upsell labels/product names, but they are not available yet.Before you start
- Use one Paysight
productIdfor the initial payment and every upsell in the journey. - Set
savePaymentMethod: trueon the initial checkout. Save thepaysightSessionfrom its successfulPAYMENT_SUCCESSevent. - For every upsell, reuse that original session as
upsell.initialPaymentSession, setusePreviousPaymentMethod: true, and supply the upsell’s ownamount. - Give each offer a unique, stable
upsellId, such asupsell-1orupsell-product-name. Keep the same ID when retrying the same offer. - Call
submitPayment()for checkout andsubmitUpsell()when the customer accepts an upsell. Creating a widget does not charge the customer.
Initial payment amount
amount is required and uses decimal major units of your configured currency.
amount: 0 does not mean a free payment. The examples use amount: 29.99 to override the immediate charge and amount: 9.99 for the upsell. Shopify cart mode is different: cart totals determine the amount.Page 1 — checkout
Page 2 — upsell
Key points
- Store
paysightSessionfromPAYMENT_SUCCESS.payload, not yoursessionId. - Handle
DUPLICATE_TRANSACTIONas success if the user refreshes page 2. - Reuse the same
productIdand the initial checkout’s successfulpaysightSessionfor every upsell. - Each different upsell needs its own
upsellIdand may set its own amount. Keep the same ID on retries. - Charge an accepted offer with
submitUpsell()or the in-iframe upsell button.hidePaymentButton: trueonly hides built-in buttons; it is optional. - Campaign/affiliate names cannot reliably identify each offer in the shared session; see Offer identification.
Additional upsells and offer identification
For a second or later upsell, create another widget with the same PaysightproductId and the original initial payment’s paysightSession. Set a different upsellId and that offer’s amount, then call submitUpsell() after acceptance.
data.campaignName and data.affiliateName are forwarded, but established attribution is reused for the shared product/session. Changing these names does not reliably identify each purchased offer. upsellId appears in widget events and duplicate detection, but is not returned by the current transaction list/detail APIs. Keep the offer ID with the payment result in your own order records.