--- title: "Redirect 3DS API-only integration" description: "Support 3D Secure authentication through a redirect page." url: "https://docs.adyen.com/online-payments/3d-secure/redirect-3ds2/api-only" source_url: "https://docs.adyen.com/online-payments/3d-secure/redirect-3ds2/api-only.md" canonical: "https://docs.adyen.com/online-payments/3d-secure/redirect-3ds2/api-only" last_modified: "2021-05-11T17:39:00+02:00" language: "en" --- # Redirect 3DS API-only integration Support 3D Secure authentication through a redirect page. ![](/user/pages/reuse/development-resources/additional-info-resources/postman-logo-vertical-orange-2021.svg?decoding=auto\&fetchpriority=auto)  [Postman collection](https://www.postman.com/adyendev/workspace/adyen-apis/collection/25716737-46ad970e-dc9e-4246-bac2-769c6083e7b5) **Implementation examples**\ ![](/user/pages/reuse/development-resources/additional-info-resources/nodejs-original.svg?decoding=auto\&fetchpriority=auto)  [Node.js](https://github.com/adyen-examples/adyen-node-online-payments/tree/main/3ds2-example)       Use our APIs to accept cards with 3D Secure authentication through a redirect page. When adding card payments with redirect 3D Secure authentication to your integration, you additionally need to: 1. [Collect the additional parameters in your payment form](#collect-additional-parameters). 2. [Provide the required 3D Secure parameters](#make-a-payment) when making a payment request. 3. [Handle the redirect](/online-payments/build-your-integration/advanced-flow/?platform=Web\&integration=API%20only#handle-the-redirect). ## Requirements Before starting your integration: 1. If building a mobile integration, contact our [Support Team](https://ca-test.adyen.com/ca/ca/contactUs/support.shtml?form=other) to make sure that 3D Secure is triggered in your app. 2. Make sure that you have integrated our Card Component for [Web](/payment-methods/cards/web-component), [iOS](/payment-methods/cards/ios-component), or [Android](/payment-methods/cards/android-drop-in) or [built your own UI](/payment-methods/cards/api-only) for collecting shopper's card details. 3. If you are using 3D Secure for PSD2 compliance, read our [comprehensive PSD2 SCA guide](/online-payments/psd2-sca-compliance-and-implementation-guide). ## Collect additional parameters in your payment form For higher authentication rates, we strongly recommend that you collect the card holder name, the shopper billing address and email address in advance in your payment form. Deliver these parameters to your backend when [making a payment](#make-a-payment) as they are required by the card schemes. ### Collect card holder name in your payment form You can use our [Card Component](/payment-methods/cards/) to build your payment form for 3D Secure 2 authentication. Select the channel that you are using below: ### Tab: Web Card Component To collect the card holder name using our [Card Component](/payment-methods/cards/web-component), include the following when [creating an instance of the Card Component](/payment-methods/cards/web-component#component-configuration): * `hasHolderName`: **true**. This shows the input field for the card holder name. * `holderNameRequired`: **true**. This makes the card holder name a required field. ```js const card = checkout.create("card", { hasHolderName: true, holderNameRequired: true }).mount("#card-container"); ``` ### Tab: iOS Card Component To collect the card holder name using our [Card Component](/payment-methods/cards/ios-component), specify the following when [adding the Card Component](/payment-methods/cards/ios-component/#optional-configuration): * `showsHolderNameField`: **true** ```swift let configuration = CardComponent.Configuration(showsHolderNameField: true) let component = CardComponent(paymentMethod: paymentMethod, apiContext: apiContext, configuration: configuration) component.delegate = self self.cardComponent = component present(component.viewController, animated: true) ``` ### Tab: Android Card Component To collect the card holder name using our [Card Component](/payment-methods/cards/android-component), set `holderNameRequired` to **true** when [creating a `cardConfiguration` object](/payment-methods/cards/android-component#show-the-available-cards-in-your-payment-form): ```kotlin val cardConfiguration = CardConfiguration.Builder(context, "YOUR_CLIENT_KEY") .setHolderNameRequired(true) // When you are ready to accept live payments, change the value to one of our live environments. .setEnvironment(Environment.TEST) .build() ``` ### Tab: React Native Card Component To collect the card holder name using our [Card Component](/payment-methods/cards/react-native-component), set `holderNameRequired` to **true** when [creating a `cardConfiguration` object](/payment-methods/cards/react-native-component/#configuration): ```js const configuration = { environment: 'test', clientKey: '{YOUR_CLIENT_KEY}', card: { holderNameRequired: true } } ``` ## Make a payment Select the channel that you are using below: ### Tab: Web To make a card payment with 3D Secure redirect authentication on Web, proceed with the following steps: 1. From your server, make a [/payments](https://docs.adyen.com/api-explorer/Checkout/latest/post/payments) request, specifying: | Parameter name | Required | Description | | ---------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | | [paymentMethod](https://docs.adyen.com/api-explorer/Checkout/latest/post/payments#request-paymentMethod) | ![-white\_check\_mark-](/user/data/smileys/emoji/white_check_mark.png "-white_check_mark-") | If using the Card Component for [Web](/payment-methods/cards/web-component), pass the parameters returned by the Component. If submitting raw card data, refer to [Raw card data](/payment-methods/cards/raw-card-data#make-a-payment) for the fields that you need to pass. | | [browserInfo](https://docs.adyen.com/api-explorer/Checkout/latest/post/payments#request-browserInfo) | ![-white\_check\_mark-](/user/data/smileys/emoji/white_check_mark.png "-white_check_mark-") | The shopper's browser information. If using the Web Card Component, pass the `state.data.browserInfo` object from the `onChange` event. | | [returnUrl](https://docs.adyen.com/api-explorer/Checkout/latest/post/payments#request-returnUrl) | ![-white\_check\_mark-](/user/data/smileys/emoji/white_check_mark.png "-white_check_mark-") | The URL where the shopper will be redirected back to after completing 3D Secure authentication. The return URL can be a maximum of **1024 characters** and must not include `//` (double slash) after the top-level domain. The URL should include the protocol: `http://` or `https://`. You can also include your own additional query parameters, for example, shopper ID or order reference number. In the response, you receive a URL that requires a POST request. | | [billingAddress](https://docs.adyen.com/api-explorer/Checkout/latest/post/payments#request-billingAddress) | | The cardholder's billing address. | | [shopperEmail](https://docs.adyen.com/api-explorer/Checkout/latest/post/payments#request-shopperEmail) | | The cardholder's email address. | | [shopperIP](https://docs.adyen.com/api-explorer/Checkout/latest/post/payments#request-shopperIP) | | The shopper's IP address. | To increase the likelihood of achieving a [frictionless flow](/online-payments/3d-secure#frictionless-flow) and higher authorisation rates, we recommend that you send [additional parameters](/online-payments/3d-secure/api-reference#3d-secure-2-additional-data-objects). For `channel` **Web**, we recommend including these additional parameters: `billingAddress`, `shopperEmail`, and `shopperIP`. A sample [/payments](https://docs.adyen.com/api-explorer/Checkout/latest/post/payments) request for **Web**: #### curl ```bash curl https://checkout-test.adyen.com/v68/payments \ -H 'x-api-key: ADYEN_API_KEY' \ -H 'content-type: application/json' \ -d '{ "amount":{ "currency":"EUR", "value":1000 }, "reference":"YOUR_ORDER_NUMBER", "shopperReference":"YOUR_UNIQUE_SHOPPER_ID", "paymentMethod":{ "type":"scheme", "encryptedCardNumber":"adyenjs_0_1_18$k7s65M5V0KdPxTErhBIPoMPI8HlC..", "encryptedExpiryMonth":"adyenjs_0_1_18$p2OZxW2XmwAA8C1Avxm3G9UB6e4..", "encryptedExpiryYear":"adyenjs_0_1_18$CkCOLYZsdqpxGjrALWHj3QoGHqe+..", "encryptedSecurityCode":"adyenjs_0_1_24$XUyMJyHebrra/TpSda9fha978+..", "holderName":"S. Hopper" }, "{hint:state.data.browserInfo from onChange or onSubmit}browserInfo{/hint}":{ "userAgent":"Mozilla\/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit\/537.36 (KHTML, like Gecko) Chrome\/70.0.3538.110 Safari\/537.36", "acceptHeader":"text\/html,application\/xhtml+xml,application\/xml;q=0.9,image\/webp,image\/apng,*\/*;q=0.8", "language":"nl-NL", "colorDepth":24, "screenHeight":723, "screenWidth":1536, "timeZoneOffset":0, "javaEnabled":true }, "{hint:state.data.billingAddress from onSubmit}billingAddress{/hint}": { "street": "Infinite Loop", "houseNumberOrName": "1", "postalCode": "1011DJ", "city": "Amsterdam", "country": "NL" }, "shopperEmail":"s.hopper@example.com", "shopperIP":"192.0.2.1", "channel":"web", "returnUrl":"https://your-company.example.com/checkout?shopperOrder=12xy..", "merchantAccount":"YOUR_MERCHANT_ACCOUNT" }' ``` #### Java ```java // Adyen Java API Library v26.3.0 import com.adyen.Client; import com.adyen.enums.Environment; import com.adyen.model.checkout.*; import java.time.OffsetDateTime; import java.util.*; import com.adyen.model.RequestOptions; import com.adyen.service.checkout.*; // For the live environment, additionally include your liveEndpointUrlPrefix. Client client = new Client("ADYEN_API_KEY", Environment.TEST); // Create the request object(s) Amount amount = new Amount() .currency("EUR") .value(1000L); CardDetails cardDetails = new CardDetails() .encryptedCardNumber("adyenjs_0_1_18$k7s65M5V0KdPxTErhBIPoMPI8HlC..") .holderName("S. Hopper") .encryptedSecurityCode("adyenjs_0_1_24$XUyMJyHebrra/TpSda9fha978+..") .encryptedExpiryYear("adyenjs_0_1_18$CkCOLYZsdqpxGjrALWHj3QoGHqe+..") .encryptedExpiryMonth("adyenjs_0_1_18$p2OZxW2XmwAA8C1Avxm3G9UB6e4..") .type(CardDetails.TypeEnum.SCHEME); BillingAddress billingAddress = new BillingAddress() .country("NL") .city("Amsterdam") .street("Infinite Loop") .houseNumberOrName("1") .postalCode("1011DJ"); BrowserInfo browserInfo = new BrowserInfo() .acceptHeader("text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,image/apng,*/*;q=0.8") .screenWidth(1536) .javaEnabled(true) .screenHeight(723) .timeZoneOffset(0) .userAgent("Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/70.0.3538.110 Safari/537.36") .language("nl-NL") .colorDepth(24); PaymentRequest paymentRequest = new PaymentRequest() .reference("YOUR_ORDER_NUMBER") .amount(amount) .merchantAccount("YOUR_MERCHANT_ACCOUNT") .channel(PaymentRequest.ChannelEnum.WEB) .paymentMethod(new CheckoutPaymentMethod(cardDetails)) .shopperEmail("s.hopper@example.com") .shopperIP("192.0.2.1") .billingAddress(billingAddress) .returnUrl("https://your-company.example.com/checkout?shopperOrder=12xy..") .browserInfo(browserInfo) .shopperReference("YOUR_UNIQUE_SHOPPER_ID"); // Send the request PaymentsApi service = new PaymentsApi(client); PaymentResponse response = service.payments(paymentRequest, new RequestOptions().idempotencyKey("UUID")); ``` #### PHP ```php // Adyen PHP API Library v18.2.1 use Adyen\Client; use Adyen\Environment; use Adyen\Model\Checkout\Amount; use Adyen\Model\Checkout\CheckoutPaymentMethod; use Adyen\Model\Checkout\BillingAddress; use Adyen\Model\Checkout\BrowserInfo; use Adyen\Model\Checkout\PaymentRequest; use Adyen\Service\Checkout\PaymentsApi; $client = new Client(); $client->setXApiKey("ADYEN_API_KEY"); // For the live environment, additionally include your liveEndpointUrlPrefix. $client->setEnvironment(Environment::TEST); // Create the request object(s) $amount = new Amount(); $amount ->setCurrency("EUR") ->setValue(1000); $checkoutPaymentMethod = new CheckoutPaymentMethod(); $checkoutPaymentMethod ->setEncryptedCardNumber("adyenjs_0_1_18\$k7s65M5V0KdPxTErhBIPoMPI8HlC..") ->setHolderName("S. Hopper") ->setEncryptedSecurityCode("adyenjs_0_1_24\$XUyMJyHebrra/TpSda9fha978+..") ->setEncryptedExpiryYear("adyenjs_0_1_18\$CkCOLYZsdqpxGjrALWHj3QoGHqe+..") ->setEncryptedExpiryMonth("adyenjs_0_1_18\$p2OZxW2XmwAA8C1Avxm3G9UB6e4..") ->setType("scheme"); $billingAddress = new BillingAddress(); $billingAddress ->setCountry("NL") ->setCity("Amsterdam") ->setStreet("Infinite Loop") ->setHouseNumberOrName("1") ->setPostalCode("1011DJ"); $browserInfo = new BrowserInfo(); $browserInfo ->setAcceptHeader("text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,image/apng,*/*;q=0.8") ->setScreenWidth(1536) ->setJavaEnabled(true) ->setScreenHeight(723) ->setTimeZoneOffset(0) ->setUserAgent("Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/70.0.3538.110 Safari/537.36") ->setLanguage("nl-NL") ->setColorDepth(24); $paymentRequest = new PaymentRequest(); $paymentRequest ->setReference("YOUR_ORDER_NUMBER") ->setAmount($amount) ->setMerchantAccount("YOUR_MERCHANT_ACCOUNT") ->setChannel("web") ->setPaymentMethod($checkoutPaymentMethod) ->setShopperEmail("s.hopper@example.com") ->setShopperIP("192.0.2.1") ->setBillingAddress($billingAddress) ->setReturnUrl("https://your-company.example.com/checkout?shopperOrder=12xy..") ->setBrowserInfo($browserInfo) ->setShopperReference("YOUR_UNIQUE_SHOPPER_ID"); $requestOptions['idempotencyKey'] = 'UUID'; // Send the request $service = new PaymentsApi($client); $response = $service->payments($paymentRequest, $requestOptions); ``` #### C\# ```cs // Adyen .net API Library v17.0.0 using Adyen; using Environment = Adyen.Model.Environment; using Adyen.Model; using Adyen.Model.Checkout; using Adyen.Service.Checkout; // For the live environment, additionally include your liveEndpointUrlPrefix. var config = new Config() { XApiKey = "ADYEN_API_KEY", Environment = Environment.Test }; var client = new Client(config); // Create the request object(s) Amount amount = new Amount { Currency = "EUR", Value = 1000 }; CardDetails cardDetails = new CardDetails { EncryptedCardNumber = "adyenjs_0_1_18$k7s65M5V0KdPxTErhBIPoMPI8HlC..", HolderName = "S. Hopper", EncryptedSecurityCode = "adyenjs_0_1_24$XUyMJyHebrra/TpSda9fha978+..", EncryptedExpiryYear = "adyenjs_0_1_18$CkCOLYZsdqpxGjrALWHj3QoGHqe+..", EncryptedExpiryMonth = "adyenjs_0_1_18$p2OZxW2XmwAA8C1Avxm3G9UB6e4..", Type = CardDetails.TypeEnum.Scheme }; BillingAddress billingAddress = new BillingAddress { Country = "NL", City = "Amsterdam", Street = "Infinite Loop", HouseNumberOrName = "1", PostalCode = "1011DJ" }; BrowserInfo browserInfo = new BrowserInfo { AcceptHeader = "text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,image/apng,*/*;q=0.8", ScreenWidth = 1536, JavaEnabled = true, ScreenHeight = 723, TimeZoneOffset = 0, UserAgent = "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/70.0.3538.110 Safari/537.36", Language = "nl-NL", ColorDepth = 24 }; PaymentRequest paymentRequest = new PaymentRequest { Reference = "YOUR_ORDER_NUMBER", Amount = amount, MerchantAccount = "YOUR_MERCHANT_ACCOUNT", Channel = PaymentRequest.ChannelEnum.Web, PaymentMethod = new CheckoutPaymentMethod(cardDetails), ShopperEmail = "s.hopper@example.com", ShopperIP = "192.0.2.1", BillingAddress = billingAddress, ReturnUrl = "https://your-company.example.com/checkout?shopperOrder=12xy..", BrowserInfo = browserInfo, ShopperReference = "YOUR_UNIQUE_SHOPPER_ID" }; // Send the request var service = new PaymentsService(client); var response = service.Payments(paymentRequest, requestOptions: new RequestOptions { IdempotencyKey = "UUID"}); ``` #### NodeJS (JavaScript) ```js // Adyen Node API Library v17.3.0 // Require the parts of the module you want to use const { Client, CheckoutAPI } = require('@adyen/api-library'); // Initialize the client object // For the live environment, additionally include your liveEndpointUrlPrefix. const client = new Client({apiKey: "ADYEN_API_KEY", environment: "TEST"}); // Create the request object(s) const paymentRequest = { amount: { currency: "EUR", value: 1000 }, reference: "YOUR_ORDER_NUMBER", shopperReference: "YOUR_UNIQUE_SHOPPER_ID", paymentMethod: { type: "scheme", encryptedCardNumber: "adyenjs_0_1_18$k7s65M5V0KdPxTErhBIPoMPI8HlC..", encryptedExpiryMonth: "adyenjs_0_1_18$p2OZxW2XmwAA8C1Avxm3G9UB6e4..", encryptedExpiryYear: "adyenjs_0_1_18$CkCOLYZsdqpxGjrALWHj3QoGHqe+..", encryptedSecurityCode: "adyenjs_0_1_24$XUyMJyHebrra/TpSda9fha978+..", holderName: "S. Hopper" }, browserInfo: { userAgent: "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/70.0.3538.110 Safari/537.36", acceptHeader: "text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,image/apng,*/*;q=0.8", language: "nl-NL", colorDepth: 24, screenHeight: 723, screenWidth: 1536, timeZoneOffset: 0, javaEnabled: true }, billingAddress: { street: "Infinite Loop", houseNumberOrName: "1", postalCode: "1011DJ", city: "Amsterdam", country: "NL" }, shopperEmail: "s.hopper@example.com", shopperIP: "192.0.2.1", channel: "web", returnUrl: "https://your-company.example.com/checkout?shopperOrder=12xy..", merchantAccount: "YOUR_MERCHANT_ACCOUNT" } // Send the request const checkoutAPI = new CheckoutAPI(client); const response = checkoutAPI.PaymentsApi.payments(paymentRequest, { idempotencyKey: "UUID" }); ``` #### Go ```go // Adyen Go API Library v10.4.0 import ( "context" "github.com/adyen/adyen-go-api-library/v9/src/common" "github.com/adyen/adyen-go-api-library/v9/src/adyen" "github.com/adyen/adyen-go-api-library/v9/src/checkout" ) // For the live environment, additionally include your liveEndpointUrlPrefix. client := adyen.NewClient(&common.Config{ ApiKey: "ADYEN_API_KEY", Environment: common.TestEnv, }) // Create the request object(s) amount := checkout.Amount{ Currency: "EUR", Value: 1000, } cardDetails := checkout.CardDetails{ EncryptedCardNumber: common.PtrString("adyenjs_0_1_18$k7s65M5V0KdPxTErhBIPoMPI8HlC.."), HolderName: common.PtrString("S. Hopper"), EncryptedSecurityCode: common.PtrString("adyenjs_0_1_24$XUyMJyHebrra/TpSda9fha978+.."), EncryptedExpiryYear: common.PtrString("adyenjs_0_1_18$CkCOLYZsdqpxGjrALWHj3QoGHqe+.."), EncryptedExpiryMonth: common.PtrString("adyenjs_0_1_18$p2OZxW2XmwAA8C1Avxm3G9UB6e4.."), Type: common.PtrString("scheme"), } billingAddress := checkout.BillingAddress{ Country: "NL", City: "Amsterdam", Street: "Infinite Loop", HouseNumberOrName: "1", PostalCode: "1011DJ", } browserInfo := checkout.BrowserInfo{ AcceptHeader: "text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,image/apng,*/*;q=0.8", ScreenWidth: 1536, JavaEnabled: true, ScreenHeight: 723, TimeZoneOffset: 0, UserAgent: "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/70.0.3538.110 Safari/537.36", Language: "nl-NL", ColorDepth: 24, } paymentRequest := checkout.PaymentRequest{ Reference: "YOUR_ORDER_NUMBER", Amount: amount, MerchantAccount: "YOUR_MERCHANT_ACCOUNT", Channel: common.PtrString("web"), PaymentMethod: checkout.CardDetailsAsCheckoutPaymentMethod(&cardDetails), ShopperEmail: common.PtrString("s.hopper@example.com"), ShopperIP: common.PtrString("192.0.2.1"), BillingAddress: &billingAddress, ReturnUrl: "https://your-company.example.com/checkout?shopperOrder=12xy..}", BrowserInfo: &browserInfo, ShopperReference: common.PtrString("YOUR_UNIQUE_SHOPPER_ID"), } // Send the request service := client.Checkout() req := service.PaymentsApi.PaymentsInput().IdempotencyKey("UUID").PaymentRequest(paymentRequest) res, httpRes, err := service.PaymentsApi.Payments(context.Background(), req) ``` #### Python ```py # Adyen Python API Library v12.5.1 import Adyen adyen = Adyen.Adyen() adyen.client.xapikey = "ADYEN_API_KEY" # For the live environment, additionally include your liveEndpointUrlPrefix. adyen.client.platform = "test" # The environment to use library in. # Create the request object(s) json_request = { "amount": { "currency": "EUR", "value": 1000 }, "reference": "YOUR_ORDER_NUMBER", "shopperReference": "YOUR_UNIQUE_SHOPPER_ID", "paymentMethod": { "type": "scheme", "encryptedCardNumber": "adyenjs_0_1_18$k7s65M5V0KdPxTErhBIPoMPI8HlC..", "encryptedExpiryMonth": "adyenjs_0_1_18$p2OZxW2XmwAA8C1Avxm3G9UB6e4..", "encryptedExpiryYear": "adyenjs_0_1_18$CkCOLYZsdqpxGjrALWHj3QoGHqe+..", "encryptedSecurityCode": "adyenjs_0_1_24$XUyMJyHebrra/TpSda9fha978+..", "holderName": "S. Hopper" }, "browserInfo": { "userAgent": "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/70.0.3538.110 Safari/537.36", "acceptHeader": "text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,image/apng,*/*;q=0.8", "language": "nl-NL", "colorDepth": 24, "screenHeight": 723, "screenWidth": 1536, "timeZoneOffset": 0, "javaEnabled": True }, "billingAddress": { "street": "Infinite Loop", "houseNumberOrName": "1", "postalCode": "1011DJ", "city": "Amsterdam", "country": "NL" }, "shopperEmail": "s.hopper@example.com", "shopperIP": "192.0.2.1", "channel": "web", "returnUrl": "https://your-company.example.com/checkout?shopperOrder=12xy..", "merchantAccount": "YOUR_MERCHANT_ACCOUNT" } # Send the request result = adyen.checkout.payments_api.payments(request=json_request, idempotency_key="UUID") ``` #### Ruby ```rb # Adyen Ruby API Library v9.5.1 require "adyen-ruby-api-library" adyen = Adyen::Client.new adyen.api_key = 'ADYEN_API_KEY' # For the live environment, additionally include your liveEndpointUrlPrefix. adyen.env = :test # Set to "live" for live environment # Create the request object(s) request_body = { :amount => { :currency => 'EUR', :value => 1000 }, :reference => 'YOUR_ORDER_NUMBER', :shopperReference => 'YOUR_UNIQUE_SHOPPER_ID', :paymentMethod => { :type => 'scheme', :encryptedCardNumber => 'adyenjs_0_1_18$k7s65M5V0KdPxTErhBIPoMPI8HlC..', :encryptedExpiryMonth => 'adyenjs_0_1_18$p2OZxW2XmwAA8C1Avxm3G9UB6e4..', :encryptedExpiryYear => 'adyenjs_0_1_18$CkCOLYZsdqpxGjrALWHj3QoGHqe+..', :encryptedSecurityCode => 'adyenjs_0_1_24$XUyMJyHebrra/TpSda9fha978+..', :holderName => 'S. Hopper' }, :browserInfo => { :userAgent => 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/70.0.3538.110 Safari/537.36', :acceptHeader => 'text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,image/apng,*/*;q=0.8', :language => 'nl-NL', :colorDepth => 24, :screenHeight => 723, :screenWidth => 1536, :timeZoneOffset => 0, :javaEnabled => true }, :billingAddress => { :street => 'Infinite Loop', :houseNumberOrName => '1', :postalCode => '1011DJ', :city => 'Amsterdam', :country => 'NL' }, :shopperEmail => 's.hopper@example.com', :shopperIP => '192.0.2.1', :channel => 'web', :returnUrl => 'https://your-company.example.com/checkout?shopperOrder=12xy..', :merchantAccount => 'YOUR_MERCHANT_ACCOUNT' } # Send the request result = adyen.checkout.payments_api.payments(request_body, headers: { 'Idempotency-Key' => 'UUID' }) ``` #### NodeJS (TypeScript) ```ts // Adyen Node API Library v17.3.0 // Require the parts of the module you want to use import { Client, CheckoutAPI, Types } from "@adyen/api-library"; // Initialize the client object // For the live environment, additionally include your liveEndpointUrlPrefix. const client = new Client({apiKey: "ADYEN_API_KEY", environment: "TEST"}); // Create the request object(s) const amount: Types.checkout.Amount = { currency: "EUR", value: 1000 }; const cardDetails: Types.checkout.CardDetails = { encryptedCardNumber: "adyenjs_0_1_18$k7s65M5V0KdPxTErhBIPoMPI8HlC..", holderName: "S. Hopper", encryptedSecurityCode: "adyenjs_0_1_24$XUyMJyHebrra/TpSda9fha978+..", encryptedExpiryYear: "adyenjs_0_1_18$CkCOLYZsdqpxGjrALWHj3QoGHqe+..", encryptedExpiryMonth: "adyenjs_0_1_18$p2OZxW2XmwAA8C1Avxm3G9UB6e4..", type: Types.checkout.CardDetails.TypeEnum.Scheme }; const billingAddress: Types.checkout.BillingAddress = { country: "NL", city: "Amsterdam", street: "Infinite Loop", houseNumberOrName: "1", postalCode: "1011DJ" }; const browserInfo: Types.checkout.BrowserInfo = { acceptHeader: "text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,image/apng,*/*;q=0.8", screenWidth: 1536, javaEnabled: true, screenHeight: 723, timeZoneOffset: 0, userAgent: "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/70.0.3538.110 Safari/537.36", language: "nl-NL", colorDepth: 24 }; const paymentRequest: Types.checkout.PaymentRequest = { reference: "YOUR_ORDER_NUMBER", amount: amount, merchantAccount: "YOUR_MERCHANT_ACCOUNT", channel: Types.checkout.PaymentRequest.ChannelEnum.Web, paymentMethod: cardDetails, shopperEmail: "s.hopper@example.com", shopperIP: "192.0.2.1", billingAddress: billingAddress, returnUrl: "https://your-company.example.com/checkout?shopperOrder=12xy..", browserInfo: browserInfo, shopperReference: "YOUR_UNIQUE_SHOPPER_ID" }; // Send the request const checkoutAPI = new CheckoutAPI(client); const response = checkoutAPI.PaymentsApi.payments(paymentRequest, { idempotencyKey: "UUID" }); ``` 2. Check if the response contains an `action` object. Your next steps depend on whether the [/payments](https://docs.adyen.com/api-explorer/Checkout/latest/post/payments) response contains an `action` object: | | Description | Next steps | | ----------------------------------- | --------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------- | | No `action` object | The transaction was either exempted or out-of-scope for 3D Secure authentication. | Use the `resultCode` to [present the payment result to your shopper](#present-the-payment-result). | | `action` object `type`:**redirect** | The payment qualifies for 3D Secure. | [Handle the redirect](/online-payments/build-your-integration/advanced-flow/?platform=Web\&integration=API%20only#handle-the-redirect). | ### Tab: iOS To make a card payment with 3D Secure redirect authentication on iOS, proceed with the following steps: 1. From your server, make a [/payments](https://docs.adyen.com/api-explorer/Checkout/latest/post/payments) request, specifying: | Parameter name | Required | Description | | ---------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | | [paymentMethod](https://docs.adyen.com/api-explorer/Checkout/latest/post/payments#request-paymentMethod) | ![-white\_check\_mark-](/user/data/smileys/emoji/white_check_mark.png "-white_check_mark-") | If using the Card Component for [iOS](/payment-methods/cards/ios-component#make-a-payment), pass the parameters returned by the Component. If submitting raw card data, refer to [Raw card data](/payment-methods/cards/raw-card-data#make-a-payment) for the fields that you need to pass. | | [returnUrl](https://docs.adyen.com/api-explorer/Checkout/latest/post/payments#request-returnUrl) | ![-white\_check\_mark-](/user/data/smileys/emoji/white_check_mark.png "-white_check_mark-") | The URL where the shopper will be redirected back to after completing 3D Secure authentication. This URL can contain a maximum of **1024 characters** and must not include `//` (double slash) after the top-level domain. The `returnURL` that you provide also determines the HTTP method that you should use when redirecting the shopper. For iOS, you can use the custom URL for your app. For example, `my-app://`. For more information on setting custom URL schemes, refer to the [Apple Developer documentation](https://developer.apple.com/documentation/uikit/inter-process_communication/allowing_apps_and_websites_to_link_to_your_content/defining_a_custom_url_scheme_for_your_app). If you provide a custom URL, you receive a URL that requires a GET request. | | [browserInfo](https://docs.adyen.com/api-explorer/Checkout/latest/post/payments#request-browserInfo) | ![-white\_check\_mark-](/user/data/smileys/emoji/white_check_mark.png "-white_check_mark-") | The shopper's browser information, include the following fields:- [acceptHeader](https://docs.adyen.com/api-explorer/Checkout/latest/post/payments#request-browserInfo-acceptHeader): The accept header value of the shopper's browser. You can use a dummy value. - [userAgent](https://docs.adyen.com/api-explorer/Checkout/latest/post/payments#request-browserInfo-userAgent): Get it using [`BrowserInfo.initialize` ](https://adyen.github.io/adyen-ios/5.3.0/documentation/adyen/browserinfo). | | [billingAddress](https://docs.adyen.com/api-explorer/Checkout/latest/post/payments#request-billingAddress) | | The cardholder's billing address. | | [shopperEmail](https://docs.adyen.com/api-explorer/Checkout/latest/post/payments#request-shopperEmail) | | The cardholder's email address. | To increase the likelihood of achieving a [frictionless flow](/online-payments/3d-secure#frictionless-flow) and higher authorisation rates, we recommend that you send [additional parameters](/online-payments/3d-secure/api-reference#3d-secure-2-additional-data-objects). For `channel` **iOS**, we recommend including these additional parameters: `billingAddress` and `shopperEmail`. A sample [/payments](https://docs.adyen.com/api-explorer/Checkout/latest/post/payments) request for **iOS**: #### curl ```bash curl https://checkout-test.adyen.com/v68/payments \ -H 'x-api-key: ADYEN_API_KEY' \ -H 'content-type: application/json' \ -d '{ "amount":{ "currency":"EUR", "value":1000 }, "reference":"YOUR_ORDER_NUMBER", "shopperReference":"YOUR_UNIQUE_SHOPPER_ID", "paymentMethod":{ "type":"scheme", "encryptedCardNumber":"adyenjs_0_1_18$k7s65M5V0KdPxTErhBIPoMPI8HlC..", "encryptedExpiryMonth":"adyenjs_0_1_18$p2OZxW2XmwAA8C1Avxm3G9UB6e4..", "encryptedExpiryYear":"adyenjs_0_1_18$CkCOLYZsdqpxGjrALWHj3QoGHqe+..", "encryptedSecurityCode":"adyenjs_0_1_24$XUyMJyHebrra/TpSda9fha978+..", "holderName":"S. Hopper" }, "billingAddress": { "street": "Infinite Loop", "houseNumberOrName": "1", "postalCode": "1011DJ", "city": "Amsterdam", "country": "NL" }, "browserInfo: { "userAgent":"Mozilla/5.0 (iPhone; CPU iPhone OS 11_0 like Mac OS X) AppleWebKit/604.1.38 (KHTML, like Gecko) Version/11.0 Mobile/15A5370a Safari/604.1", "acceptHeader":"text\/html,application\/xhtml+xml,application\/xml;q=0.9,image\/webp,image\/apng,*\/*;q=0.8" }, "shopperEmail":"s.hopper@example.com", "channel":"iOS", "returnUrl":"", "merchantAccount":"YOUR_MERCHANT_ACCOUNT" }' ``` #### Java ```java Client client = new Client("ADYEN_API_KEY", Environment.TEST); Checkout checkout = new Checkout(client); PaymentsRequest paymentsRequest = new PaymentsRequest(); paymentsRequest.setMerchantAccount("YOUR_MERCHANT_ACCOUNT"); paymentsRequest.setReference("YOUR_ORDER_REFERENCE"); DefaultPaymentMethodDetails paymentMethodDetails = new DefaultPaymentMethodDetails(); paymentMethodDetails.setType("scheme"); paymentMethodDetails.setEncryptedCardNumber("adyenjs_0_1_18$k7s65M5V0KdPxTErhBIPoMPI8HlC.."); paymentMethodDetails.setEncryptedExpiryMonth("adyenjs_0_1_18$p2OZxW2XmwAA8C1Avxm3G9UB6e4.."); paymentMethodDetails.setEncryptedExpiryYear("adyenjs_0_1_18$CkCOLYZsdqpxGjrALWHj3QoGHqe+.."); paymentMethodDetails.setEncryptedSecurityCode("adyenjs_0_1_24$XUyMJyHebrra/TpSda9fha978+.."); paymentMethodDetails.setHolderName("S. Hopper"); paymentsRequest.setPaymentMethod(paymentMethodDetails); Amount amount = new Amount(); amount.setCurrency("EUR"); amount.setValue(1000L); paymentsRequest.setAmount(amount); Address billingAddress = new Address(); billingAddress.setCity("Amsterdam"); billingAddress.setCountry("NL"); billingAddress.setHouseNumberOrName("1"); billingAddress.setPostalCode("1011DJ"); billingAddress.setStreet("Infinite Loop"); paymentsRequest.setBillingAddress(billingAddress); BrowserInfo browserInfo = new BrowserInfo(); browserInfo.setUserAgent("Mozilla/5.0 (iPhone; CPU iPhone OS 11_0 like Mac OS X) AppleWebKit/604.1.38 (KHTML, like Gecko) Version/11.0 Mobile/15A5370a Safari/604.1"); browserInfo.setAcceptHeader("text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,image/apng,*/*;q=0.8"); paymentsRequest.setBrowserInfo(browserInfo); paymentsRequest.setShopperEmail("s.hopper@example.com"); paymentsRequest.setReturnUrl(""); PaymentsResponse paymentsResponse = checkout.payments(paymentsRequest); ``` #### PHP ```php // Set your X-API-KEY with the API key from the Customer Area. $client = new \Adyen\Client(); $client->setXApiKey("YOUR_X-API-KEY"); $service = new \Adyen\Service\Checkout($client); $params = [ "amount" => [ "currency" => "EUR", "value" => 1000 ], "reference" => "YOUR_ORDER_NUMBER", "paymentMethod" => [ "type" => "scheme", "encryptedCardNumber" => "adyenjs_0_1_18$k7s65M5V0KdPxTErhBIPoMPI8HlC..", "encryptedExpiryMonth" => "adyenjs_0_1_18$p2OZxW2XmwAA8C1Avxm3G9UB6e4..", "encryptedExpiryYear" => "adyenjs_0_1_18$CkCOLYZsdqpxGjrALWHj3QoGHqe+..", "encryptedSecurityCode" => "adyenjs_0_1_24$XUyMJyHebrra/TpSda9fha978+..", "holderName" => "S. Hopper" ], "billingAddress" => [ "city" => "Amsterdam", "country" => "NL", "houseNumberOrName" => "1", "postalCode" => "1011DJ", "street" => "Infinite Loop" ], "browserInfo" => [ "userAgent" => "Mozilla/5.0 (iPhone; CPU iPhone OS 11_0 like Mac OS X) AppleWebKit/604.1.38 (KHTML, like Gecko) Version/11.0 Mobile/15A5370a Safari/604.1", "acceptHeader" => "text\/html,application\/xhtml+xml,application\/xml;q=0.9,image\/webp,image\/apng,*\/*;q=0.8" ], "shopperEmail" => "s.hopper@example.com", "returnUrl" => "", "merchantAccount" => "YOUR_MERCHANT_ACCOUNT" ]; $result = $service->payments($params); // Check if further action is needed if (array_key_exists("action", $result)){ // Pass the action object to your front end. // $result["action"] } else { // No further action needed, pass the resultCode to your front end // $result['resultCode'] } ``` #### C\# ```cs // Set your X-API-KEY with the API key from the Customer Area. var client = new Client ("YOUR-X-API-KEY", Environment.Test); var checkout = new Checkout(client); var paymentsRequest = new Adyen.Model.Checkout.PaymentRequest { Amount = new Adyen.Model.Checkout.Amount(currency: "EUR", value: 1000), Reference = "YOUR_ORDER_REFERENCE", PaymentMethod = new DefaultPaymentMethodDetails { EncryptedCardNumber = "adyenjs_0_1_18$k7s65M5V0KdPxTErhBIPoMPI8HlC..", EncryptedExpiryMonth = "adyenjs_0_1_18$p2OZxW2XmwAA8C1Avxm3G9UB6e4..", EncryptedExpiryYear = "adyenjs_0_1_18$CkCOLYZsdqpxGjrALWHj3QoGHqe+..", EncryptedSecurityCode = "adyenjs_0_1_24$XUyMJyHebrra/TpSda9fha978+..", HolderName = "S. Hopper", Type = "scheme" }, BillingAddress = new Adyen.Model.Checkout.Address { City = "Amsterdam", Country = "NL", HouseNumberOrName = "1", PostalCode = "1011DJ", Street = "Infinite Loop" }, BrowserInfo = new Adyen.Model.Checkout.BrowserInfo { UserAgent = @"Mozilla/5.0 (iPhone; CPU iPhone OS 11_0 like Mac OS X) AppleWebKit/604.1.38 (KHTML, like Gecko) Version/11.0 Mobile/15A5370a Safari/604.1", AcceptHeader = @"text\/html,application\/xhtml+xml,application\/xml;q=0.9,image\/webp,image\/apng,*\/*;q=0.8" }, ShopperEmail = "s.hopper@example.com", ReturnUrl = "", MerchantAccount = "YOUR_MERCHANT_ACCOUNT" }; ``` #### NodeJS (JavaScript) ```js // Set your X-API-KEY with the API key from the Customer Area. const {Client, Config, CheckoutAPI} = require('@adyen/api-library'); const config = new Config(); // Set your X-API-KEY with the API key from the Customer Area. config.apiKey = '[API_KEY]'; config.merchantAccount = '[MERCHANT_ACCOUNT]'; const client = new Client({ config }); client.setEnvironment("TEST"); const checkout = new CheckoutAPI(client); checkout.payments({ amount:{ currency: "EUR", value: 1000 }, reference: "YOUR_ORDER_NUMBER", paymentMethod: { type: "scheme", encryptedCardNumber: "adyenjs_0_1_18$k7s65M5V0KdPxTErhBIPoMPI8HlC..", encryptedExpiryMonth: "adyenjs_0_1_18$p2OZxW2XmwAA8C1Avxm3G9UB6e4..", encryptedExpiryYear: "adyenjs_0_1_18$CkCOLYZsdqpxGjrALWHj3QoGHqe+..", encryptedSecurityCode: "adyenjs_0_1_24$XUyMJyHebrra/TpSda9fha978+..", holderName: "S. Hopper" }, billingAddress: { city: "Amsterdam", country: "NL", houseNumberOrName: "1", postalCode: "1011DJ", street: "Infinite Loop" }, browserInfo: { userAgent: "Mozilla/5.0 (iPhone; CPU iPhone OS 11_0 like Mac OS X) AppleWebKit/604.1.38 (KHTML, like Gecko) Version/11.0 Mobile/15A5370a Safari/604.1", acceptHeader: "text\/html,application\/xhtml+xml,application\/xml;q=0.9,image\/webp,image\/apng,*\/*;q=0.8" }, shopperEmail: "s.hopper@example.com", returnUrl: "", merchantAccount: "YOUR_MERCHANT_ACCOUNT" }).then(res => res); ``` #### Python ```py # Set your X-API-KEY with the API key from the Customer Area. adyen = Adyen.Adyen() adyen.client.xapikey = 'YOUR_X-API-KEY' result = adyen.checkout.payments({ "amount": { "currency": "EUR", "value": 1000 }, "reference":"YOUR_ORDER_NUMBER", "paymentMethod": { "type": "scheme", "encryptedCardNumber": "adyenjs_0_1_18$k7s65M5V0KdPxTErhBIPoMPI8HlC..", "encryptedExpiryMonth": "adyenjs_0_1_18$p2OZxW2XmwAA8C1Avxm3G9UB6e4..", "encryptedExpiryYear": "adyenjs_0_1_18$CkCOLYZsdqpxGjrALWHj3QoGHqe+..", "encryptedSecurityCode": "adyenjs_0_1_24$XUyMJyHebrra/TpSda9fha978+..", "holderName": "S. Hopper" }, "billingAddress": { "street": "Infinite Loop", "houseNumberOrName": "1", "postalCode": "1011DJ", "city": "Amsterdam", "country": "NL" }, "browserInfo": { "userAgent": "Mozilla/5.0 (iPhone; CPU iPhone OS 11_0 like Mac OS X) AppleWebKit/604.1.38 (KHTML, like Gecko) Version/11.0 Mobile/15A5370a Safari/604.1", "acceptHeader": "text\/html,application\/xhtml+xml,application\/xml;q=0.9,image\/webp,image\/apng,*\/*;q=0.8" }, "shopperEmail": "s.hopper@example.com", "returnUrl": "", "merchantAccount": "YOUR_MERCHANT_ACCOUNT" }) ``` #### Ruby ```ruby # Set your X-API-KEY with the API key from the Customer Area. adyen = Adyen::Client.new adyen.env = :test adyen.api_key = "YOUR_X-API-KEY" response = adyen.checkout.payments({ :amount => { :currency => "EUR", :value => 1000 }, :reference => "YOUR_ORDER_NUMBER", :shopperReference => "YOUR_UNIQUE_SHOPPER_ID", :paymentMethod => { # Data object passed from the didSubmit event, parsed from JSON to a Hash. :type => "scheme", :encryptedCardNumber => "adyenjs_0_1_18$k7s65M5V0KdPxTErhBIPoMPI8HlC..", :encryptedExpiryMonth => "adyenjs_0_1_18$p2OZxW2XmwAA8C1Avxm3G9UB6e4..", :encryptedExpiryYear => "adyenjs_0_1_18$CkCOLYZsdqpxGjrALWHj3QoGHqe+..", :encryptedSecurityCode => "adyenjs_0_1_24$XUyMJyHebrra/TpSda9fha978+..", :holderName => "S. Hopper" }, :billingAddress => { :city => "Amsterdam", :country => "NL", :houseNumberOrName => "1", :postalCode => "1011DJ", :street => "Infinite Loop" }, :browserInfo => { :userAgent => "Mozilla/5.0 (iPhone; CPU iPhone OS 11_0 like Mac OS X) AppleWebKit/604.1.38 (KHTML, like Gecko) Version/11.0 Mobile/15A5370a Safari/604.1", :acceptHeader => "text\/html,application\/xhtml+xml,application\/xml;q=0.9,image\/webp,image\/apng,*\/*;q=0.8" }, :shopperEmail => "s.hopper@example.com", :channel => "web", :returnUrl => "https://example.com/checkout?shopperOrder=12xy..", :merchantAccount => "YOUR_MERCHANT_ACCOUNT" }) # Check if further action is needed. if response.body.has_key(:action) # Pass the action object to your front end # response.body[:action] else # No further action needed, pass the resultCode object to your front end # response.body[:resultCode] end ``` 2. Check if the response contains an `action` object. Your next steps depend on whether the [/payments](https://docs.adyen.com/api-explorer/Checkout/latest/post/payments) response contains an `action` object: | | Description | Next steps | | ----------------------------------- | --------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------- | | No `action` object | The transaction was either exempted or out-of-scope for 3D Secure authentication. | Use the `resultCode` to [present the payment result to your shopper](#present-the-payment-result). | | `action` object `type`:**redirect** | The payment qualifies for 3D Secure. | [Handle the redirect](/online-payments/build-your-integration/advanced-flow/?platform=Web\&integration=API%20only#handle-the-redirect). | ### Tab: Android To make a card payment with 3D Secure redirect authentication on Android, you need to: 1. From your server, make a [/payments](https://docs.adyen.com/api-explorer/Checkout/latest/post/payments) request, specifying: | Parameter name | Required | Description | | ---------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | | [paymentMethod](https://docs.adyen.com/api-explorer/Checkout/latest/post/payments#request-paymentMethod) | ![-white\_check\_mark-](/user/data/smileys/emoji/white_check_mark.png "-white_check_mark-") | If using the Card Component for [Android](/payment-methods/cards/android-drop-in#make-a-payment), pass the parameters returned by the Component. If submitting raw card data, refer to [Raw card data](/payment-methods/cards/raw-card-data#make-a-payment) for the fields that you need to pass. | | [billingAddress](https://docs.adyen.com/api-explorer/Checkout/latest/post/payments#request-billingAddress) | | The cardholder's billing address. | | [shopperEmail](https://docs.adyen.com/api-explorer/Checkout/latest/post/payments#request-shopperEmail) | | The cardholder's email address. | | [browserInfo](https://docs.adyen.com/api-explorer/Checkout/latest/post/payments#request-browserInfo) | ![-white\_check\_mark-](/user/data/smileys/emoji/white_check_mark.png "-white_check_mark-") | The shopper's browser information, include the following fields:- [acceptHeader](https://docs.adyen.com/api-explorer/Checkout/latest/post/payments#request-browserInfo-acceptHeader): The accept header value of the shopper's browser. You can use a dummy value. - [userAgent](https://docs.adyen.com/api-explorer/Checkout/latest/post/payments#request-browserInfo-userAgent): Get it using [`WebSettings.getDefaultUserAgent(Context);` ](https://developer.android.com/reference/android/webkit/WebSettings#getDefaultUserAgent\(android.content.Context\)). | | [returnUrl](https://docs.adyen.com/api-explorer/Checkout/latest/post/payments#request-returnUrl) | ![-white\_check\_mark-](/user/data/smileys/emoji/white_check_mark.png "-white_check_mark-") | The URL where the shopper will be redirected back to after completing 3D Secure authentication. This URL can contain a maximum of **1024 characters** and must not include `//` (double slash) after the top-level domain. The `returnURL` that you provide also determines the HTTP method that you should use when redirecting the shopper. For Android, you can use a custom URL handled by an Activity on your app. You can configure it with an [intent filter](https://developer.android.com/guide/components/intents-filters). For example, configure `my-app://your.package.name`, and then add that to your `manifest.xml` file. If you provide a custom URL, you receive a URL that requires a GET request. See the example below. | ```xml ``` To increase the likelihood of achieving a [frictionless flow](/online-payments/3d-secure#frictionless-flow) and higher authorisation rates, we recommend that you send [additional parameters](/online-payments/3d-secure/api-reference#3d-secure-2-additional-data-objects). For `channel` **Android**, we recommend including these additional parameters: `billingAddress` and `shopperEmail`. A sample [/payments](https://docs.adyen.com/api-explorer/Checkout/latest/post/payments) request for **Android**: #### curl ```bash curl https://checkout-test.adyen.com/v68/payments \ -H 'x-api-key: ADYEN_API_KEY' \ -H 'content-type: application/json' \ -d '{ "amount":{ "currency":"EUR", "value":1000 }, "reference":"YOUR_ORDER_NUMBER", "shopperReference":"YOUR_UNIQUE_SHOPPER_ID", "paymentMethod":{ "type":"scheme", "encryptedCardNumber":"adyenjs_0_1_18$k7s65M5V0KdPxTErhBIPoMPI8HlC..", "encryptedExpiryMonth":"adyenjs_0_1_18$p2OZxW2XmwAA8C1Avxm3G9UB6e4..", "encryptedExpiryYear":"adyenjs_0_1_18$CkCOLYZsdqpxGjrALWHj3QoGHqe+..", "encryptedSecurityCode":"adyenjs_0_1_24$XUyMJyHebrra/TpSda9fha978+..", "holderName":"S. Hopper" }, "billingAddress": { "street": "Infinite Loop", "houseNumberOrName": "1", "postalCode": "1011DJ", "city": "Amsterdam", "country": "NL" }, "browserInfo: { "userAgent":"Mozilla/5.0 (Linux; Android 6.0.1; Nexus 6P Build/MMB29P) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/47.0.2526.83 Mobile Safari/537.36", "acceptHeader":"text\/html,application\/xhtml+xml,application\/xml;q=0.9,image\/webp,image\/apng,*\/*;q=0.8" }, "shopperEmail":"s.hopper@example.com", "channel":"Android", "returnUrl":"adyencheckout://your.package.name", "merchantAccount":"YOUR_MERCHANT_ACCOUNT" }' ``` #### Java ```java Client client = new Client("ADYEN_API_KEY", Environment.TEST); Checkout checkout = new Checkout(client); PaymentsRequest paymentsRequest = new PaymentsRequest(); paymentsRequest.setMerchantAccount("YOUR_MERCHANT_ACCOUNT"); paymentsRequest.setReference("YOUR_ORDER_REFERENCE"); DefaultPaymentMethodDetails paymentMethodDetails = new DefaultPaymentMethodDetails(); paymentMethodDetails.setType("scheme"); paymentMethodDetails.setEncryptedCardNumber("adyenjs_0_1_18$k7s65M5V0KdPxTErhBIPoMPI8HlC.."); paymentMethodDetails.setEncryptedExpiryMonth("adyenjs_0_1_18$p2OZxW2XmwAA8C1Avxm3G9UB6e4.."); paymentMethodDetails.setEncryptedExpiryYear("adyenjs_0_1_18$CkCOLYZsdqpxGjrALWHj3QoGHqe+.."); paymentMethodDetails.setEncryptedSecurityCode("adyenjs_0_1_24$XUyMJyHebrra/TpSda9fha978+.."); paymentMethodDetails.setHolderName("S. Hopper"); paymentsRequest.setPaymentMethod(paymentMethodDetails); Amount amount = new Amount(); amount.setCurrency("EUR"); amount.setValue(1000L); paymentsRequest.setAmount(amount); Address billingAddress = new Address(); billingAddress.setCity("Amsterdam"); billingAddress.setCountry("NL"); billingAddress.setHouseNumberOrName("1"); billingAddress.setPostalCode("1011DJ"); billingAddress.setStreet("Infinite Loop"); paymentsRequest.setBillingAddress(billingAddress); BrowserInfo browserInfo = new BrowserInfo(); browserInfo.setUserAgent("Mozilla/5.0 (Linux; Android 6.0.1; Nexus 6P Build/MMB29P) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/47.0.2526.83 Mobile Safari/537.36"); browserInfo.setAcceptHeader("text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,image/apng,*/*;q=0.8"); paymentsRequest.setBrowserInfo(browserInfo); paymentsRequest.setShopperEmail("s.hopper@example.com"); paymentsRequest.setChannel("Android"); paymentsRequest.setReturnUrl("adyencheckout://your.package.name"); PaymentsResponse paymentsResponse = checkout.payments(paymentsRequest); ``` #### PHP ```php // Set your X-API-KEY with the API key from the Customer Area. $client = new \Adyen\Client(); $client->setXApiKey("YOUR_X-API-KEY"); $service = new \Adyen\Service\Checkout($client); $params = [ "amount" => [ "currency" => "EUR", "value" => 1000 ], "reference" => "YOUR_ORDER_NUMBER", "paymentMethod" => [ "type" => "scheme", "encryptedCardNumber" => "adyenjs_0_1_18$k7s65M5V0KdPxTErhBIPoMPI8HlC..", "encryptedExpiryMonth" => "adyenjs_0_1_18$p2OZxW2XmwAA8C1Avxm3G9UB6e4..", "encryptedExpiryYear" => "adyenjs_0_1_18$CkCOLYZsdqpxGjrALWHj3QoGHqe+..", "encryptedSecurityCode" => "adyenjs_0_1_24$XUyMJyHebrra/TpSda9fha978+..", "holderName" => "S. Hopper" ], "billingAddress" => [ "city" => "Amsterdam", "country" => "NL", "houseNumberOrName" => "1", "postalCode" => "1011DJ", "street" => "Infinite Loop" ], "browserInfo" => [ "userAgent" => "Mozilla/5.0 (Linux; Android 6.0.1; Nexus 6P Build/MMB29P) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/47.0.2526.83 Mobile Safari/537.36", "acceptHeader" => "text\/html,application\/xhtml+xml,application\/xml;q=0.9,image\/webp,image\/apng,*\/*;q=0.8" ], "shopperEmail" => "s.hopper@example.com", "channel" => "Android", "returnUrl" => "adyencheckout://your.package.name", "merchantAccount" => "YOUR_MERCHANT_ACCOUNT" ]; $result = $service->payments($params); // Check if further action is needed if (array_key_exists("action", $result)){ // Pass the action object to your front end. // $result["action"] } else { // No further action needed, pass the resultCode to your front end // $result['resultCode'] } ``` #### C\# ```cs // Set your X-API-KEY with the API key from the Customer Area. var client = new Client ("YOUR-X-API-KEY", Environment.Test); var checkout = new Checkout(client); var paymentsRequest = new Adyen.Model.Checkout.PaymentRequest { Amount = new Adyen.Model.Checkout.Amount(currency: "EUR", value: 1000), Reference = "YOUR_ORDER_REFERENCE", PaymentMethod = new DefaultPaymentMethodDetails { EncryptedCardNumber = "adyenjs_0_1_18$k7s65M5V0KdPxTErhBIPoMPI8HlC..", EncryptedExpiryMonth = "adyenjs_0_1_18$p2OZxW2XmwAA8C1Avxm3G9UB6e4..", EncryptedExpiryYear = "adyenjs_0_1_18$CkCOLYZsdqpxGjrALWHj3QoGHqe+..", EncryptedSecurityCode = "adyenjs_0_1_24$XUyMJyHebrra/TpSda9fha978+..", HolderName = "S. Hopper", Type = "scheme" }, BillingAddress = new Adyen.Model.Checkout.Address { City = "Amsterdam", Country = "NL", HouseNumberOrName = "1", PostalCode = "1011DJ", Street = "Infinite Loop" }, BrowserInfo = new Adyen.Model.Checkout.BrowserInfo { UserAgent = @"Mozilla/5.0 (Linux; Android 6.0.1; Nexus 6P Build/MMB29P) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/47.0.2526.83 Mobile Safari/537.36", AcceptHeader = @"text\/html,application\/xhtml+xml,application\/xml;q=0.9,image\/webp,image\/apng,*\/*;q=0.8" }, ShopperEmail = "s.hopper@example.com", Channel = Adyen.Model.Checkout.PaymentRequest.ChannelEnum.Android, ReturnUrl = "adyencheckout://your.package.name", MerchantAccount = "YOUR_MERCHANT_ACCOUNT" }; ``` #### NodeJS (JavaScript) ```js // Set your X-API-KEY with the API key from the Customer Area. const {Client, Config, CheckoutAPI} = require('@adyen/api-library'); const config = new Config(); // Set your X-API-KEY with the API key from the Customer Area. config.apiKey = '[API_KEY]'; config.merchantAccount = '[MERCHANT_ACCOUNT]'; const client = new Client({ config }); client.setEnvironment("TEST"); const checkout = new CheckoutAPI(client); checkout.payments({ amount:{ currency: "EUR", value: 1000 }, reference: "YOUR_ORDER_NUMBER", paymentMethod: { type: "scheme", encryptedCardNumber: "adyenjs_0_1_18$k7s65M5V0KdPxTErhBIPoMPI8HlC..", encryptedExpiryMonth: "adyenjs_0_1_18$p2OZxW2XmwAA8C1Avxm3G9UB6e4..", encryptedExpiryYear: "adyenjs_0_1_18$CkCOLYZsdqpxGjrALWHj3QoGHqe+..", encryptedSecurityCode: "adyenjs_0_1_24$XUyMJyHebrra/TpSda9fha978+..", holderName: "S. Hopper" }, billingAddress: { city: "Amsterdam", country: "NL", houseNumberOrName: "1", postalCode: "1011DJ", street: "Infinite Loop" }, browserInfo: { userAgent: "Mozilla/5.0 (Linux; Android 6.0.1; Nexus 6P Build/MMB29P) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/47.0.2526.83 Mobile Safari/537.36", acceptHeader: "text\/html,application\/xhtml+xml,application\/xml;q=0.9,image\/webp,image\/apng,*\/*;q=0.8" }, shopperEmail: "s.hopper@example.com", channel: "Android", returnUrl: "adyencheckout://your.package.name", merchantAccount: "YOUR_MERCHANT_ACCOUNT" }).then(res => res); ``` #### Python ```py # Set your X-API-KEY with the API key from the Customer Area. adyen = Adyen.Adyen() adyen.client.xapikey = 'YOUR_X-API-KEY' result = adyen.checkout.payments({ "amount": { "currency": "EUR", "value": 1000 }, "reference":"YOUR_ORDER_NUMBER", "paymentMethod": { "type": "scheme", "encryptedCardNumber": "adyenjs_0_1_18$k7s65M5V0KdPxTErhBIPoMPI8HlC..", "encryptedExpiryMonth": "adyenjs_0_1_18$p2OZxW2XmwAA8C1Avxm3G9UB6e4..", "encryptedExpiryYear": "adyenjs_0_1_18$CkCOLYZsdqpxGjrALWHj3QoGHqe+..", "encryptedSecurityCode": "adyenjs_0_1_24$XUyMJyHebrra/TpSda9fha978+..", "holderName": "S. Hopper" }, "billingAddress": { "street": "Infinite Loop", "houseNumberOrName": "1", "postalCode": "1011DJ", "city": "Amsterdam", "country": "NL" }, "browserInfo": { "userAgent": "Mozilla/5.0 (Linux; Android 6.0.1; Nexus 6P Build/MMB29P) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/47.0.2526.83 Mobile Safari/537.36", "acceptHeader": "text\/html,application\/xhtml+xml,application\/xml;q=0.9,image\/webp,image\/apng,*\/*;q=0.8" }, "shopperEmail": "s.hopper@example.com", "channel": "Android", "returnUrl": "adyencheckout://your.package.name", "merchantAccount": "YOUR_MERCHANT_ACCOUNT" }) ``` #### Ruby ```ruby # Set your X-API-KEY with the API key from the Customer Area. adyen = Adyen::Client.new adyen.env = :test adyen.api_key = "YOUR_X-API-KEY" response = adyen.checkout.payments({ :amount => { :currency => "EUR", :value => 1000 }, :reference => "YOUR_ORDER_NUMBER", :shopperReference => "YOUR_UNIQUE_SHOPPER_ID", :paymentMethod => { # Data object passed from Component, parsed from JSON to a Hash. :type => "scheme", :encryptedCardNumber => "adyenjs_0_1_18$k7s65M5V0KdPxTErhBIPoMPI8HlC..", :encryptedExpiryMonth => "adyenjs_0_1_18$p2OZxW2XmwAA8C1Avxm3G9UB6e4..", :encryptedExpiryYear => "adyenjs_0_1_18$CkCOLYZsdqpxGjrALWHj3QoGHqe+..", :encryptedSecurityCode => "adyenjs_0_1_24$XUyMJyHebrra/TpSda9fha978+..", :holderName => "S. Hopper" }, :billingAddress => { :city => "Amsterdam", :country => "NL", :houseNumberOrName => "1", :postalCode => "1011DJ", :street => "Infinite Loop" }, :browserInfo => { :userAgent => "Mozilla/5.0 (Linux; Android 6.0.1; Nexus 6P Build/MMB29P) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/47.0.2526.83 Mobile Safari/537.36", :acceptHeader => "text\/html,application\/xhtml+xml,application\/xml;q=0.9,image\/webp,image\/apng,*\/*;q=0.8" }, :shopperEmail => "s.hopper@example.com", :channel => "Android", :returnUrl => "adyencheckout://your.package.name", :merchantAccount => "YOUR_MERCHANT_ACCOUNT" }) # Check if further action is needed. if response.body.has_key(:action) # Pass the action object to your front end # response.body[:action] else # No further action needed, pass the resultCode object to your front end # response.body[:resultCode] end ``` 2. Your next steps depend on whether the [/payments](https://docs.adyen.com/api-explorer/Checkout/latest/post/payments) response contains an `action` object: | | Description | Next steps | | ----------------------------------- | --------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------- | | No `action` object | The transaction was either exempted or out-of-scope for 3D Secure authentication. | Use the `resultCode` to [present the payment result to your shopper](#present-the-payment-result). | | `action` object `type`:**redirect** | The payment qualifies for 3D Secure. | Handle the redirect. | ### Tab: React Native To make a card payment with 3D Secure redirect authentication on React Native, proceed with the following steps: 1. From your server, make a [/payments](https://docs.adyen.com/api-explorer/Checkout/latest/post/payments) request, specifying: | Parameter name | Required | Description | | ---------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | | [paymentMethod](https://docs.adyen.com/api-explorer/Checkout/latest/post/payments#request-paymentMethod) | ![-white\_check\_mark-](/user/data/smileys/emoji/white_check_mark.png "-white_check_mark-") | If using the Card Component for [React Native](/payment-methods/cards/android-drop-in#make-a-payment), pass the parameters returned by the Component. If submitting raw card data, refer to [Raw card data](/payment-methods/cards/raw-card-data#make-a-payment) for the fields that you need to pass. | | [billingAddress](https://docs.adyen.com/api-explorer/Checkout/latest/post/payments#request-billingAddress) | | The cardholder's billing address. | | [shopperEmail](https://docs.adyen.com/api-explorer/Checkout/latest/post/payments#request-shopperEmail) | | The cardholder's email address. | | [browserInfo](https://docs.adyen.com/api-explorer/Checkout/latest/post/payments#request-browserInfo) | ![-white\_check\_mark-](/user/data/smileys/emoji/white_check_mark.png "-white_check_mark-") | Contains the `userAgent` and `acceptHeader` fields. | | [returnUrl](https://docs.adyen.com/api-explorer/Checkout/latest/post/payments#request-returnUrl) | ![-white\_check\_mark-](/user/data/smileys/emoji/white_check_mark.png "-white_check_mark-") | - For **iOS**, use the custom URL for your app. For example, `my-app://`. For more information on setting custom URL schemes, refer to the [Apple Developer documentation](https://developer.apple.com/documentation/xcode/defining-a-custom-url-scheme-for-your-app). - For **Android**, use a custom URL handled by an Activity on your app. You can configure it with an [intent filter](https://developer.android.com/guide/components/intents-filters). For example, configure `my-app://your.package.name`, and then add that to your `manifest.xml` file. | To increase the likelihood of achieving a [frictionless flow](/online-payments/3d-secure#frictionless-flow) and higher authorisation rates, we recommend that you send [additional parameters](/online-payments/3d-secure/api-reference#3d-secure-2-additional-data-objects). For `channel` **React Native**, we recommend including the additional parameters: `billingAddress` and `shopperEmail`. 2. Your next steps depend on whether the [/payments](https://docs.adyen.com/api-explorer/Checkout/latest/post/payments) response contains an `action` object: | | Description | Next steps | | ----------------------------------- | --------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------- | | No `action` object | The transaction was either exempted or out-of-scope for 3D Secure authentication. | Use the `resultCode` to [present the payment result to your shopper](#present-the-payment-result). | | `action` object `type`:**redirect** | The payment qualifies for 3D Secure. | Handle the redirect. | ## Present the payment result Use the  [resultCode](https://docs.adyen.com/api-explorer/Checkout/latest/post/payments#responses-200-resultCode) from the [/payments](https://docs.adyen.com/api-explorer/Checkout/latest/post/payments) or [/payments/details](https://docs.adyen.com/api-explorer/Checkout/latest/post/payments/details) response to present the payment result to your shopper. You will also receive the outcome of the payment asynchronously in a [webhook](/development-resources/webhooks). For card payments, you can receive the following `resultCode` values: | resultCode | Description | Action to take | | -------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | | **Authorised** | The payment was successful. | Inform the shopper that the payment has been successful. If you are using [manual capture](/online-payments/capture#manual-capture), you also need to [capture](/online-payments/capture) the payment. | | **Cancelled** | The shopper cancelled the payment. | Ask the shopper if they want to continue with the order, or ask them to select a different payment method. | | **Error** | There was an error when the payment was being processed. For more information, check the [`refusalReason` ](/development-resources/refusal-reasons)field. | Inform the shopper that there was an error processing their payment. | | **Refused** | The payment was refused. For more information, check the [`refusalReason` ](/development-resources/refusal-reasons)field. | Ask the shopper to try the payment again using a different payment method. | ## Test and go live Use our test card numbers to [test how your integration handles different 3D Secure authentication scenarios](/development-resources/testing/3d-secure-2-authentication). When you are ready to [go live](/get-started-with-adyen/#apply-for-your-live-account), follow our [go-live checklist](/online-payments/go-live-checklist/). When using our [live endpoints](/development-resources/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](https://docs.adyen.com/api-explorer/Checkout/latest/post/payments) and [/payments/details](https://docs.adyen.com/api-explorer/Checkout/latest/post/payments/details) requests may result in errors when authenticating with 3D Secure. ## See also * [Web Components integration guide](/online-payments/components-web) * [3D Secure authentication](/online-payments/3d-secure) * [Webhooks](/development-resources/webhooks)