Overview
SethidePaymentButton: true to hide the in-iframe Pay and Upsell buttons. Call submitPayment() or submitUpsell() from the host page when the user clicks your custom button.
Apple Pay and Google Pay still render in host containers via applePayContainerId / googlePayContainerId.
Configuration
Host API
Vanilla JavaScript
| Method | Use when |
|---|---|
submitPayment() | Card checkout (normal form) |
submitUpsell() | Page 2 upsell / usePreviousPaymentMethod flow |
READY before enabling your button.
Layout
Events
| Event | When |
|---|---|
ERROR | Validation or guard failure |
PAYMENT_START | Card payment attempt started |
PAYMENT_SUCCESS / PAYMENT_ERROR | Checkout or upsell result (payload.mode) |
ERROR codes: see Error codes.
Subscription opt-out (singlePurchase)
When your product includes an optional subscription, use a host checkbox and update the widget before pay:
singlePurchase | Meaning |
|---|---|
true | Charge without subscription |
false | Include subscription per product config |
| omitted | Default product behavior |
Two-page checkout + upsell
Page 1:hidePaymentButton: true + submitPayment() + savePaymentMethod: true.
Page 2: hidePaymentButton: true + submitUpsell() + upsell.initialPaymentSession.
See Saved payment & upsell and the external button example.
Live demo
Hosted demo:https://payment.paysight.io/demo?preset=external-button