Migrating to Click to Pay Drop-In UI Version 1
Overview
The version 1 (v1) SDK simplifies your integration with fewer lines of code, a streamlined API, and enhancements such as auto-processing and a full event system. The core flow is the same in v1, and migrating to v1 involves only straightforward method renames.
This table summarizes the key method and behavior changes between v0 and v1:
| Aspect | v0 | v1 |
|---|---|---|
| Initialization | new Accept(session).unifiedPayments() | VAS.UnifiedCheckout(session) |
| Display the payment UI | up.show(options) | checkout.mount(target) |
| Events | None | Full event system on client and checkout |
| Cleanup | up.dispose() | checkout.destroy() + client.destroy() |
| Hide UI | up.hide() | checkout.unmount() |
| Target Origin | Multiple non-usable URLs can be included in the request. | If any origins are absent, mismatched, or not registered for Click to Pay Drop-In UI, the system prevents Click to Pay Drop-In UI from loading and displays a client-side error message. |
This table provides a feature-by-feature comparison between the pre-v1 release and v1:
| Feature | Pre V1 Support | V1 Support | Description |
|---|---|---|---|
| Status | yes | yes | |
| Capture context endpoint | /up/v1/capture-contexts | /up/v1/sessions | |
| Capture context management | API only | API only or API and | configuration is at the merchant level. |
| Unified Checkout Look and Feel in | no | yes | configuration is at the merchant level. |
| Unified Checkout Look and Feel Using the API | no | yes | Configure the look and feel in a Sessions API request. |
| Click to Pay Configuration | API only | API or API and | configuration is at the merchant level. |
| Real-time preview in | no | yes | configuration is at the merchant level. |
| Three-decimal currency support | no | yes | |
| SDK | Legacy Unified Payments SDK supported | New UC SDK | |
| Payment Details API | /up/v1/payment-details/{id} | JTI used in place of transient token | JTI is located in the transient token |
| Future enhancements | Manual opt-in is required. | Automatic when the clientVersion is not included in the Sessions API request. | Legacy versions receive critical updates only. |
Initialization
Click to Pay Drop-In UI v1 initializes with a single asynchronous factory call and has no intermediate Accept object:
v0 Initialization
const accept = new Accept(sessionJWT);const up = accept.unifiedPayments();v1 Initialization
const client = await VAS.UnifiedCheckout(sessionJWT);Unified Checkout v1 validates the JWT signature and target origins during initialization.
Display the Payment UI
Unified Checkout v1 passes your UI payment selectors directly to mount().
v0 Display Payment UI with show()
// Sidebarconst token = await up.show({ containers: { paymentSelection: '#buttons' }});// Embeddedconst token = await up.show({ containers: { paymentSelection: '#buttons', paymentScreen: '#form' }});v1 Display Payment UI with mount()
// Sidebarconst result = await checkout.mount('#buttons');// Embeddedconst result = await checkout.mount({ paymentSelection: '#buttons', paymentScreen: '#form'});Events
Unified Checkout v0 does not include an event system; it relies on the promise resolution or rejection from show() and complete() instead. v1 includes a full event system at the client and integration levels.
v1 Full Event System
// Client-level — centralized error trackingclient.on('error', (err) => { console.error(`[${err.source}] ${err.code}: ${err.message}`);});// Checkout-level — granular lifecycle eventscheckout.on('ready', (data) => { console.log('Available methods:', data.availablePaymentMethods);});checkout.on('paymentMethodSelected', (data) => { console.log('Selected:', data.type);});checkout.on('error', (err) => { console.error('Checkout error:', err.code);});Cleanup
Unified Checkout v1 distinguishes between unmount(), which is reversible, and destroy(), which is permanent. Before a cleanup, client.destroy() sends a destroyed event.
v0 Cleanup
up.hide(); // Hide UIup.dispose(); // Clean up resourcesv1 Cleanup
checkout.unmount(); // Remove UI from page (can remount later)checkout.destroy(); // Permanent cleanupclient.destroy(); // Destroy client and clear all event listenersHandle Errors
The UnifiedCheckoutError class and its reason codes are the same in v0 and v1:
v0 Error Handling
try { const token = await up.show({ containers: { paymentSelection: '#buttons' } });} catch (err) { console.error(err.reason, err.message);}v1 Error Handling
// Same error class, same propertiestry { const result = await checkout.mount('#buttons');} catch (err) { console.error(err.reason, err.message);}Migrate Triggers
If your Unified Checkout v0 integration uses triggers, the migration is similar to checkout. In v1, client.createTrigger creates triggers, not UnifiedPayments as in v0. In v1, mount() replaces show().
v0 Triggers
const trigger = up.createTrigger('CLICKTOPAY', { containers: { paymentScreen: '#screen' }});const token = await trigger.show();v1 Triggers
const trigger = client.createTrigger('CLICKTOPAY');const result = await trigger.mount('#screen');Reason Code Changes
Some reason codes were renamed in v1. This table shows the v0 reason code name and the corresponding name in the v1 client-side SDK:
| v0 Reason Code | v1 Reason Code |
|---|---|
SHOW_LOAD_CONTAINER_SELECTOR | MOUNT_CONTAINER_SELECTOR |
SHOW_LOAD_ERROR | MOUNT_ERROR |
SHOW_LOAD_INVALID_CONTAINER | MOUNT_INVALID_CONTAINER |
SHOW_LOAD_SIDEBAR_OPTIONS | MOUNT_SIDEBAR_OPTIONS |
SHOW_PAYMENT_TIMEOUT | MOUNT_PAYMENT_TIMEOUT |
SHOW_PAYMENT_UNAVAILABLE | MOUNT_PAYMENT_UNAVAILABLE |
SHOW_TOKEN_TIMEOUT | MOUNT_TOKEN_TIMEOUT |
SHOW_TOKEN_XHR_ERROR | MOUNT_TOKEN_XHR_ERROR |
UNIFIED_PAYMENTS_ALREADY_SHOWN | CHECKOUT_ALREADY_MOUNTED |
UNIFIED_PAYMENTS_PAYMENT_PARAMETERS | CHECKOUT_PAYMENT_PARAMETERS |
UNIFIED_PAYMENTS_VALIDATION_PARAMS | CHECKOUT_VALIDATION_PARAMS |
Migration Checklist
This checklist lists the tasks required to migrate from Unified Checkout v0 to v1:
- Replace
new Accept(session).unifiedPayments()withawait VAS.UnifiedCheckout(session). - Replace
up.show(options)withcheckout = await client.createCheckout(); checkout.mount(target). - Update container options:
{ containers: { paymentSelection, paymentScreen } }becomes direct arguments tomount(). - Replace
up.complete(token)withcheckout.complete(token)or useautoProcessing: trueto complete transactions automatically. - Replace
up.hide()withcheckout.unmount(). - Replace
up.dispose()withcheckout.destroy()andclient.destroy(). - Add event listeners for observability. For example,
client.on('error')andcheckout.on('ready').
Related Resources
Thanks for your feedback!
Last published: September 29, 2026