Basic setup
Callsdk.checkout() after initializing the SDK. The widget mounts itself into the DOM automatically.
Saved-card picker
If the session was created with acustomerId and that shopper has previously vaulted cards, the widget automatically renders a card picker above the new-card form. Cards are displayed as brand / last 4 / expiry — no PAN is ever returned to the browser.
When the shopper selects a saved card, onSavedMethodSelected fires with the card’s token. Charge it immediately without a nonce:
GET /sdk/vaulted-methods and is scoped to the session’s own shopper — the browser cannot enumerate a different shopper’s cards.
Charging a new card from the widget
For a new card entered through the widget, retrieve the nonce after the shopper submits the form and use it the same way as with hosted fields:sdk.authorize(nonce) directly after widget submission to let the SDK manage the full authorize-and-action loop in one call.
Handling 3DS
3DS is handled identically to hosted fields. If the charge result includesactionRequired, pass it to sdk.handleAction:
sdk.handleAction opens the 3DS challenge iframe, waits for completion, and resolves with the final PaymentResult. You do not need to write separate logic for different challenge types.
vaultConsentEnabled only shows the “Save this card” checkbox when a shopperId is present in the session. If no customerId was passed to POST /sdk/session, the checkbox is hidden regardless of this setting.If you passed
cardOnFile when creating the session (see Merchant-managed subscriptions), the widget shows a fixed “card will be saved” disclosure instead of the vaultConsentEnabled checkbox — the card is saved unconditionally, so there’s nothing to opt into.
