Test Your Click to Pay Drop-In UI Configuration
This section contains information about testing your Click to Pay Drop-In UI configuration.
This tutorial assumes you have already completed setup and have your Click to Pay Drop-In UI capture context and SDK configured. For initial setup steps, see Get Started with Click to Pay Drop-In UI.
Test Payment Details
Use these test card numbers to test your Click to Pay Drop-In UI configuration.
Combine the BIN with the card number when sending to Click to Pay Drop-In UI.
Visa Click to Pay Drop-In UI Test Cards
These Visa test cards can be added to your Click to Pay Drop-In UI wallet.
Replace the X in the card number with 4.
You can manage your Visa Click to Pay Drop-In UI test cards and account here:
- Production: https://src.visa.com/login
- Test: https://sandbox.src.visa.com/login
To manage Visa test cards for customer authentication, contact your implementation consultant or technical account manager.
This table lists the Visa test card numbers:
| Card Number | Expiration Date | CVV |
|---|---|---|
| x6229x3123123755 | 12/2029 | 728 |
| x6229x3123123763 | 12/2029 | 605 |
| x6229x3123123771 | 12/2029 | 694 |
| x6229x3123123789 | 12/2029 | 881 |
| x6229x3123123797 | 12/2029 | 678 |
| x6229x3123123805 | 12/2029 | 084 |
| x6229x3123123813 | 12/2029 | 127 |
| x6229x3123123821 | 12/2029 | 218 |
| x6229x3123123839 | 12/2029 | 114 |
| x6229x31231238x7 | 12/2029 | 867 |
| x6229x312312385x | 12/2029 | 301 |
These Visa test card numbers can be used to test ECI05 frictionless authentication. Replace the X in the card number with 4:
| Card Number | Expiration Date | CVV |
|---|---|---|
| X6229X3123113723 | 12/2027 | 929 |
| X6229X3123113731 | 12/2027 | 217 |
These Visa test card numbers can be used to enroll in Passkey Service. Replace the X in the card number with 4:
| Card Number | Expiration Date | CVV |
|---|---|---|
| X3958X0327800110 | 12/2027 | 832 |
| X3958X0328300110 | 12/2027 | 474 |
Mastercard Test Cards
Mastercard test cards can be added to your Click to Pay Drop-In UI wallet. You must retrieve Mastercard test cards from their Click to Pay Drop-In UI test page: Mastercard test cards.
For Mastercard Click to Pay Drop-In UI, a Mastercard window opens and prompts you to enter additional information.
Mastercard has different test cards for retrieving tokenized and non-tokenized data. recommends using these test cards:
- Test cards to retrieve PAN data: use these cards when the customer is completing checkout as a one-time guest and does not have a Click to Pay Drop-In UI account or want to create one.
- Test cards to retrieve token data: use these cards for tokenized Click to Pay Drop-In UI transactions.
- Test cards eligible for tokenization: use these test cards to attempt Click to Pay Drop-In UI authentication when Click to Pay Drop-In UI authentication is enabled.
You can manage your Mastercard Click to Pay Drop-In UI test cards and account here:
- Production: https://src.mastercard.com/profile/enroll
- Test: https://sandbox.src.mastercard.com/profile/enroll
Mastercard authentication test cards are available on the Mastercard Checkout Solutions page in the Mastercard Developer Center.
Error Handling
The Unified Checkout SDK uses a structured error object for all error scenarios. The SDK returns errors as exceptions from asynchronous methods and also returns them as events for centralized handling.
UnifiedCheckoutError
All SDK errors are instances of UnifiedCheckoutError with these properties:
| Property | Type | Description |
|---|---|---|
correlationId | string? | The correlation ID from an underlying request, when applicable. |
details | unknown? | Additional error-specific information. This is often an array of objects. |
informationLink | string? | The URL linked to the online documentation for this error. |
message | string | A human-readable description of the error. |
name | string | The value is always "UnifiedCheckoutError". |
reason | string | A machine-readable error code, such as "CAPTURE_CONTEXT_INVALID". |
Detecting Errors
Errors might be serialized through postMessage. recommends using the name property instead of instanceof:
try { const result = await checkout.mount('#buttons');} catch (error) { if (error.name === 'UnifiedCheckoutError') { // Access error.reason, error.message, error.details }}A helper function can also be written for reuse:
function isUnifiedCheckoutError(obj) { return ( obj !== null && typeof obj === 'object' && obj.name === 'UnifiedCheckoutError' && typeof obj.reason === 'string' && typeof obj.message === 'string' );}Error Handling Patterns
Try/Catch
try { const client = await VAS.UnifiedCheckout(sessionJWT); const checkout = await client.createCheckout(); const result = await checkout.mount('#buttons');} catch (error) { console.error(error.reason, error.message);}Promise .catch()
VAS.UnifiedCheckout(sessionJWT) .then(client => client.createCheckout()) .then(checkout => checkout.mount('#buttons')) .catch(error => console.error(error.reason, error.message));Centralized Error Logging Using Events
Errors from all integrations are also emitted at the client level. The client.on('error') event supports centralized logging:
const client = await VAS.UnifiedCheckout(sessionJWT);client.on('error', (err) => { errorReporter.send({ source: err.source, // "checkout", "trigger", "button", or "client" code: err.code, message: err.message });});recommends this approach because it catches errors from all checkouts, triggers, and buttons created from this client instance.
Error Codes
Initialization Errors
These errors are returned during VAS.UnifiedCheckout(sessionJWT):
| Reason | Description |
|---|---|
CAPTURE_CONTEXT_EXPIRED | The supplied JWT has expired. Generate a new session. |
CAPTURE_CONTEXT_INVALID | The session JWT is not valid. For example, it has a bad signature or is malformed. |
UNUSED_TARGET_ORIGINS | One or more targetOrigins in the session do not match the current page origin. The details array lists the unused origins. |
Mount Errors
These errors are returned during checkout.mount() or trigger.mount():
| Reason | Description |
|---|---|
CHECKOUT_ALREADY_MOUNTED | The checkout or trigger is already mounted. Call unmount() first, or create a new instance. |
MOUNT_CONTAINER_SELECTOR | The CSS selector does not match any Document Object Model (DOM) element. Check that the container exists before calling mount(). |
MOUNT_ERROR | A problem occurred loading the payment iframe. |
MOUNT_INVALID_CONTAINER | The supplied container parameter is not a valid CSS selector string or HTMLElement. |
MOUNT_PAYMENT_TIMEOUT | A payment method timed out during initialization. |
MOUNT_PAYMENT_UNAVAILABLE | No payment types could be presented to the customer. This might be due to browser or device support, or errors during checkout initialization. |
MOUNT_SIDEBAR_OPTIONS | The supplied container parameter is invalid for sidebar mode. |
MOUNT_TOKEN_TIMEOUT | Token creation timed out during mount. This might indicate a network issue. |
MOUNT_TOKEN_XHR_ERROR | A network error occurred during token creation. Check the customer's connectivity. |
Checkout Errors
This table lists the reason values returned during checkout:
| Reason | Description |
|---|---|
CHECKOUT_ERROR | A general checkout error occurred. |
CHECKOUT_PAYMENT_PARAMETERS | One or more payment parameters have a validation error. |
CHECKOUT_VALIDATION_PARAMS | One or more checkout parameters have a validation error. |
Trigger Errors
This table lists the reason value returned for a trigger operation error:
| Reason | Description |
|---|---|
TRIGGER_PAYMENT_TYPE_NOT_SUPPORTED | The specified payment type cannot be used with a trigger. Only PANENTRY and CLICKTOPAY values are supported. |
Payment-Specific Errors
This table lists reason values for payment-specific errors:
| Reason | Description |
|---|---|
CLICK_TO_PAY_SDK_LOAD_ERROR | The Click to Pay SDK failed to load. |
ENCRYPT_CARD_FOR_SRC_ENROLMENT_ERROR | Card encryption for Click to Pay enrollment failed. |
GOOGLEPAY_CHECKOUT_ERROR | A Google Pay checkout error occurred. |
LAUNCH_SRC_CHECKOUT_ERROR | Launching the Click to Pay checkout failed. |
TRIGGER_PAYMENT_TYPE_NOT_SUPPORTED | The payment type is not supported for triggers. |
General Errors
This table lists the reason code returned for an unspecified error:
| Reason Code | Description |
|---|---|
UNKNOWN_ERROR | An unknown error has occurred. |
Related Resources
This section provides these related resources:
Thanks for your feedback!
Last published: September 29, 2026