Skip to main content
Our iOS Drop-in renders the available cards in your payment form, and securely collects any sensitive card information, so it doesn’t touch your server. Drop-in also redirects the shopper to perform the 3D Secure 2 authentication. When making a card payment with redirect 3D Secure 2 authentication, you additionally need to:
  1. Configure Drop-in to collect the card holder name.
  2. Provide the required 3D Secure parameters when making a payment request.
  3. Handle the redirect result after the shopper returns to your website.

Requirements

This page explains how to add cards with redirect 3D Secure authentication to your existing iOS Drop-in integration. The iOS Drop-in integration works the same way for all payment methods. If you haven’t done this integration yet, refer to our Drop-in integration guide. Before starting your integration:
  1. Make sure that you have set up your back end implementation, and added Drop-in to your payment form.
  2. Add the cards that you want to accept in your test Customer Area.
  3. If you are using 3D Secure for PSD2 compliance, read our comprehensive PSD2 SCA guide.

Collect additional parameters in your payment form

For higher authentication rates, we strongly recommend that you collect the shopper card holder name and billing address in advance in your payment form. Deliver these parameters to your backend when making a payment, because they are required by the card schemes.

Show the available cards in your payment form

For information about the supported countries/regions and currencies for each card, refer to Payment methods. To show cards in your payment form:
  1. Specify in your /paymentMethods request a combination of countryCode and amount.currency. Drop-in uses this information to show the available cards to your shopper.
  2. When initializing the Drop-in, create a configuration object, and specify:
    • configuration.card.showsHolderNameField: true. This shows the input field for the cardholder name.
    To get your public key:
    1. Sign in to your Customer Area using your company account.
    2. Navigate to Developers > API credentials.
    3. Click on your web service user (ws@Company.[YourCompanyAccount]) in the users list.
      This opens the Edit Web Service User page.
    4. In the Client-Side Encryption panel, copy the Client Encryption Public Key.
When the shopper is entering their card details, Drop-in tries to recognize the card brand. When successful, Drop-in renders the brand icon.

Make a payment

When the shopper proceeds to pay, Drop-in invokes the didSubmit method which contains data.paymentMethod.
  1. Pass data.paymentMethod 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.

    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. A sample /payments response with action.type: redirect: /payments response

Handle the redirect result

Drop-in uses dropInComponent.handle(action) to redirect the shopper to complete the 3D Secure authentication.
  1. To inform Drop-in when the shopper returns to your app, implement the following in your UIApplicationDelegate:
    After Drop-in completes the action, it invokes the didProvide method.
  2. From your server, make a POST /payments/details request providing the data from the didProvide method from your client app. On Checkout API v67 and later, the payment is authorized after the shopper completes authentication. You make a /payments/details request to get the payment result. On earlier versions, you need to complete the payment by making a /payments/details request containing payment data.

    curl

    Java

    PHP

    C#

    NodeJS (JavaScript)

    Python

    Ruby

    You receive a response containing:
    • resultCode: Use this to present the result to your shopper.
    • pspReference: Our unique identifier for the transaction.
    /payments/details response
For more information and detailed instructions, refer to Handling the redirect 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:

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.

See also