Pesquisar

Are you looking for test card numbers?

Would you like to contact support?

Atenção, esta página não se encontra disponível em Português
Default icon

Redirect 3DS API-only integration

Support 3D Secure authentication through a redirect page.

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.
  2. Provide the required 3D Secure parameters when making a payment request.
  3. Handle the redirect.

Before you begin

Before starting your integration:

  1. If building a mobile integration, contact our Support Team to make sure that 3D Secure is triggered in your app.
  2. Make sure that you have integrated our Card Component for Web, iOS, or Android or built your own UI for collecting shopper's card details.
  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 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 as they are required by the card schemes.

Collect card holder name in your payment form

If you are using our client-side integrations, select the integration below:

If you are using our Card Component, include the following when creating an instance of the Card Component:

  • hasHolderNametrue. This shows the input field for the card holder name.
  • holderNameRequired: true. This makes the card holder name a required field.
     const card = checkout.create("card", {
         hasHolderName: true,
         holderNameRequired: true
     }).mount("#card-container");

To collect the card holder name using our Card Component, specify the following when adding the Card Component:

  • showsHolderNameField: true
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)

If you are using our Card Component, set holderNameRequired to true when creating a cardConfiguration object:

     val cardConfiguration = CardConfiguration.Builder(context, "YOUR_CLIENT_KEY")
          .setHolderNameRequired(true)
          // When you're ready to accept live payments, change the value to one of our live environments.
          .setEnvironment(Environment.TEST)
          .build()

Make a payment

Select the channel that you are using below:

To make a card payment with 3D Secure redirect authentication on Web, proceed with the following steps:

  1. From your server, make a /payments request, specifying:

    Parameter name Required Description
    paymentMethod -white_check_mark- If using the Card Component for Web, pass the parameters returned by the Component. If submitting raw card data, refer to Raw card data for the fields that you need to pass.
    browserInfo -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 -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 The cardholder's billing address.
    shopperEmail The cardholder's email address.
    shopperIP The shopper's IP address.

    To increase the likelihood of achieving a frictionless flow and higher authorisation rates, we recommend that you send additional parameters.

    For channel Web, we recommend including these additional parameters: billingAddress, shopperEmail, and shopperIP.

    A sample /payments request for Web:

    curl https://checkout-test.adyen.com/v67/payments \
    -H "X-API-key: [Your API Key here]" \
    -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://example.com/checkout?shopperOrder=12xy..",
       "merchantAccount":"YOUR_MERCHANT_ACCOUNT"
    }'
    # 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 => {
        :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 => {
        :city => "Amsterdam",
        :country => "NL",
        :houseNumberOrName => "1",
        :postalCode => "1011DJ",
        :street => "Infinite Loop"
      },
      :shopperEmail => "s.hopper@example.com",
      :shopperIP => "192.0.2.1",
      :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]
    Client client = new Client("YOUR_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);
    
      BrowserInfo browserInfo = new BrowserInfo();
      browserInfo.setUserAgent("Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/70.0.3538.110 Safari/537.36");
      browserInfo.setAcceptHeader("text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,image/apng,*/*;q=0.8");
      browserInfo.setLanguage("nl-NL");
      browserInfo.setColorDepth(24);
      browserInfo.setScreenHeight(723);
      browserInfo.setScreenWidth(1536);
      browserInfo.setTimeZoneOffset(0);
      browserInfo.setJavaEnabled(true);
    
      paymentsRequest.setBrowserInfo(browserInfo);
    
      Address billingAddress = new Address();
      billingAddress.setCity("Amsterdam");
      billingAddress.setCountry("NL");
      billingAddress.setHouseNumberOrName("1");
      billingAddress.setPostalCode("1011DJ");
      billingAddress.setStreet("Infinite Loop");
    
      paymentsRequest.setBillingAddress(billingAddress);
    
      paymentsRequest.setShopperEmail("s.hopper@example.com");
      paymentsRequest.setShopperIP("192.0.2.1");
      paymentsRequest.setChannel(PaymentsRequest.ChannelEnum.WEB);
      paymentsRequest.setReturnUrl("https://example.com/checkout?shopperOrder=12xy..");
    
      PaymentsResponse paymentsResponse = checkout.payments(paymentsRequest);
    // 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"
      ],
      "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" => [
        "city" => "Amsterdam",
        "country" => "NL",
        "houseNumberOrName" => "1",
        "postalCode" => "1011DJ",
        "street" => "Infinite Loop"
      ],
      "shopperEmail" = "s.hopper@example.com",
      "shopperIP" => "192.0.2.1",
      "channel" => "web",
      "returnUrl" => "https://example.com/checkout?shopperOrder=12xy..",
      "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']
    }
    # 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"
      },
      "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://example.com/checkout?shopperOrder=12xy..",
      "merchantAccount": "YOUR_MERCHANT_ACCOUNT"
    })
    // 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 paymentRequest = new Adyen.Model.Checkout.PaymentRequest
    {
        Amount = new 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"
        },
        BrowserInfo = new Model.Checkout.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 = new Model.Checkout.Address
        {
            City = "Amsterdam",
            Country = "NL",
            HouseNumberOrName = "1",
            PostalCode = "1011DJ",
            Street = "Infinite Loop"
        },
        ShopperEmail = "s.hopper@example.com",
        ShopperIP = "192.0.2.1",
        Channel = Model.Checkout.PaymentRequest.ChannelEnum.Web,
        ReturnUrl = "https://example.com/checkout?shopperOrder=12xy..",
        MerchantAccount = "YOUR_MERCHANT_ACCOUNT"
    };
    // 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"
      },
      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: {
        city: "Amsterdam",
        country: "NL",
        houseNumberOrName: "1",
        postalCode: "1011DJ",
        street: "Infinite Loop"
      },
      shopperEmail: "s.hopper@example.com",
      shopperIP: "192.0.2.1",
      channel: "web",
      returnUrl: "https://example.com/checkout?shopperOrder=12xy..",
      merchantAccount: "YOUR_MERCHANT_ACCOUNT"
    }).then(res => res);
  2. Check if the response contains an action object. Your next steps depend on whether the /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.
    action object
    type:redirect
    The payment qualifies for 3D Secure. Handle the redirect.

