Set up the field containers
Add empty container elements to your form. Therius replaces each container with a secure iframe at runtime.Initialize hosted fields
After the SDK is initialized, callsdk.hostedFields() with a map of field names to CSS selectors.
<div> elements above. The SDK injects an iframe into each container and the shopper types directly into it.
Collect a nonce on form submit
When the shopper submits the form, callsdk.createNonce() to tokenize the card data held in the iframes. The SDK returns a short-lived nonce — not the card number.
The nonce is single-use and expires after a short period. Create a new nonce for each payment attempt — do not reuse nonces from failed or abandoned attempts.
Charge the nonce on your server
Your server passes the nonce ascard.nonceData.nonce when calling POST /payment/purchase.
Save the card for future payments
To vault the card during payment, addtokenize: true and a shopper.id to the server-side charge request:
token the shopper can use for future one-click checkouts. See Saved Cards for the full returning-shopper flow.
Handle 3DS challenges
Some cards require a 3DS challenge before the payment can be authorized. Callsdk.authorize(nonce) in the browser instead of sending the nonce directly to your server, then handle any required action:
sdk.handleAction is the single entry point for all out-of-band steps — 3DS challenges, redirects, and voucher displays. You do not need separate code paths for different action types.
