--- title: "Redirect 3D Secure Component integration" description: "Add 3D Secure authentication with a redirect to your integration." url: "https://docs.adyen.com/online-payments/3d-secure/redirect-3ds2/web-component" source_url: "https://docs.adyen.com/online-payments/3d-secure/redirect-3ds2/web-component.md" canonical: "https://docs.adyen.com/online-payments/3d-secure/redirect-3ds2/web-component" last_modified: "2023-01-18T13:33:00+01:00" language: "en" --- # Redirect 3D Secure Component integration Add 3D Secure authentication with a redirect to your integration. [View source](/online-payments/3d-secure/redirect-3ds2/web-component.md) ![](/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)       The [Card Component](/payment-methods/cards/web-component) handles [3D Secure redirect flow](/online-payments/3d-secure/redirect-3ds2) to complete the required 3D Secure authentication. Follow the instructions on this page if your integration uses 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) endpoint, and Checkout API 49 or later.\ \ If your integration uses only the [/sessions](https://docs.adyen.com/api-explorer/Checkout/latest/post/sessions) endpoint, you do not need additional configuration for 3D Secure. If you are using Checkout API 46 or earlier, follow instructions in the [3D Secure 2 integration guide for v46 or earlier](/online-payments/3d-secure/native-3ds2/api-integration). To handle card payments with redirect 3D Secure authentication: 1. [Get additional shopper details in your payment form](#get-additional-shopper-details). 2. [Make a payment request](#step-2-make-a-payment) with additional 3D Secure parameters. 3. [Handle the redirect](#handle-the-redirect). 4. [Show the payment result](#step-5-show-the-payment-result). ## Requirements This page assumes you have already built a [Card Component](/payment-methods/cards/web-component) integration. If you are using 3D Secure for PSD2 compliance, read our [comprehensive PSD2 SCA guide](/online-payments/psd2-sca-compliance-and-implementation-guide). ## Step 1: Get additional shopper details in your payment form For higher authentication rates, we strongly recommend that you collect the shopper's email address, cardholder name, billing address, and IP address for payments with 3D Secure authentication. Get the shopper's email outside of the Card Component because it doesn't have a configuration to include shopper email in the payment form. To get the cardholder name and billing address in your payment form, include the following when [creating an instance of the Card Component](/payment-methods/cards/web-component#step-2-create-an-instance-of-the-component): * `hasHolderName`: **true**. This shows the input field for the cardholder name. * `holderNameRequired`: **true**. This makes the cardholder name a required field. * `billingAddressRequired`: **true**. This shows the billing address input fields. ```js const card = checkout.create("card", { hasHolderName: true, holderNameRequired: true, billingAddressRequired: true }).mount("#card-container"); ``` ## Step 2: Make a payment 1. When you [make a payment request](/online-payments/build-your-integration/advanced-flow?platform=Web\&integration=Components\&version=latest#make-a-payment), include the following additional 3D Secure 2 parameters. See additional 3D Secure 2 parameters that we recommend to include in your request to increase authentication performance in our [API reference](/online-payments/3d-secure/api-reference). | Parameter name | Required | Description | | ------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | | [paymentMethod](https://docs.adyen.com/api-explorer/Checkout/latest/post/payments#request-paymentMethod) | ![Required](/user/pages/reuse/image-library/01.icons/required/required.svg?decoding=auto\&fetchpriority=auto) | The type and required details for a card payment method. This is the `state.data.paymentMethod` object from the `onSubmit` event. | | [paymentMethod.holderName](https://docs.adyen.com/api-explorer/Checkout/latest/post/payments#request-paymentMethod-CardDetails-holderName) | ![Conditionally required](/user/pages/reuse/image-library/01.icons/conditionally-required/conditionally-required.svg?decoding=auto\&fetchpriority=auto) | **Use case**: required for Visa and JCB transactions. The cardholder's name. | | [browserInfo](https://docs.adyen.com/api-explorer/Checkout/latest/post/payments#request-browserInfo) | ![Required](/user/pages/reuse/image-library/01.icons/required/required.svg?decoding=auto\&fetchpriority=auto) | The shopper's browser information. All sub-fields of this object are required for `channel`: **Web**. This is the `state.data.browserInfo` object from the `onSubmit` event. | | [channel](https://docs.adyen.com/api-explorer/Checkout/latest/post/payments#request-channel) | ![Required](/user/pages/reuse/image-library/01.icons/required/required.svg?decoding=auto\&fetchpriority=auto) | The platform where the transaction takes place. Set to **Web**. | | [origin](https://docs.adyen.com/api-explorer/Checkout/latest/post/payments#request-origin) | ![Required](/user/pages/reuse/image-library/01.icons/required/required.svg?decoding=auto\&fetchpriority=auto) | The origin URL of the page where you are rendering the Component. To get the origin, open the browser console and call `window.location.origin`. When this field is not set, or set incorrectly, the 3D Secure 2 action can not be handled correctly. **Format**:- Maximum characters: 80. - Do not include subdirectories and a trailing slash.**Example**: if you render the Component on `https://your-company.example.com/checkout/payment`, set to`https://your-company.example.com`. | | [returnUrl](https://docs.adyen.com/api-explorer/Checkout/latest/post/payments#request-returnUrl) | ![Required](/user/pages/reuse/image-library/01.icons/required/required.svg?decoding=auto\&fetchpriority=auto) | The URL where the shopper is redirected back to after completing authentication, including the protocol `http://` or `https://`. You can also include your own additional query parameters, for example, shopper ID or order reference number. **Format**:- The return URL must not include `//` (double slash) after the top-level domain. - Maximum characters: 1024. We recommend that you keep the number of characters as small as possible.**Example**: `https://your-company.example.com/checkout/`. | | [shopperEmail](https://docs.adyen.com/api-explorer/Checkout/latest/post/payments#request-shopperEmail) | ![Conditionally required](/user/pages/reuse/image-library/01.icons/conditionally-required/conditionally-required.svg?decoding=auto\&fetchpriority=auto) | **Use case**: required for Visa and JCB transactions. The cardholder's email address. If you do not include the shopper email, you must include the shopper's phone number in your request. | | [shopperIP](https://docs.adyen.com/api-explorer/Checkout/latest/post/payments#request-shopperIP) | ![Conditionally required](/user/pages/reuse/image-library/01.icons/conditionally-required/conditionally-required.svg?decoding=auto\&fetchpriority=auto) | **Use case**: required for Visa and JCB transactions on the web. The shopper's IP address. | | [telephoneNumber](https://docs.adyen.com/api-explorer/Checkout/latest/post/payments#request-telephoneNumber) | ![Conditionally required](/user/pages/reuse/image-library/01.icons/conditionally-required/conditionally-required.svg?decoding=auto\&fetchpriority=auto) | **Use case**: required for Visa and JCB transactions if you did not include the `shopperEmail` field. The shopper's phone number. To be more specific, you can use the `mobilePhone`, `homePhone`, and `workPhone` fields in the `threeDS2RequestData` object. **Format**: The phone number must include a plus sign (+) and a country code (1-3 digits), followed by the number (4-15 digits). **Example**: **+4912345678901**If the value you provide does not follow the guidelines, we drop the value and do not submit it for authentication. | ![This is the required icon.](/user/pages/reuse/image-library/01.icons/requirements-legend/required.svg?decoding=auto\&fetchpriority=auto) Required for all transactions.\ ![This is the conditionally required icon.](/user/pages/reuse/image-library/01.icons/requirements-legend/conditionally-required.svg?decoding=auto\&fetchpriority=auto) Required for particular setups, or issuers and card schemes.\ ![This is the recommended icon.](/user/pages/reuse/image-library/01.icons/requirements-legend/recommended.svg?decoding=auto\&fetchpriority=auto) Recommended for all transactions, but not required. #### curl ```bash curl https://checkout-test.adyen.com/v72/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", "{hint:state.data.paymentMethod from onSubmit}paymentMethod{/hint}":{ "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 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", "origin":"https://your-company.example.com", "returnUrl":"https://your-company.example.com/checkout?shopperOrder=12xy..", "merchantAccount":"YOUR_MERCHANT_ACCOUNT" }' ``` #### Java ```java // Adyen Java API Library v27.0.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") .origin("https://your-company.example.com") .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 v19.0.0 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") ->setOrigin("https://your-company.example.com") ->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", Origin = "https://your-company.example.com", 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 v18.0.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", origin: "https://your-company.example.com", 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", Origin: common.PtrString("https://your-company.example.com"), 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", "origin": "https://your-company.example.com", "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', :origin => 'https://your-company.example.com', :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 v18.0.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", origin: "https://your-company.example.com", 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. In the response, check if there is an `action` object. ### Tab: Checkout API v67 and later Your next steps depend on whether the response contains an `action` object, and on the `action.type`. | | Description | Next steps | | ----------------------------------- | --------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | | No `action` object | The transaction was either exempted or out-of-scope for 3D Secure authentication. | Use the `resultCode` to [show the payment result to your shopper](#step-5-show-the-payment-result). | | `action` object `type`:**redirect** | The payment qualifies for 3D Secure. | 1. Call `handleAction`, passing the `action` object from the [/payments](https://docs.adyen.com/api-explorer/Checkout/latest/post/payments) response. 2. [Handle the redirect](#handle-the-redirect). | A sample [/payments](https://docs.adyen.com/api-explorer/Checkout/latest/post/payments) response with `action.type`: **redirect**: **/payments response** ```json { "resultCode": "RedirectShopper", "action": { "paymentMethodType": "scheme", "url": "https://checkoutshopper-test.adyen.com/checkoutshopper/threeDS/checkoutRedirect/...", "data": { "MD": "OEVudmZVMUlkWjd0MDNwUWs2bmhSdz09...", "PaReq": "eNpVUttygjAQ/RXbDyAXBYRZ00HpTH3wUosPfe..." }, "method": "POST", "type": "redirect" } } ``` ### Tab: Checkout API v66 and earlier Your next steps depend on whether the response contains an `action` object, and on the `action.type`. | | Description | Next steps | | ----------------------------------- | --------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | | No `action` object | The transaction was either exempted or out-of-scope for 3D Secure authentication. | Use the `resultCode` to [show the payment result to your shopper](#show-the-payment-result). | | `action` object `type`:**redirect** | The payment qualifies for 3D Secure. | 1. Store `action.paymentData` on your server. 2. Call `handleAction`, passing the `action` object from the [/payments](https://docs.adyen.com/api-explorer/Checkout/latest/post/payments) response. 3. [Handle the redirect](#handle-the-redirect). | A sample [/payments](https://docs.adyen.com/api-explorer/Checkout/66/post/payments) response with `action.type`: **redirect**: **/payments response** ```json { "resultCode":"RedirectShopper", "action":{ "data":{ "MD":"OEVudmZVMUlkWjd0MDNwUWs2bmhSdz09...", "PaReq":"eNpVUttygjAQ/RXbDyAXBYRZ00HpTH3wUosPfe...", "TermUrl":"" }, "method":"POST", "{hint: Store this on your server.}paymentData{/hint}":"Ab02b4c0!BQABAgCJN1wRZuGJmq8dMncmypvknj9s7l5Tj...", "paymentMethodType":"scheme", "type":"redirect", "url":"https://test.adyen.com/hpp/3d/validate.shtml" }, "details":[ { "key":"MD", "type":"text" }, { "key":"PaRes", "type":"text" } ], ... } ``` ## Step 3: Handle the redirect The Component uses `handleAction(action)` to redirect the shopper to the issuer page (the `action.url` from the [/payments](https://docs.adyen.com/api-explorer/Checkout/latest/post/payments) response) to perform 3D Secure authentication. When the shopper completes authentication, they are redirected back to the `returnUrl` from your [/payments](https://docs.adyen.com/api-explorer/Checkout/latest/post/payments) request. In our test environment, you can perform the authentication with test credentials. The `action.url` for testing is `https://checkoutshopper-test.adyen.com/checkoutshopper/threeDS/checkoutRedirect/...`.\ Perform the authentication using the 3D Secure test credentials: * **Username**: user * **Password**: password ### Tab: Checkout API v67 and later ### Verify the payment result When the shopper successfully authenticates on the page where they are redirected to complete the authentication, the payment is authorized. The shopper is redirected back to the `returnUrl` from your [/payments](https://docs.adyen.com/api-explorer/Checkout/latest/post/payments) request. The redirect is via an HTTP GET and is appended with the URL-encoded `redirectResult`. If a shopper completed the payment but failed to return to your website, wait for the [AUTHORISATION webhook](/development-resources/webhooks/webhook-types#webhook-structure) to know the payment result. ```raw GET /?shopperOrder=12xy...&&redirectResult=X6XtfGC3%21Y.... HTTP/1.1 Host: www.your-company.example.com/checkout ``` To verify the payment result, make another API request with the `redirectResult` parameter: 1. URL-decode the `redirectResult`, and pass it to your server. 2. From your server, make a [/payments/details](https://docs.adyen.com/api-explorer/Checkout/latest/post/payments/details) request specifying: * `details`: Object that contains the decoded `redirectResult`. **/payments/details request** #### curl ```bash curl https://checkout-test.adyen.com/v72/payments/details \ -H 'x-api-key: ADYEN_API_KEY' \ -H 'content-type: application/json' \ -d '{ "details": { "redirectResult": "eyJ0cmFuc1N0YXR1cyI6IlkifQ==" } }' ``` #### Java ```java // Adyen Java API Library v32.0.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, also include your liveEndpointUrlPrefix. Client client = new Client("ADYEN_API_KEY", Environment.TEST); // Create the request object(s) // Send the request PaymentsApi service = new PaymentsApi(client); PaymentDetailsResponse response = service.paymentsDetails(paymentDetailsRequest, new RequestOptions().idempotencyKey("UUID")); ``` #### PHP ```php setXApiKey("ADYEN_API_KEY"); // For the LIVE environment, also include your liveEndpointUrlPrefix. $client->setEnvironment(Environment::TEST); // Create the request object(s) $requestOptions['idempotencyKey'] = 'UUID'; // Send the request $service = new PaymentsApi($client); $response = $service->paymentsDetails($paymentDetailsRequest, $requestOptions); ``` #### C\# ```cs // Adyen .net API Library v26.0.0 using Adyen; using Environment = Adyen.Model.Environment; using Adyen.Model; using Adyen.Model.Checkout; using Adyen.Service.Checkout; // For the LIVE environment, also include your liveEndpointUrlPrefix. var config = new Config() { XApiKey = "ADYEN_API_KEY", Environment = Environment.Test }; var client = new Client(config); // Create the request object(s) // Send the request var service = new PaymentsService(client); var response = service.PaymentsDetails(paymentDetailsRequest, requestOptions: new RequestOptions { IdempotencyKey = "UUID"}); ``` #### NodeJS (JavaScript) ```js // Adyen Node API Library v22.1.0 // Require the parts of the module you want to use const { Client, CheckoutAPI } = require('@adyen/api-library'); // For the LIVE environment, also include your liveEndpointUrlPrefix. const client = new Client({ apiKey: "ADYEN_API_KEY", environment: "TEST" }); // Create the request object(s) const paymentDetailsRequest = { details: { redirectResult: "eyJ0cmFuc1N0YXR1cyI6IlkifQ==" } } // Send the request const checkoutAPI = new CheckoutAPI(client); const response = checkoutAPI.PaymentsApi.paymentsDetails(paymentDetailsRequest, { idempotencyKey: "UUID" }); ``` #### Go ```go // Adyen Go API Library v16.1.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, also include your liveEndpointUrlPrefix. client := adyen.NewClient(&common.Config{ ApiKey: "ADYEN_API_KEY", Environment: common.TestEnv, }) // Create the request object(s) // Send the request service := client.Checkout() req := service.PaymentsApi.PaymentsDetailsInput().IdempotencyKey("UUID").PaymentDetailsRequest(paymentDetailsRequest) res, httpRes, err := service.PaymentsApi.PaymentsDetails(context.Background(), req) ``` #### Python ```py # Adyen Python API Library v13.2.0 import Adyen adyen = Adyen.Adyen() adyen.client.xapikey = "ADYEN_API_KEY" # For the LIVE environment, also include your liveEndpointUrlPrefix. adyen.client.platform = "test" # The environment to use library in. # Create the request object(s) json_request = { "details": { "redirectResult": "eyJ0cmFuc1N0YXR1cyI6IlkifQ==" } } # Send the request result = adyen.checkout.payments_api.payments_details(request=json_request, idempotency_key="UUID") ``` #### Ruby ```rb # Adyen Ruby API Library v10.1.0 require "adyen-ruby-api-library" adyen = Adyen::Client.new adyen.api_key = 'ADYEN_API_KEY' # For the LIVE environment, also include your liveEndpointUrlPrefix. adyen.env = :test # Set to "live" for live environment # Create the request object(s) request_body = { :details => { :redirectResult => 'eyJ0cmFuc1N0YXR1cyI6IlkifQ==' } } # Send the request result = adyen.checkout.payments_api.payments_details(request_body, headers: { 'Idempotency-Key' => 'UUID' }) ``` #### NodeJS (TypeScript) ```ts // Adyen Node API Library v22.1.0 // Require the parts of the module you want to use import { Client, CheckoutAPI, Types } from "@adyen/api-library"; // For the LIVE environment, also include your liveEndpointUrlPrefix. const client = new Client({ apiKey: "ADYEN_API_KEY", environment: "TEST" }); // Create the request object(s) // Send the request const checkoutAPI = new CheckoutAPI(client); const response = checkoutAPI.PaymentsApi.paymentsDetails(paymentDetailsRequest, { idempotencyKey: "UUID" }); ``` The [/payments/details](https://docs.adyen.com/api-explorer/Checkout/latest/post/payments/details) response contains: * `resultCode`: Use this to [present the result to your shopper](#present-the-payment-result). * `pspReference`: Our unique identifier for the transaction. **/payments/details response** ```json { "resultCode": "Authorised", "pspReference": "V4HZ4RBFJGXXGN82" } ``` ### Tab: Checkout API v66 and earlier ### Complete the payment When the shopper has completed the authentication, the issuer (or our back end, if you are using the test environment) redirects them back to the `returnUrl` from your [/payments](https://docs.adyen.com/api-explorer/Checkout/66/post/payments) request. The redirect uses HTTP POST, and is appended with the `MD` and `PaRes` variables: If, due to technical limitations, you must use the GET method instead of HTTP POST, use the [redirectFromIssuerMethod](https://docs.adyen.com/api-explorer/#/CheckoutService/v66/post/payments__reqParam_redirectFromIssuerMethod) parameter. ```raw POST / HTTP/1.1 Host: www.your-company.example.com/checkout?shopperOrder=12xy.. Content-Type: application/x-www-form-urlencoded MD=Ab02b4c0%21BQABAgCW5sxB4e%2F%3D%3D..&PaRes=eNrNV0mTo7gS.. ``` To authorize the payment, you need to make another API request with the `MD` and `PaRes` parameters: 1. URL-decode the `MD` and `PaRes` from the form data, and pass the parameters to your server. 2. From your server, make a [/payments/details](https://docs.adyen.com/api-explorer/Checkout/66/post/payments/details) request specifying: * `paymentData`: Value you received in the [/payments](https://docs.adyen.com/api-explorer/Checkout/66/post/payments) response. * `details`: Object that contains the URL-decoded `MD` and `PaRes` parameters. #### curl ```bash curl https://checkout-test.adyen.com/v66/payments/details \ -H 'x-api-key: ADYEN_API_KEY' \ -H 'content-type: application/json' \ -d '{ "paymentData":"Ab02b4c0!BQABAgCJN1wRZuGJmq8dMncmypvknj9s7l5Tj...", "details":{ "MD":"Ab02b4c0!BQABAgCW5sxB4e/==..", "PaRes":"eNrNV0mTo7gS.." } }' ``` #### Java ```java // Adyen Java API Library v27.0.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) PaymentCompletionDetails paymentCompletionDetails = new PaymentCompletionDetails() .MD("Ab02b4c0!BQABAgCW5sxB4e/==..") .PaRes("eNrNV0mTo7gS.."); PaymentDetailsRequest paymentDetailsRequest = new PaymentDetailsRequest() .paymentData("Ab02b4c0!BQABAgCJN1wRZuGJmq8dMncmypvknj9s7l5Tj...") .details(paymentCompletionDetails); // Send the request PaymentsApi service = new PaymentsApi(client); PaymentDetailsResponse response = service.paymentsDetails(paymentDetailsRequest, new RequestOptions().idempotencyKey("UUID")); ``` #### PHP ```php // Adyen PHP API Library v19.0.0 use Adyen\Client; use Adyen\Environment; use Adyen\Model\Checkout\PaymentCompletionDetails; use Adyen\Model\Checkout\PaymentDetailsRequest; 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) $paymentCompletionDetails = new PaymentCompletionDetails(); $paymentCompletionDetails ->setMD("Ab02b4c0!BQABAgCW5sxB4e/==..") ->setPaRes("eNrNV0mTo7gS.."); $paymentDetailsRequest = new PaymentDetailsRequest(); $paymentDetailsRequest ->setPaymentData("Ab02b4c0!BQABAgCJN1wRZuGJmq8dMncmypvknj9s7l5Tj...") ->setDetails($paymentCompletionDetails); $requestOptions['idempotencyKey'] = 'UUID'; // Send the request $service = new PaymentsApi($client); $response = $service->paymentsDetails($paymentDetailsRequest, $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) PaymentCompletionDetails paymentCompletionDetails = new PaymentCompletionDetails { MD = "Ab02b4c0!BQABAgCW5sxB4e/==..", PaRes = "eNrNV0mTo7gS.." }; PaymentDetailsRequest paymentDetailsRequest = new PaymentDetailsRequest { PaymentData = "Ab02b4c0!BQABAgCJN1wRZuGJmq8dMncmypvknj9s7l5Tj...", Details = paymentCompletionDetails }; // Send the request var service = new PaymentsService(client); var response = service.PaymentsDetails(paymentDetailsRequest, requestOptions: new RequestOptions { IdempotencyKey = "UUID"}); ``` #### NodeJS (JavaScript) ```js // Adyen Node API Library v18.0.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 paymentDetailsRequest = { paymentData: "Ab02b4c0!BQABAgCJN1wRZuGJmq8dMncmypvknj9s7l5Tj...", details: { MD: "Ab02b4c0!BQABAgCW5sxB4e/==..", PaRes: "eNrNV0mTo7gS.." } } // Send the request const checkoutAPI = new CheckoutAPI(client); const response = checkoutAPI.PaymentsApi.paymentsDetails(paymentDetailsRequest, { 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) paymentCompletionDetails := checkout.PaymentCompletionDetails{ MD: common.PtrString("Ab02b4c0!BQABAgCW5sxB4e/==.."), PaRes: common.PtrString("eNrNV0mTo7gS.."), } paymentDetailsRequest := checkout.PaymentDetailsRequest{ PaymentData: common.PtrString("Ab02b4c0!BQABAgCJN1wRZuGJmq8dMncmypvknj9s7l5Tj..."), Details: paymentCompletionDetails, } // Send the request service := client.Checkout() req := service.PaymentsApi.PaymentsDetailsInput().IdempotencyKey("UUID").PaymentDetailsRequest(paymentDetailsRequest) res, httpRes, err := service.PaymentsApi.PaymentsDetails(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 = { "paymentData": "Ab02b4c0!BQABAgCJN1wRZuGJmq8dMncmypvknj9s7l5Tj...", "details": { "MD": "Ab02b4c0!BQABAgCW5sxB4e/==..", "PaRes": "eNrNV0mTo7gS.." } } # Send the request result = adyen.checkout.payments_api.payments_details(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 = { :paymentData => 'Ab02b4c0!BQABAgCJN1wRZuGJmq8dMncmypvknj9s7l5Tj...', :details => { :MD => 'Ab02b4c0!BQABAgCW5sxB4e/==..', :PaRes => 'eNrNV0mTo7gS..' } } # Send the request result = adyen.checkout.payments_api.payments_details(request_body, headers: { 'Idempotency-Key' => 'UUID' }) ``` #### NodeJS (TypeScript) ```ts // Adyen Node API Library v18.0.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 paymentCompletionDetails: Types.checkout.PaymentCompletionDetails = { MD: "Ab02b4c0!BQABAgCW5sxB4e/==..", PaRes: "eNrNV0mTo7gS.." }; const paymentDetailsRequest: Types.checkout.PaymentDetailsRequest = { paymentData: "Ab02b4c0!BQABAgCJN1wRZuGJmq8dMncmypvknj9s7l5Tj...", details: paymentCompletionDetails }; // Send the request const checkoutAPI = new CheckoutAPI(client); const response = checkoutAPI.PaymentsApi.paymentsDetails(paymentDetailsRequest, { idempotencyKey: "UUID" }); ``` The [/payments/details](https://docs.adyen.com/api-explorer/Checkout/66/post/payments/details) response contains: * `resultCode`: Use this to [present the result to your shopper](#step-6-show-the-payment-result). * `pspReference`: Our unique identifier for the transaction. **/payments/details response** ```json { "resultCode": "Authorised", "pspReference": "V4HZ4RBFJGXXGN82" } ``` ## Step 4: Show 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 2 API Reference](/online-payments/3d-secure/api-reference) * [3D Secure authentication](/online-payments/3d-secure) * [Webhooks](/development-resources/webhooks)