Complete checkout on the Web
Choose the supported DEUNA Web integration for a complete checkout and migrate from the retired initCheckout surface.
On this page
The current DEUNA Web SDK does not expose initCheckout. Build the merchant-owned checkout page and embed initPaymentWidget for payment, or use the maintained native SDK when the checkout lives in a mobile application.
Choose the supported integration#
Flow diagram
| Need | Supported surface |
|---|---|
| Add payment methods to an existing web checkout | Payment Widget for Web |
| Vault a card or run Click to Pay | Elements and card vault |
| Continue 3DS or an APM action | Next Action |
| Build a native mobile checkout | iOS, Android, or React Native |
| Wrap an existing merchant web checkout | Web SDK in a mobile WebView, with the documented limitations |
Recommended web architecture#
01 · merchant UI
Collect checkout data
Own cart, contact, shipping, and consent fields in your application.
02 · merchant backend
Create the order
Validate totals and send the supported order contract.
03 · DEUNA widget
Collect payment
Open Payment Widget with the returned order token.
04 · merchant backend
Verify and fulfill
Use the final DEUNA order state and webhooks.
JavaScript
const {orderToken, merchantOrderId} = await createOrderFromServer(checkoutState);
await DeunaSDK.initPaymentWidget({
orderToken,
mode: 'target',
target: '#payment-step',
callbacks: {
onSuccess: () => renderVerifiedResult(merchantOrderId),
onError: showPaymentRecovery,
onClosed: () => returnToPaymentMethods(),
onResize: ({height}) => resizePaymentStep(height),
},
});Migration from initCheckout#
- Keep cart, shipping, billing, customer, and consent state in the merchant application.
- Move order creation to the merchant backend if it was client-side.
- Replace
initCheckout(...)withinitPaymentWidget({orderToken, ...}). - Map old checkout completion handling to
onSuccess, then retrieve the order on the backend. - Map old lifecycle analytics to the current SDK events.
- Test mobile widths, address editing, browser navigation, 3DS, APM redirects, and recovery after refresh.
State ownership#
| State | Owner |
|---|---|
| Cart contents, prices, inventory, shipping, tax | Merchant backend |
| Checkout form and step navigation | Merchant application |
| Eligible payment methods and credential entry | DEUNA Payment Widget and configured connections |
| Payment processing and normalized order state | DEUNA API |
| Fulfillment decision | Merchant backend after verification |
Responsive layout#
Place the payment target in a one-column flow on small screens. Avoid side-by-side order summary and payment content below your layout breakpoint, keep the target at width: 100%, and respond to onResize. Sticky headers and footers must not cover issuer challenges or the widget action.