To make a card payment with 3D Secure redirect authentication on iOS, proceed with the following steps:

  1. From your server, make a /payments request, specifying:

    Parameter name Required Description
    paymentMethod -white_check_mark- If using the Card Component for iOS, pass the parameters returned by the Component. If submitting raw card data, refer to Raw card data for the fields that you need to pass.
    returnUrl -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. If you provide a custom URL, you receive a URL that requires a GET request.
    browserInfo -white_check_mark- Contains the userAgent and acceptHeader fields.
    billingAddress The cardholder's billing address.
    shopperEmail The cardholder's email address.

    To increase the likelihood of achieving a frictionless flow and higher authorisation rates, we recommend that you send additional parameters.

    For channel iOS, we recommend including these additional parameters: billingAddress and shopperEmail.

    A sample /payments request for iOS:

    curl https://checkout-test.adyen.com/v67/payments \
    -H "X-API-key: [Your API Key here]" \
    -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":"https://example.com/checkout?shopperOrder=12xy..",
       "merchantAccount":"YOUR_MERCHANT_ACCOUNT"
    }'
    # 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]
    Client client = new Client("YOUR_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("https://example.com/checkout?shopperOrder=12xy..");
    
      PaymentsResponse paymentsResponse = checkout.payments(paymentsRequest);
    // 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" => "https://example.com/checkout?shopperOrder=12xy..",
      "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']
    }
    # 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": "https://example.com/checkout?shopperOrder=12xy..",
      "merchantAccount": "YOUR_MERCHANT_ACCOUNT"
    })
    // 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 paymentRequest = new Adyen.Model.Checkout.PaymentRequest
    {
        Amount = new 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 Model.Checkout.Address
        {
            City = "Amsterdam",
            Country = "NL",
            HouseNumberOrName = "1",
            PostalCode = "1011DJ",
            Street = "Infinite Loop"
        },
        BrowserInfo = new 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 = "https://example.com/checkout?shopperOrder=12xy..",
        MerchantAccount = "YOUR_MERCHANT_ACCOUNT"
    };
    // 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: "https://example.com/checkout?shopperOrder=12xy..",
      merchantAccount: "YOUR_MERCHANT_ACCOUNT"
    }).then(res => res);
  2. Check if the response contains an action object. Your next steps depend on whether the /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.
action object
type:redirect
The payment qualifies for 3D Secure. Handle the redirect.

To make a card payment with 3D Secure redirect authentication on Android, you need to:

  1. From your server, make a /payments request, specifying:

    Parameter name Required Description
    paymentMethod -white_check_mark- If using the Card Component for Android, pass the parameters returned by the Component. If submitting raw card data, refer to Raw card data for the fields that you need to pass.
    billingAddress The cardholder's billing address.
    shopperEmail The cardholder's email address.
    browserInfo -white_check_mark- Contains the userAgent and acceptHeader fields.
    returnUrl -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. 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.
    <activity
     android:name=".YourActivity">
       <intent-filter>
         <action android:name="android.intent.action.VIEW"/>
    
         <category android:name="android.intent.category.DEFAULT"/>
         <category android:name="android.intent.category.BROWSABLE"/>
    
         <data
           android:host="${applicationId}"
           android:scheme="my-app"/>
      </intent-filter>
    </activity>

    To increase the likelihood of achieving a frictionless flow and higher authorisation rates, we recommend that you send additional parameters.

    For channel Android, we recommend including these additional parameters: billingAddress and shopperEmail.

    A sample /payments request for Android:

    curl https://checkout-test.adyen.com/v67/payments \
    -H "X-API-key: [Your API Key here]" \
    -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"
    }'
    # 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]
    Client client = new Client("YOUR_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);
    // 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']
    }
    # 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"
    })
    // 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 paymentRequest = new Adyen.Model.Checkout.PaymentRequest
    {
        Amount = new 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 Model.Checkout.Address
        {
            City = "Amsterdam",
            Country = "NL",
            HouseNumberOrName = "1",
            PostalCode = "1011DJ",
            Street = "Infinite Loop"
        },
        BrowserInfo = new 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 = "Android",
        ReturnUrl = "adyencheckout://your.package.name",
        MerchantAccount = "YOUR_MERCHANT_ACCOUNT"
    };
    // 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);
  2. Your next steps depend on whether the /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.
    action object
    type:redirect
    The payment qualifies for 3D Secure. Handle the redirect.

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 notification webhook.

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, you also need to capture the payment.
Cancelled The shopper cancelled the payment. Ask the shopper whether 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 field. Inform the shopper that there was an error processing their payment.
Refused The payment was refused. For more information, check the refusalReason 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.

See also