Skip to main content

Web Drop-in

Use Drop-in to support native 3D Secure 2 on your website

Requirements

This page explains how to implement native 3D Secure 2 authentication with your existing Web Drop-in integration.

Requirements

Before you begin, take into account the following requirements, limitations, and preparations.

How it works

When making a card payment with native 3D Secure 2 authentication:
  1. Show the available cards in your payment form.
  2. Configure Drop-in to collect the cardholder name.
  3. Provide additional parameters when making a payment request.
  4. Submit authentication result if you receive an action object in response to your /payments or /payments/details request.
  5. Handle the redirect result if the payment was routed to the 3D Secure 2 redirect flow.

Show Available Cards

Show the available cards in your payment form

For information about the supported countries/regions and currencies for each card, refer to Payment methods. Drop-in uses the combination of countryCode and amount.currency from your /paymentMethods request to show the available cards to your shopper. When the shopper is entering their card details, Drop-in tries to recognize the card brand. When successful, Drop-in renders the brand icon and the corresponding input field for the card security code (CVC, CVV, or CID).

Collect Additional Parameters

Collect additional information at checkout

For higher authentication rates, we strongly recommend that you collect the cardholder name, billing address, and email address for payments with 3D Secure authentication.

Configure cards with Drop-in

When creating a configuration object for Drop-in, add optional configuration for cards in your paymentMethodsConfiguration object. You can customize your shopper’s experience further with optional configuration parameters and specific events. Configure Drop-in for cards

Handle Drop-in errors

When an error occurs, the onError event returns an object which contains details about the error. For errors that happen during the 3D Secure 2 authentication, you do not need to stop the payment flow because the shopper can continue.

Collect shopper email in your payment form

We also recommend that you collect the shopper email in advance in your payment form. Deliver this parameter to your backend when making a payment, because it is required by the card schemes.

Make a payment

When the shopper selects to pay, Drop-in calls the onSubmit event, which contains a state.data.
  1. Pass the state.data to your server.
  2. When you make a payment request, include the following additional 3D Secure 2 parameters. See additional 3D Secure 2 parameters that we recommend to include in your request to increase authentication performance in our API reference. This is the required icon. Required for all transactions.
    This is the conditionally required icon. Required for particular setups, or issuers and card schemes.
    This is the recommended icon. Recommended for all transactions, but not required.
    Below is an example /payments request. Make a payment request

    curl

    Java

    PHP

    C#

    NodeJS (JavaScript)

    Go

    Python

    Ruby

    NodeJS (TypeScript)

  3. In the response, check if there is an action object. Your next steps depend on whether the response contains an action object, and on the action.type. The following example shows a /payments response with action.type: threeDS2.
/payments response with action

Submit Authentication Result

Submit the authentication result

Drop-in handles the action after it is returned within the onSubmit event and performs the required authentication flow. If the issuer requires shopper interaction, Drop-in presents the challenge screen. Pass the result code and action to Drop-in with onSubmit
When the shopper completes the challenge, Drop-in calls the onAdditionalDetails event.
  1. Get the state.data from the onAdditionalDetails event, and pass it to your server.
  2. From your server, make a POST /payments/details request, specifying:
    • details: The state.data.details from the onAdditionalDetails event.
    /payments/details request
    The /payments/details response has a resultCode. You will need it to present the payment result.
  3. Pass the resultCode you received in the /payments/details response to the actions.resolve() object. Depending on the result code, the onPaymentCompleted or onPaymentFailed event is triggered to complete the payment flow. Pass the result code to Drop-in with onAdditionalDetails

Present Result

Present the payment result

Use the  resultCode from the /payments or /payments/details response to present the payment result to your shopper. You will also receive the outcome of the payment asynchronously in a webhook. For card payments, you can receive the following resultCode values:

Testing

Test and go live

Use our test card numbers to test how your integration handles different 3D Secure authentication scenarios. When you are ready to go live, follow our go-live checklist. When using our live endpoints, make sure that all API requests you make for the same payment session use the same live endpoint region. Using different regions for /payments and /payments/details requests may result in errors when authenticating with 3D Secure.

Live environment values

See also

Web Components

Use the Component to support native 3D Secure 2 on your website

Requirements

This page explains how to implement native 3D Secure 2 authentication with your existing Web Components integration.

Requirements

Before you begin, take into account the following requirements, limitations, and preparations.

How it works

To handle native 3D Secure 2 authentication:
  1. Get additional shopper details in your payment form.
  2. Make a payment request, including additional shopper details.
  3. Handle the 3D Secure 2 action to perform the authentication flow.
  4. Submit the authentication result.
  5. Show the payment result.

Collect Additional Details

Collect additional shopper details in your payment form

For higher authentication rates, we strongly recommend that you collect the shopper’s email address, cardholder name, billing address, and IP address for payments with 3D Secure authentication.
Get the shopper’s email outside of the Card Component because it does not have a configuration to include shopper email in the payment form.To get the cardholder name and billing address in your payment form, include the following when creating an instance of the Card Component.Do not use placeholder data for these fields in your live environment.Configure the card component
You can customize your shopper’s experience further with optional configuration parameters and specific events.