productId and the initial successful paysightSession. Give each offer a unique, stable upsellId, set its own amount (or Shopify cart), and submit the accepted offer with submitUpsell(). Paysight product IDs are separate from Shopify cart product/variant IDs. See Saved payment & upsell.
Integrate Paysight with Shopify-style carts and a two-page upsell flow.
Overview
Whenshopify is present on WidgetConfig:
- Cart totals are computed from cart line items —
amountis ignored (pass0). - Page 1 (checkout) typically sets
savePaymentMethod: true. - Page 2 (upsell) charges via
usePreviousPaymentMethod: trueandpaysightSessionfrom page 1.
Configuration
variant and product are numeric Shopify IDs sent to the Paysight API. name, description, and imageUrl are display-only.Subscription opt-in
For the initial Shopify cart checkout, setconfig.shopify.optIn: true when the customer accepts the subscription. This requests the subscription configured on the top-level Paysight productId in addition to the Shopify order. The subscription must already be configured on that Paysight product; this flag does not create a subscription plan or select a Shopify selling plan.
The widget forwards the boolean to the Paysight API as
shopify.optIn, nested inside the shopify object.
singlePurchase is a separate top-level flag for one-time purchases. Setting singlePurchase: false alone does not opt a Shopify checkout into a subscription — use shopify.optIn: true. When opting in, omit singlePurchase or set it to false; do not combine shopify.optIn: true with singlePurchase: true. Likewise, savePaymentMethod: true only saves the payment method and does not request subscription opt-in.shopify.optIn before submitting the initial payment. A later cart upsell uses the original payment session and is not a new subscription opt-in step.
Amount calculation
total is sent to the API as amount.
Page 1 example
This example assumes the customer has accepted the subscription. SetoptIn: false when they decline or when the checkout is only for the Shopify order.
Page 2 upsell
Events
Upsell charges usePAYMENT_START, PAYMENT_SUCCESS, and PAYMENT_ERROR with payload.mode === 'upsell'.
CART_READY / CART_UPDATE payload: { subtotal, shipping, total, currency, itemCount }.
Styling
Cart and upsell UI use.ps-cart, .ps-cart-inner, .ps-cart-*, and .ps-upsell-submit classes — override via theme.css.
Live demo
Shopify two-page example — live demo athttps://payment.paysight.io/demo?preset=shopify.