--- title: "Card Drop-in integration" description: "Add cards to an existing Drop-in integration." url: "https://docs.adyen.com/payment-methods/cards/react-native-drop-in" source_url: "https://docs.adyen.com/payment-methods/cards/react-native-drop-in.md" canonical: "https://docs.adyen.com/payment-methods/cards/react-native-drop-in" last_modified: "2026-05-24T12:54:31+02:00" language: "en" --- # Card Drop-in integration Add cards to an existing Drop-in integration. [View source](/payment-methods/cards/react-native-drop-in.md) This page explains how to add cards to your existing React Native Drop-in integration. ## Requirements | Requirement | Description | | -------------------- | --------------------------------------------------------------------------------------------------------------- | | **Integration type** | Make sure that you have built your [React Native Drop-in integration](/online-payments/build-your-integration). | | **Setup steps** | Before you begin, [add cards in your test Customer Area](/payment-methods/add-payment-methods). | ## API reference You do not need to send additional fields for cards. See the [/payments](https://docs.adyen.com/api-explorer/Checkout/latest/post/payments) endpoint API reference for the optional fields you can send. You can send additional fields for specific use cases. For example [showing debit and credit cards separately](#showing-debit-and-credit-cards-separately). ## Drop-in configuration There is no required cards specific integration for Drop-in. ### Optional configuration You can optionally include the following properties when you [configure `AdyenCheckout`](/online-payments//build-your-integration/advanced-flow?platform=React%20Native\&integration=Drop-in\&version=latest#configure): | Parameter name | Description | Default | | ------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------- | | `holderNameRequired` | Set to **true** to show the field for the cardholder name. | **false** | | `hideCvc` | Set to **true** to hide the security code (CVV/CVC) field. | **false** | | `showStorePaymentField` | Set to **false** to hide the option to [store card details](#recurring-payments). | **true** | | `hideCvcStoredCard` | Set to **true** to hide the security code (CVV/CVC) code field for stored cards. | **false** | | `addressVisibility` | Sets which billing address fields to show in the payment form. Possible values: - **none**: do not show billing address fields. - **postal**: show only the postal code field. - **full**: show all address fields. - **lookup**: suggest addresses to the shopper when they enter data into address input. If using **lookup**, you must also implement the `onUpdateAddress` and `onConfirmAddress` callbacks. | **none** | | `supported` | List of [supported card types](/payment-methods/cards/custom-card-integration#supported-card-types) that you recognize. | The list of card `brands` from the [/paymentMethods](https://docs.adyen.com/api-explorer/Checkout/latest/post/paymentMethods) response. | | `allowedAddressCountryCodes` | Specify the [ISO 3166 country codes](https://www.iso.org/iso-3166-country-codes.html) if you only support payments from cards issued in specific countries. | | | `kcpVisibility` | For Korean cards, sets if security fields show in the payment form. Possible values: - **show**: show the fields. - **hide**: do not show the fields. | **hide** | | `socialSecurity` | For Brazilian cards, sets if the [CPF](https://en.wikipedia.org/wiki/CPF_number)/[CNPJ](https://en.wikipedia.org/wiki/CNPJ) social security number field shows in the payment form. Possible values: - **show**: show the field. - **hide**: do not show the field. | **hide** | | `onUpdateAddress: (prompt, lookup) => {}` | If `addressVisibility` is set to **lookup**, the callback that provides `lookup` results for the shopper's `prompt`. | | | `onConfirmAddress: (address, lookup) => {}` | If `addressVisibility` is set to **lookup**, the callback to confirm the `address` selected by the shopper to `lookup`. | | | `onBinLookup` | Called when the shopper enters the card number. Requires a minimum of 11 digits of the card number to be entered. Returns the following- `brand`: The brands on the card. | | | `onBinValue` | Called when the shopper enters the card number. Returns the following- `binValue`: The first 6 digits of the card number.Requires the [client key](/development-resources/client-side-authentication/migrate-from-origin-key-to-client-key) for client-side authentication. | | ## Showing debit and credit cards separately Supported from Checkout API v53 or later. When you make a [/paymentMethods](https://docs.adyen.com/api-explorer/Checkout/latest/post/paymentMethods) request from your server, include: * [splitCardFundingSources](https://docs.adyen.com/api-explorer/Checkout/latest/post/sessions#responses-201-splitCardFundingSources): Set to **true**. The following example shows how to do this for a shopper in the **Netherlands**, making a **EUR 47.00** payment. **/paymentMethods request** ```bash curl https://checkout-test.adyen.com/v72/paymentMethods \ -H 'x-api-key: ADYEN_API_KEY' \ -H 'content-type: application/json' \ -d '{ "merchantAccount": "YOUR_MERCHANT_ACCOUNT", "countryCode": "NL", "amount": { "currency": "EUR", "value": 4700 }, "splitCardFundingSources": true }' ``` The response includes the list of available payment methods, with debit and credit cards split into separate objects. **Response** ```json { ... "paymentMethods": [ { "brands": [ "mc", "visa", "amex" ], ... "fundingSource": "credit", "name": "Credit Card", "type": "scheme" }, { "brands": [ "mc", "visa", "amex" ], "fundingSource": "debit", "name": "Debit Card", "type": "scheme" } ] } ``` ### Combo cards For debit transactions, we highly recommend using [3D Secure](/online-payments/3d-secure) and [automatic capture](/online-payments/capture) due to some issuers' restrictions. ### Sweden To comply with [local legislation](https://www.regeringen.se/rattsliga-dokument/lagradsremiss/2019/12/presentation-av-betalningssatt-vid-marknadsforing-av-betaltjanster-online), set `countryCode` to **SE** in your request. Drop-in shows the payment form for **Debit Card** before the one for **Credit Card**. ## Card brand recognition When the shopper is entering their card details, Drop-in tries to recognize the card brand. When successful, Drop-in renders the brand icon and the corresponding input field for the card security code (CVC, CVV, or CID). ### Co-badged cards Co-badged cards are rendered by Drop-in according to the [co-badged card regulations for the applicable regions](/online-payments/co-badged-cards-compliance/). This means that Drop-in renders all supported brands, and allows the cardholder to choose their preferred brand. ## Recurring payments Cards support [tokenization](/online-payments/tokenization) for [one-click](/get-started-with-adyen/adyen-glossary/#one-click-payments), [subscription](/get-started-with-adyen/adyen-glossary/#subscriptions), and [unscheduled card-on-file](/get-started-with-adyen/adyen-glossary#unscheduled-card-on-file-ucof) payments. Refer to [Create tokens](/online-payments/tokenization/create-tokens/) to integrate with our tokenization feature. We strongly recommend that you ask explicit permission from the shopper if you intend to make future recurring payments. Being transparent about the payment schedule and the charged amount reduces the risk of chargebacks. ### Store card details When creating a token for cards: * [In your `AdyenCheckout` configuration](#configuration), make sure that `showStorePaymentField` is set to **true**. This shows a switch for your shopper to choose to store their card details. ```js // Configuration object. const configuration = { // Other required and optional configuration properties. showStorePaymentField: false }; // Configuring Adyen Checkout. // Your checkout view that uses AdyenCheckout as the context. ``` * Make an API request to [create a token](/online-payments/tokenization/create-tokens) using standard tokenization parameters. You do not need to include any additional parameters for cards. **Create a token for one-click payments** #### curl ```bash curl https://checkout-test.adyen.com/v72/payments \ -H 'x-api-key: ADYEN_API_KEY' \ -H 'content-type: application/json' \ -d '{ "amount":{ "value":0, "currency":"USD" }, "paymentMethod":{ "type":"scheme", "encryptedCardNumber": "test_4111111111111111", "encryptedExpiryMonth": "test_03", "encryptedExpiryYear": "test_2030", "encryptedSecurityCode": "test_737", "holderName":"John Smith" }, "reference":"YOUR_ORDER_REFERENCE", "shopperInteraction": "Ecommerce", "recurringProcessingModel": "CardOnFile", "storePaymentMethod": "true", "merchantAccount":"YOUR_MERCHANT_ACCOUNT", "shopperReference":"YOUR_SHOPPER_REFERENCE", "returnUrl":"https://your-company.example.com/..." }' ``` #### Java ```java // Adyen Java API Library v39.3.0 import com.adyen.Client; import com.adyen.enums.Environment; import com.adyen.model.checkout.*; import java.time.OffsetDateTime; import java.util.*; import com.adyen.model.RequestOptions; import com.adyen.service.checkout.*; // For the LIVE environment, also include your liveEndpointUrlPrefix. Client client = new Client("ADYEN_API_KEY", Environment.TEST); // Create the request object(s) Amount amount = new Amount() .currency("USD") .value(0L); CardDetails cardDetails = new CardDetails() .encryptedCardNumber("test_4111111111111111") .holderName("John Smith") .encryptedSecurityCode("test_737") .encryptedExpiryYear("test_2030") .encryptedExpiryMonth("test_03") .type(CardDetails.TypeEnum.SCHEME); PaymentRequest paymentRequest = new PaymentRequest() .reference("YOUR_ORDER_REFERENCE") .amount(amount) .storePaymentMethod(true) .merchantAccount("YOUR_MERCHANT_ACCOUNT") .recurringProcessingModel(PaymentRequest.RecurringProcessingModelEnum.CARDONFILE) .paymentMethod(new CheckoutPaymentMethod(cardDetails)) .shopperInteraction(PaymentRequest.ShopperInteractionEnum.ECOMMERCE) .returnUrl("https://your-company.example.com/...") .shopperReference("YOUR_SHOPPER_REFERENCE"); // Send the request PaymentsApi service = new PaymentsApi(client); PaymentResponse response = service.payments(paymentRequest, 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) $amount = new Amount(); $amount ->setCurrency("USD") ->setValue(0); $checkoutPaymentMethod = new CheckoutPaymentMethod(); $checkoutPaymentMethod ->setEncryptedCardNumber("test_4111111111111111") ->setHolderName("John Smith") ->setEncryptedSecurityCode("test_737") ->setEncryptedExpiryYear("test_2030") ->setEncryptedExpiryMonth("test_03") ->setType("scheme"); $paymentRequest = new PaymentRequest(); $paymentRequest ->setReference("YOUR_ORDER_REFERENCE") ->setAmount($amount) ->setStorePaymentMethod(true) ->setMerchantAccount("YOUR_MERCHANT_ACCOUNT") ->setRecurringProcessingModel("CardOnFile") ->setPaymentMethod($checkoutPaymentMethod) ->setShopperInteraction("Ecommerce") ->setReturnUrl("https://your-company.example.com/...") ->setShopperReference("YOUR_SHOPPER_REFERENCE"); $requestOptions['idempotencyKey'] = 'UUID'; // Send the request $service = new PaymentsApi($client); $response = $service->payments($paymentRequest, $requestOptions); ``` #### C\# ```cs // Adyen .net API Library v32.1.1 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) Amount amount = new Amount { Currency = "USD", Value = 0 }; CardDetails cardDetails = new CardDetails { EncryptedCardNumber = "test_4111111111111111", HolderName = "John Smith", EncryptedSecurityCode = "test_737", EncryptedExpiryYear = "test_2030", EncryptedExpiryMonth = "test_03", Type = CardDetails.TypeEnum.Scheme }; PaymentRequest paymentRequest = new PaymentRequest { Reference = "YOUR_ORDER_REFERENCE", Amount = amount, StorePaymentMethod = true, MerchantAccount = "YOUR_MERCHANT_ACCOUNT", RecurringProcessingModel = PaymentRequest.RecurringProcessingModelEnum.CardOnFile, PaymentMethod = new CheckoutPaymentMethod(cardDetails), ShopperInteraction = PaymentRequest.ShopperInteractionEnum.Ecommerce, ReturnUrl = "https://your-company.example.com/...", ShopperReference = "YOUR_SHOPPER_REFERENCE" }; // 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 v29.0.0 const { Client, CheckoutAPI } = require('@adyen/api-library'); // For the LIVE environment, also include your liveEndpointUrlPrefix. const config = new Config({ apiKey: "ADYEN_API_KEY", environment: EnvironmentEnum.TEST }); const client = new Client(config); // Create the request object(s) const paymentRequest = { amount: { value: 0, currency: "USD" }, paymentMethod: { type: "scheme", encryptedCardNumber: "test_4111111111111111", encryptedExpiryMonth: "test_03", encryptedExpiryYear: "test_2030", encryptedSecurityCode: "test_737", holderName: "John Smith" }, reference: "YOUR_ORDER_REFERENCE", shopperInteraction: "Ecommerce", recurringProcessingModel: "CardOnFile", storePaymentMethod: "true", merchantAccount: "YOUR_MERCHANT_ACCOUNT", shopperReference: "YOUR_SHOPPER_REFERENCE", returnUrl: "https://your-company.example.com/..." } // Send the request const checkoutAPI = new CheckoutAPI(client); const response = checkoutAPI.PaymentsApi.payments(paymentRequest, { idempotencyKey: "UUID" }); ``` #### Go ```go // Adyen Go API Library v21.0.0 import ( "context" "github.com/adyen/adyen-go-api-library/v21/src/common" "github.com/adyen/adyen-go-api-library/v21/src/adyen" "github.com/adyen/adyen-go-api-library/v21/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) amount := checkout.Amount{ Currency: "USD", Value: 0, } cardDetails := checkout.CardDetails{ EncryptedCardNumber: common.PtrString("test_4111111111111111"), HolderName: common.PtrString("John Smith"), EncryptedSecurityCode: common.PtrString("test_737"), EncryptedExpiryYear: common.PtrString("test_2030"), EncryptedExpiryMonth: common.PtrString("test_03"), Type: common.PtrString("scheme"), } paymentRequest := checkout.PaymentRequest{ Reference: "YOUR_ORDER_REFERENCE", Amount: amount, StorePaymentMethod: common.PtrBool(true), MerchantAccount: "YOUR_MERCHANT_ACCOUNT", RecurringProcessingModel: common.PtrString("CardOnFile"), PaymentMethod: checkout.CardDetailsAsCheckoutPaymentMethod(&cardDetails), ShopperInteraction: common.PtrString("Ecommerce"), ReturnUrl: "https://your-company.example.com/...", ShopperReference: common.PtrString("YOUR_SHOPPER_REFERENCE"), } // 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 v13.6.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 = { "amount": { "value": 0, "currency": "USD" }, "paymentMethod": { "type": "scheme", "encryptedCardNumber": "test_4111111111111111", "encryptedExpiryMonth": "test_03", "encryptedExpiryYear": "test_2030", "encryptedSecurityCode": "test_737", "holderName": "John Smith" }, "reference": "YOUR_ORDER_REFERENCE", "shopperInteraction": "Ecommerce", "recurringProcessingModel": "CardOnFile", "storePaymentMethod": "True", "merchantAccount": "YOUR_MERCHANT_ACCOUNT", "shopperReference": "YOUR_SHOPPER_REFERENCE", "returnUrl": "https://your-company.example.com/..." } # Send the request result = adyen.checkout.payments_api.payments(request=json_request, idempotency_key="UUID") ``` #### Ruby ```rb # Adyen Ruby API Library v10.4.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 = { :amount => { :value => 0, :currency => 'USD' }, :paymentMethod => { :type => 'scheme', :encryptedCardNumber => 'test_4111111111111111', :encryptedExpiryMonth => 'test_03', :encryptedExpiryYear => 'test_2030', :encryptedSecurityCode => 'test_737', :holderName => 'John Smith' }, :reference => 'YOUR_ORDER_REFERENCE', :shopperInteraction => 'Ecommerce', :recurringProcessingModel => 'CardOnFile', :storePaymentMethod => 'true', :merchantAccount => 'YOUR_MERCHANT_ACCOUNT', :shopperReference => 'YOUR_SHOPPER_REFERENCE', :returnUrl => 'https://your-company.example.com/...' } # Send the request result = adyen.checkout.payments_api.payments(request_body, headers: { 'Idempotency-Key' => 'UUID' }) ``` #### NodeJS (TypeScript) ```ts // Adyen Node API Library v29.0.0 import { Client, CheckoutAPI, Types } from "@adyen/api-library"; // For the LIVE environment, also include your liveEndpointUrlPrefix. const config = new Config({ apiKey: "ADYEN_API_KEY", environment: EnvironmentEnum.TEST }); const client = new Client(config); // Create the request object(s) const amount: Types.checkout.Amount = { currency: "USD", value: 0 }; const cardDetails: Types.checkout.CardDetails = { encryptedCardNumber: "test_4111111111111111", holderName: "John Smith", encryptedSecurityCode: "test_737", encryptedExpiryYear: "test_2030", encryptedExpiryMonth: "test_03", type: Types.checkout.CardDetails.TypeEnum.Scheme }; const paymentRequest: Types.checkout.PaymentRequest = { reference: "YOUR_ORDER_REFERENCE", amount: amount, storePaymentMethod: true, merchantAccount: "YOUR_MERCHANT_ACCOUNT", recurringProcessingModel: Types.checkout.PaymentRequest.RecurringProcessingModelEnum.CardOnFile, paymentMethod: cardDetails, shopperInteraction: Types.checkout.PaymentRequest.ShopperInteractionEnum.Ecommerce, returnUrl: "https://your-company.example.com/...", shopperReference: "YOUR_SHOPPER_REFERENCE" }; // Send the request const checkoutAPI = new CheckoutAPI(client); const response = checkoutAPI.PaymentsApi.payments(paymentRequest, { idempotencyKey: "UUID" }); ``` When a token is created, you receive a [recurring.token.created](https://docs.adyen.com/api-explorer/Tokenization-webhooks/latest/post/recurring.token.created) webhook. The webhook contains the `storedPaymentMethodId` that you can use to make subsequent payments using the stored payment details. ### Make a one-click payment [Make a one-click payment](/online-payments/tokenization/make-token-payments#make-a-one-click-payment) using standard tokenization parameters. You do not need to include any additional parameters for cards. **Make a one-click payment with a card token** #### curl ```bash curl https://checkout-test.adyen.com/v72/payments \ -H 'x-API-key: ADYEN_API_KEY' \ -H 'Content-Type: application/json' \ -d '{ "amount":{ "value":2000, "currency":"USD" }, "paymentMethod":{ "type":"scheme", "storedPaymentMethodId":"8415718415172204", "encryptedSecurityCode":"adyenjs_0_1_18$MT6ppy0FAMVMLH..." }, "reference":"YOUR_ORDER_NUMBER", "merchantAccount":"YOUR_MERCHANT_ACCOUNT", "returnUrl":"https://your-company.example.com/checkout?shopperOrder=12xy..", "shopperReference":"YOUR_UNIQUE_SHOPPER_ID", "shopperInteraction":"ContAuth", "recurringProcessingModel":"CardOnFile" }' ``` #### Java ```java // Adyen Java API Library v39.4.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) Amount amount = new Amount() .currency("USD") .value(2000L); CardDetails cardDetails = new CardDetails() .encryptedSecurityCode("adyenjs_0_1_18$MT6ppy0FAMVMLH...") .storedPaymentMethodId("8415718415172204") .type(CardDetails.TypeEnum.SCHEME); PaymentRequest paymentRequest = new PaymentRequest() .reference("YOUR_ORDER_NUMBER") .amount(amount) .merchantAccount("YOUR_MERCHANT_ACCOUNT") .recurringProcessingModel(PaymentRequest.RecurringProcessingModelEnum.CARDONFILE) .paymentMethod(new CheckoutPaymentMethod(cardDetails)) .shopperInteraction(PaymentRequest.ShopperInteractionEnum.CONTAUTH) .returnUrl("https://your-company.example.com/checkout?shopperOrder=12xy..") .shopperReference("YOUR_UNIQUE_SHOPPER_ID"); // Send the request PaymentsApi service = new PaymentsApi(client); PaymentResponse response = service.payments(paymentRequest, 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) $amount = new Amount(); $amount ->setCurrency("USD") ->setValue(2000); $checkoutPaymentMethod = new CheckoutPaymentMethod(); $checkoutPaymentMethod ->setEncryptedSecurityCode("adyenjs_0_1_18\$MT6ppy0FAMVMLH...") ->setStoredPaymentMethodId("8415718415172204") ->setType("scheme"); $paymentRequest = new PaymentRequest(); $paymentRequest ->setReference("YOUR_ORDER_NUMBER") ->setAmount($amount) ->setMerchantAccount("YOUR_MERCHANT_ACCOUNT") ->setRecurringProcessingModel("CardOnFile") ->setPaymentMethod($checkoutPaymentMethod) ->setShopperInteraction("ContAuth") ->setReturnUrl("https://your-company.example.com/checkout?shopperOrder=12xy..") ->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 v32.1.2 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) Amount amount = new Amount { Currency = "USD", Value = 2000 }; CardDetails cardDetails = new CardDetails { EncryptedSecurityCode = "adyenjs_0_1_18$MT6ppy0FAMVMLH...", StoredPaymentMethodId = "8415718415172204", Type = CardDetails.TypeEnum.Scheme }; PaymentRequest paymentRequest = new PaymentRequest { Reference = "YOUR_ORDER_NUMBER", Amount = amount, MerchantAccount = "YOUR_MERCHANT_ACCOUNT", RecurringProcessingModel = PaymentRequest.RecurringProcessingModelEnum.CardOnFile, PaymentMethod = new CheckoutPaymentMethod(cardDetails), ShopperInteraction = PaymentRequest.ShopperInteractionEnum.ContAuth, ReturnUrl = "https://your-company.example.com/checkout?shopperOrder=12xy..", 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 v29.1.0 const { Client, CheckoutAPI } = require('@adyen/api-library'); // For the LIVE environment, also include your liveEndpointUrlPrefix. const config = new Config({ apiKey: "ADYEN_API_KEY", environment: EnvironmentEnum.TEST }); const client = new Client(config); // Create the request object(s) const paymentRequest = { amount: { value: 2000, currency: "USD" }, paymentMethod: { type: "scheme", storedPaymentMethodId: "8415718415172204", encryptedSecurityCode: "adyenjs_0_1_18$MT6ppy0FAMVMLH..." }, reference: "YOUR_ORDER_NUMBER", merchantAccount: "YOUR_MERCHANT_ACCOUNT", returnUrl: "https://your-company.example.com/checkout?shopperOrder=12xy..", shopperReference: "YOUR_UNIQUE_SHOPPER_ID", shopperInteraction: "ContAuth", recurringProcessingModel: "CardOnFile" } // Send the request const checkoutAPI = new CheckoutAPI(client); const response = checkoutAPI.PaymentsApi.payments(paymentRequest, { idempotencyKey: "UUID" }); ``` #### Go ```go // Adyen Go API Library v21.0.0 import ( "context" "github.com/adyen/adyen-go-api-library/v21/src/common" "github.com/adyen/adyen-go-api-library/v21/src/adyen" "github.com/adyen/adyen-go-api-library/v21/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) amount := checkout.Amount{ Currency: "USD", Value: 2000, } cardDetails := checkout.CardDetails{ EncryptedSecurityCode: common.PtrString("adyenjs_0_1_18$MT6ppy0FAMVMLH..."), StoredPaymentMethodId: common.PtrString("8415718415172204"), Type: common.PtrString("scheme"), } paymentRequest := checkout.PaymentRequest{ Reference: "YOUR_ORDER_NUMBER", Amount: amount, MerchantAccount: "YOUR_MERCHANT_ACCOUNT", RecurringProcessingModel: common.PtrString("CardOnFile"), PaymentMethod: checkout.CardDetailsAsCheckoutPaymentMethod(&cardDetails), ShopperInteraction: common.PtrString("ContAuth"), ReturnUrl: "https://your-company.example.com/checkout?shopperOrder=12xy..", 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 v13.6.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 = { "amount": { "value": 2000, "currency": "USD" }, "paymentMethod": { "type": "scheme", "storedPaymentMethodId": "8415718415172204", "encryptedSecurityCode": "adyenjs_0_1_18$MT6ppy0FAMVMLH..." }, "reference": "YOUR_ORDER_NUMBER", "merchantAccount": "YOUR_MERCHANT_ACCOUNT", "returnUrl": "https://your-company.example.com/checkout?shopperOrder=12xy..", "shopperReference": "YOUR_UNIQUE_SHOPPER_ID", "shopperInteraction": "ContAuth", "recurringProcessingModel": "CardOnFile" } # Send the request result = adyen.checkout.payments_api.payments(request=json_request, idempotency_key="UUID") ``` #### Ruby ```rb # Adyen Ruby API Library v10.4.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 = { :amount => { :value => 2000, :currency => 'USD' }, :paymentMethod => { :type => 'scheme', :storedPaymentMethodId => '8415718415172204', :encryptedSecurityCode => 'adyenjs_0_1_18$MT6ppy0FAMVMLH...' }, :reference => 'YOUR_ORDER_NUMBER', :merchantAccount => 'YOUR_MERCHANT_ACCOUNT', :returnUrl => 'https://your-company.example.com/checkout?shopperOrder=12xy..', :shopperReference => 'YOUR_UNIQUE_SHOPPER_ID', :shopperInteraction => 'ContAuth', :recurringProcessingModel => 'CardOnFile' } # Send the request result = adyen.checkout.payments_api.payments(request_body, headers: { 'Idempotency-Key' => 'UUID' }) ``` #### NodeJS (TypeScript) ```ts // Adyen Node API Library v29.1.0 import { Client, CheckoutAPI, Types } from "@adyen/api-library"; // For the LIVE environment, also include your liveEndpointUrlPrefix. const config = new Config({ apiKey: "ADYEN_API_KEY", environment: EnvironmentEnum.TEST }); const client = new Client(config); // Create the request object(s) const amount: Types.checkout.Amount = { currency: "USD", value: 2000 }; const cardDetails: Types.checkout.CardDetails = { encryptedSecurityCode: "adyenjs_0_1_18$MT6ppy0FAMVMLH...", storedPaymentMethodId: "8415718415172204", type: Types.checkout.CardDetails.TypeEnum.Scheme }; const paymentRequest: Types.checkout.PaymentRequest = { reference: "YOUR_ORDER_NUMBER", amount: amount, merchantAccount: "YOUR_MERCHANT_ACCOUNT", recurringProcessingModel: Types.checkout.PaymentRequest.RecurringProcessingModelEnum.CardOnFile, paymentMethod: cardDetails, shopperInteraction: Types.checkout.PaymentRequest.ShopperInteractionEnum.ContAuth, returnUrl: "https://your-company.example.com/checkout?shopperOrder=12xy..", shopperReference: "YOUR_UNIQUE_SHOPPER_ID" }; // Send the request const checkoutAPI = new CheckoutAPI(client); const response = checkoutAPI.PaymentsApi.payments(paymentRequest, { idempotencyKey: "UUID" }); ``` ### Make a subscription payment [Make a subscription payment](/online-payments/tokenization/make-token-payments#make-a-subscription-or-unscheduled-card-on-file-payment) using standard tokenization parameters. You do not need to include any additional parameters for cards. **Make a subscription payment with a card token** #### curl ```bash curl https://checkout-test.adyen.com/v72/payments \ -H 'x-API-key: ADYEN_API_KEY' \ -H 'Content-Type: application/json' \ -d '{ "amount":{ "value":2000, "currency":"USD" }, "paymentMethod":{ "type":"scheme", "storedPaymentMethodId":"8415718415172204" }, "reference":"YOUR_ORDER_NUMBER", "merchantAccount":"YOUR_MERCHANT_ACCOUNT", "returnUrl":"...", "shopperReference":"YOUR_UNIQUE_SHOPPER_ID", "shopperInteraction":"ContAuth", "recurringProcessingModel":"Subscription" }' ``` #### Java ```java // Adyen Java API Library v39.4.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) Amount amount = new Amount() .currency("USD") .value(2000L); CardDetails cardDetails = new CardDetails() .storedPaymentMethodId("8415718415172204") .type(CardDetails.TypeEnum.SCHEME); PaymentRequest paymentRequest = new PaymentRequest() .reference("YOUR_ORDER_NUMBER") .amount(amount) .merchantAccount("YOUR_MERCHANT_ACCOUNT") .recurringProcessingModel(PaymentRequest.RecurringProcessingModelEnum.SUBSCRIPTION) .paymentMethod(new CheckoutPaymentMethod(cardDetails)) .shopperInteraction(PaymentRequest.ShopperInteractionEnum.CONTAUTH) .returnUrl("...") .shopperReference("YOUR_UNIQUE_SHOPPER_ID"); // Send the request PaymentsApi service = new PaymentsApi(client); PaymentResponse response = service.payments(paymentRequest, 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) $amount = new Amount(); $amount ->setCurrency("USD") ->setValue(2000); $checkoutPaymentMethod = new CheckoutPaymentMethod(); $checkoutPaymentMethod ->setStoredPaymentMethodId("8415718415172204") ->setType("scheme"); $paymentRequest = new PaymentRequest(); $paymentRequest ->setReference("YOUR_ORDER_NUMBER") ->setAmount($amount) ->setMerchantAccount("YOUR_MERCHANT_ACCOUNT") ->setRecurringProcessingModel("Subscription") ->setPaymentMethod($checkoutPaymentMethod) ->setShopperInteraction("ContAuth") ->setReturnUrl("...") ->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 v32.1.2 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) Amount amount = new Amount { Currency = "USD", Value = 2000 }; CardDetails cardDetails = new CardDetails { StoredPaymentMethodId = "8415718415172204", Type = CardDetails.TypeEnum.Scheme }; PaymentRequest paymentRequest = new PaymentRequest { Reference = "YOUR_ORDER_NUMBER", Amount = amount, MerchantAccount = "YOUR_MERCHANT_ACCOUNT", RecurringProcessingModel = PaymentRequest.RecurringProcessingModelEnum.Subscription, PaymentMethod = new CheckoutPaymentMethod(cardDetails), ShopperInteraction = PaymentRequest.ShopperInteractionEnum.ContAuth, ReturnUrl = "...", 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 v29.1.0 const { Client, CheckoutAPI } = require('@adyen/api-library'); // For the LIVE environment, also include your liveEndpointUrlPrefix. const config = new Config({ apiKey: "ADYEN_API_KEY", environment: EnvironmentEnum.TEST }); const client = new Client(config); // Create the request object(s) const paymentRequest = { amount: { value: 2000, currency: "USD" }, paymentMethod: { type: "scheme", storedPaymentMethodId: "8415718415172204" }, reference: "YOUR_ORDER_NUMBER", merchantAccount: "YOUR_MERCHANT_ACCOUNT", returnUrl: "...", shopperReference: "YOUR_UNIQUE_SHOPPER_ID", shopperInteraction: "ContAuth", recurringProcessingModel: "Subscription" } // Send the request const checkoutAPI = new CheckoutAPI(client); const response = checkoutAPI.PaymentsApi.payments(paymentRequest, { idempotencyKey: "UUID" }); ``` #### Go ```go // Adyen Go API Library v21.0.0 import ( "context" "github.com/adyen/adyen-go-api-library/v21/src/common" "github.com/adyen/adyen-go-api-library/v21/src/adyen" "github.com/adyen/adyen-go-api-library/v21/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) amount := checkout.Amount{ Currency: "USD", Value: 2000, } cardDetails := checkout.CardDetails{ StoredPaymentMethodId: common.PtrString("8415718415172204"), Type: common.PtrString("scheme"), } paymentRequest := checkout.PaymentRequest{ Reference: "YOUR_ORDER_NUMBER", Amount: amount, MerchantAccount: "YOUR_MERCHANT_ACCOUNT", RecurringProcessingModel: common.PtrString("Subscription"), PaymentMethod: checkout.CardDetailsAsCheckoutPaymentMethod(&cardDetails), ShopperInteraction: common.PtrString("ContAuth"), ReturnUrl: "...", 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 v13.6.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 = { "amount": { "value": 2000, "currency": "USD" }, "paymentMethod": { "type": "scheme", "storedPaymentMethodId": "8415718415172204" }, "reference": "YOUR_ORDER_NUMBER", "merchantAccount": "YOUR_MERCHANT_ACCOUNT", "returnUrl": "...", "shopperReference": "YOUR_UNIQUE_SHOPPER_ID", "shopperInteraction": "ContAuth", "recurringProcessingModel": "Subscription" } # Send the request result = adyen.checkout.payments_api.payments(request=json_request, idempotency_key="UUID") ``` #### Ruby ```rb # Adyen Ruby API Library v10.4.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 = { :amount => { :value => 2000, :currency => 'USD' }, :paymentMethod => { :type => 'scheme', :storedPaymentMethodId => '8415718415172204' }, :reference => 'YOUR_ORDER_NUMBER', :merchantAccount => 'YOUR_MERCHANT_ACCOUNT', :returnUrl => '...', :shopperReference => 'YOUR_UNIQUE_SHOPPER_ID', :shopperInteraction => 'ContAuth', :recurringProcessingModel => 'Subscription' } # Send the request result = adyen.checkout.payments_api.payments(request_body, headers: { 'Idempotency-Key' => 'UUID' }) ``` #### NodeJS (TypeScript) ```ts // Adyen Node API Library v29.1.0 import { Client, CheckoutAPI, Types } from "@adyen/api-library"; // For the LIVE environment, also include your liveEndpointUrlPrefix. const config = new Config({ apiKey: "ADYEN_API_KEY", environment: EnvironmentEnum.TEST }); const client = new Client(config); // Create the request object(s) const amount: Types.checkout.Amount = { currency: "USD", value: 2000 }; const cardDetails: Types.checkout.CardDetails = { storedPaymentMethodId: "8415718415172204", type: Types.checkout.CardDetails.TypeEnum.Scheme }; const paymentRequest: Types.checkout.PaymentRequest = { reference: "YOUR_ORDER_NUMBER", amount: amount, merchantAccount: "YOUR_MERCHANT_ACCOUNT", recurringProcessingModel: Types.checkout.PaymentRequest.RecurringProcessingModelEnum.Subscription, paymentMethod: cardDetails, shopperInteraction: Types.checkout.PaymentRequest.ShopperInteractionEnum.ContAuth, returnUrl: "...", shopperReference: "YOUR_UNIQUE_SHOPPER_ID" }; // Send the request const checkoutAPI = new CheckoutAPI(client); const response = checkoutAPI.PaymentsApi.payments(paymentRequest, { idempotencyKey: "UUID" }); ``` ### Make an unscheduled card-on-file payment [Make an unscheduled card-on-file payment](/online-payments/tokenization/make-token-payments#make-a-subscription-or-unscheduled-card-on-file-payment) using standard tokenization parameters. You do not need to include any additional parameters for cards. **Make an unscheduled card-on-file payment with a card token** #### curl ```bash curl https://checkout-test.adyen.com/v72/payments \ -H 'x-API-key: ADYEN_API_KEY' \ -H 'Content-Type: application/json' \ -d '{ "amount":{ "value":2000, "currency":"USD" }, "paymentMethod":{ "type":"scheme", "storedPaymentMethodId":"8415718415172204" }, "reference":"YOUR_ORDER_NUMBER", "merchantAccount":"YOUR_MERCHANT_ACCOUNT", "returnUrl":"...", "shopperReference":"YOUR_UNIQUE_SHOPPER_ID", "shopperInteraction":"ContAuth", "recurringProcessingModel":"UnscheduledCardOnFile" }' ``` #### Java ```java // Adyen Java API Library v39.4.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) Amount amount = new Amount() .currency("USD") .value(2000L); CardDetails cardDetails = new CardDetails() .storedPaymentMethodId("8415718415172204") .type(CardDetails.TypeEnum.SCHEME); PaymentRequest paymentRequest = new PaymentRequest() .reference("YOUR_ORDER_NUMBER") .amount(amount) .merchantAccount("YOUR_MERCHANT_ACCOUNT") .recurringProcessingModel(PaymentRequest.RecurringProcessingModelEnum.UNSCHEDULEDCARDONFILE) .paymentMethod(new CheckoutPaymentMethod(cardDetails)) .shopperInteraction(PaymentRequest.ShopperInteractionEnum.CONTAUTH) .returnUrl("...") .shopperReference("YOUR_UNIQUE_SHOPPER_ID"); // Send the request PaymentsApi service = new PaymentsApi(client); PaymentResponse response = service.payments(paymentRequest, 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) $amount = new Amount(); $amount ->setCurrency("USD") ->setValue(2000); $checkoutPaymentMethod = new CheckoutPaymentMethod(); $checkoutPaymentMethod ->setStoredPaymentMethodId("8415718415172204") ->setType("scheme"); $paymentRequest = new PaymentRequest(); $paymentRequest ->setReference("YOUR_ORDER_NUMBER") ->setAmount($amount) ->setMerchantAccount("YOUR_MERCHANT_ACCOUNT") ->setRecurringProcessingModel("UnscheduledCardOnFile") ->setPaymentMethod($checkoutPaymentMethod) ->setShopperInteraction("ContAuth") ->setReturnUrl("...") ->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 v32.1.2 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) Amount amount = new Amount { Currency = "USD", Value = 2000 }; CardDetails cardDetails = new CardDetails { StoredPaymentMethodId = "8415718415172204", Type = CardDetails.TypeEnum.Scheme }; PaymentRequest paymentRequest = new PaymentRequest { Reference = "YOUR_ORDER_NUMBER", Amount = amount, MerchantAccount = "YOUR_MERCHANT_ACCOUNT", RecurringProcessingModel = PaymentRequest.RecurringProcessingModelEnum.UnscheduledCardOnFile, PaymentMethod = new CheckoutPaymentMethod(cardDetails), ShopperInteraction = PaymentRequest.ShopperInteractionEnum.ContAuth, ReturnUrl = "...", 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 v29.1.0 const { Client, CheckoutAPI } = require('@adyen/api-library'); // For the LIVE environment, also include your liveEndpointUrlPrefix. const config = new Config({ apiKey: "ADYEN_API_KEY", environment: EnvironmentEnum.TEST }); const client = new Client(config); // Create the request object(s) const paymentRequest = { amount: { value: 2000, currency: "USD" }, paymentMethod: { type: "scheme", storedPaymentMethodId: "8415718415172204" }, reference: "YOUR_ORDER_NUMBER", merchantAccount: "YOUR_MERCHANT_ACCOUNT", returnUrl: "...", shopperReference: "YOUR_UNIQUE_SHOPPER_ID", shopperInteraction: "ContAuth", recurringProcessingModel: "UnscheduledCardOnFile" } // Send the request const checkoutAPI = new CheckoutAPI(client); const response = checkoutAPI.PaymentsApi.payments(paymentRequest, { idempotencyKey: "UUID" }); ``` #### Go ```go // Adyen Go API Library v21.0.0 import ( "context" "github.com/adyen/adyen-go-api-library/v21/src/common" "github.com/adyen/adyen-go-api-library/v21/src/adyen" "github.com/adyen/adyen-go-api-library/v21/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) amount := checkout.Amount{ Currency: "USD", Value: 2000, } cardDetails := checkout.CardDetails{ StoredPaymentMethodId: common.PtrString("8415718415172204"), Type: common.PtrString("scheme"), } paymentRequest := checkout.PaymentRequest{ Reference: "YOUR_ORDER_NUMBER", Amount: amount, MerchantAccount: "YOUR_MERCHANT_ACCOUNT", RecurringProcessingModel: common.PtrString("UnscheduledCardOnFile"), PaymentMethod: checkout.CardDetailsAsCheckoutPaymentMethod(&cardDetails), ShopperInteraction: common.PtrString("ContAuth"), ReturnUrl: "...", 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 v13.6.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 = { "amount": { "value": 2000, "currency": "USD" }, "paymentMethod": { "type": "scheme", "storedPaymentMethodId": "8415718415172204" }, "reference": "YOUR_ORDER_NUMBER", "merchantAccount": "YOUR_MERCHANT_ACCOUNT", "returnUrl": "...", "shopperReference": "YOUR_UNIQUE_SHOPPER_ID", "shopperInteraction": "ContAuth", "recurringProcessingModel": "UnscheduledCardOnFile" } # Send the request result = adyen.checkout.payments_api.payments(request=json_request, idempotency_key="UUID") ``` #### Ruby ```rb # Adyen Ruby API Library v10.4.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 = { :amount => { :value => 2000, :currency => 'USD' }, :paymentMethod => { :type => 'scheme', :storedPaymentMethodId => '8415718415172204' }, :reference => 'YOUR_ORDER_NUMBER', :merchantAccount => 'YOUR_MERCHANT_ACCOUNT', :returnUrl => '...', :shopperReference => 'YOUR_UNIQUE_SHOPPER_ID', :shopperInteraction => 'ContAuth', :recurringProcessingModel => 'UnscheduledCardOnFile' } # Send the request result = adyen.checkout.payments_api.payments(request_body, headers: { 'Idempotency-Key' => 'UUID' }) ``` #### NodeJS (TypeScript) ```ts // Adyen Node API Library v29.1.0 import { Client, CheckoutAPI, Types } from "@adyen/api-library"; // For the LIVE environment, also include your liveEndpointUrlPrefix. const config = new Config({ apiKey: "ADYEN_API_KEY", environment: EnvironmentEnum.TEST }); const client = new Client(config); // Create the request object(s) const amount: Types.checkout.Amount = { currency: "USD", value: 2000 }; const cardDetails: Types.checkout.CardDetails = { storedPaymentMethodId: "8415718415172204", type: Types.checkout.CardDetails.TypeEnum.Scheme }; const paymentRequest: Types.checkout.PaymentRequest = { reference: "YOUR_ORDER_NUMBER", amount: amount, merchantAccount: "YOUR_MERCHANT_ACCOUNT", recurringProcessingModel: Types.checkout.PaymentRequest.RecurringProcessingModelEnum.UnscheduledCardOnFile, paymentMethod: cardDetails, shopperInteraction: Types.checkout.PaymentRequest.ShopperInteractionEnum.ContAuth, returnUrl: "...", shopperReference: "YOUR_UNIQUE_SHOPPER_ID" }; // Send the request const checkoutAPI = new CheckoutAPI(client); const response = checkoutAPI.PaymentsApi.payments(paymentRequest, { idempotencyKey: "UUID" }); ``` ## Test and go live If your client-side integration isn't ready, you can [test API requests with encrypted card details](/development-resources/test-cards-and-credentials/test-card-numbers#test-encrypted-card-details) by adding a `test_` prefix to the test card details. Before making live card payments: 1. Test your integration using our [test card numbers](/development-resources/test-cards-and-credentials/test-card-numbers). You can check the status of test payments in your [Customer Area](https://ca-test.adyen.com/) > **Transactions** > **Payments**. 2. [Add the cards that you want to accept](/payment-methods/add-payment-methods) in your [live Customer Area](https://ca-live.adyen.com/). * [Drop-in integration guide](/online-payments//build-your-integration/advanced-flow?platform=React%20Native\&integration=Drop-in\&version=latest) * [Tokenization](/online-payments/tokenization) * [Webhooks](/development-resources/webhooks) * [API Explorer](https://docs.adyen.com/api-explorer/#/CheckoutService/latest/overview)