- Configure Drop-in to collect the card holder name.
- Provide the required 3D Secure parameters when making a payment request.
- 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:- Make sure that you have set up your back end implementation, and added Drop-in to your payment form.
- Add the cards that you want to accept in your test Customer Area.
- 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:- 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.
-
When initializing the Drop-in, create a configuration object, and specify:
configuration.card.showsHolderNameField: true. This shows the input field for the cardholder name.
- Sign in to your Customer Area using your company account.
- Navigate to Developers > API credentials.
- Click on your web service user (ws@Company.[YourCompanyAccount]) in the users list.
This opens the Edit Web Service User page. - In the Client-Side Encryption panel, copy the Client Encryption Public Key.
Make a payment
When the shopper proceeds to pay, Drop-in invokes thedidSubmit method which contains data.paymentMethod.
-
Pass
data.paymentMethodto your server. -
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.
Required for all transactions.
Required for particular setups, or issuers and card schemes.
Recommended for all transactions, but not required.
curl
Java
PHP
C#
NodeJS (JavaScript)
Go
Python
Ruby
NodeJS (TypeScript)
-
In the response, check if there is an
actionobject. Your next steps depend on whether the response contains anactionobject, and on theaction.type.A sample /payments response withaction.type: redirect: /payments response
Handle the redirect result
Drop-in usesdropInComponent.handle(action) to redirect the shopper to complete the 3D Secure authentication.
-
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 thedidProvidemethod. -
From your server, make a POST /payments/details request providing the
datafrom thedidProvidemethod 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.
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 followingresultCode values: