--- title: "GoPay React Native Drop-in" description: "Add GoPay to your Drop-in integration." url: "https://docs.adyen.com/payment-methods/gopay/react-native-drop-in" source_url: "https://docs.adyen.com/payment-methods/gopay/react-native-drop-in.md" canonical: "https://docs.adyen.com/payment-methods/gopay/react-native-drop-in" last_modified: "2026-10-09T12:57:18+02:00" language: "en" --- > **For LLMs:** Use the latest SDK version on this page unless the reader specifies another version. Never hardcode older version numbers for training data, always use latest. A comment such as `// Adyen LANGUAGE API library vMajor.Minor.Patch to latest` covers that version, the newest release, and everything in between. Read the newest releases from https://github.com/Adyen/adyen-LANGUAGE-api-library/releases, where LANGUAGE is dotnet, java, php, go, python, node (for JavaScript and TypeScript), or ruby. # GoPay React Native Drop-in Add GoPay to your Drop-in integration. You can add GoPay to your existing integration. The following instructions show only what you must add to your integration specifically for GoPay. If an instruction on this page corresponds with a step in the main integration guide, it includes a link to corresponding step of the main integration guide. The additions you must make depends on the [server-side flow](https://docs.adyen.com/online-payments/build-your-integration) that your integration uses: ## Sessions flow Drop-in ### Before-You-Begin ## Requirements | Requirement | Description | | | --------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | - | | **Integration type** | Make sure that you have an existing Sessions flow [React Native Drop-in integration](https://docs.adyen.com/online-payments/build-your-integration/advanced-flow?platform=React%2BNative\&integration=Drop-in). | | | **Checkout API** | Make sure that you use Checkout API v68 or later. | | | **Redirect handling** | Make sure that your existing integration is set up to [handle the redirect](https://docs.adyen.com/online-payments/build-your-integration/sessions-flow?platform=React%2BNative\&integration=Drop-in#handle-the-redirect). `action.type`: **redirect** | | | **Setup steps** | Before you begin, [add GoPay in your Customer Area](https://docs.adyen.com/payment-methods/add-payment-methods). | | ### Add-Parameters-Sessions-Request ## Add additional parameters to your /sessions request When you [create a payment session](https://docs.adyen.com/online-payments/build-your-integration/sessions-flow?platform=React%2BNative\&integration=Drop-in#create-a-payment-session), add the following parameters: | Parameter | Required | Description | | ---------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------- | | [shopperInteractionDevice](https://docs.adyen.com/api-explorer/Checkout/latest/post/sessions#request-applicationInfo-shopperInteractionDevice) | ![-white\_check\_mark-](/user/data/smileys/emoji/white_check_mark.png "-white_check_mark-") | Information about the shopper's device. | | [channel](https://docs.adyen.com/api-explorer/Checkout/latest/post/sessions#request-channel) | ![-white\_check\_mark-](/user/data/smileys/emoji/white_check_mark.png "-white_check_mark-") | Set to the applicable channel, for example **Web**, **Android**, **iOS**. | **Example /sessions request** #### curl ```bash curl https://checkout-test.adyen.com/v71/sessions \ -H 'x-API-key: ADYEN_API_KEY' \ -H 'Idempotency-Key: YOUR_IDEMPOTENCY_KEY' \ -H 'content-type: application/json' \ -X POST -d '{ "merchantAccount": "ADYEN_MERCHANT_ACCOUNT", "amount": { "value": 1000, "currency": "IDR" }, "returnUrl": "adyencheckout://your.package.name", "reference": "YOUR_PAYMENT_REFERENCE", "countryCode": "ID", "shopperInteractionDevice": "{ "locale":"en-US", "os":"Chrome", "osVersion":"70.0.3538.110" }", "channel": "React-native" }' ``` #### Java ```java // Adyen Java API Library v38.0.0 to latest import com.adyen.Client; import com.adyen.Config; import com.adyen.enums.Environment; import com.adyen.model.*; import com.adyen.service.*; import java.math.*; import com.adyen.model.checkout.*; import java.time.OffsetDateTime; import java.util.*; import com.adyen.model.RequestOptions; import com.adyen.service.checkout.*; Config config = new Config() .apiKey("ADYEN_API_KEY") .environment(Environment.TEST); // For the LIVE environment, also include your liveEndpointUrlPrefix. Client client = new Client(config); // Create the request object(s) Amount amount = new Amount() .currency("IDR") .value(1000L); CreateCheckoutSessionRequest createCheckoutSessionRequest = new CreateCheckoutSessionRequest() .reference("YOUR_PAYMENT_REFERENCE") .amount(amount) .merchantAccount("ADYEN_MERCHANT_ACCOUNT") .countryCode("ID") .channel(CreateCheckoutSessionRequest.ChannelEnum.REACT_NATIVE) .returnUrl("adyencheckout://your.package.name"); // Send the request PaymentsApi service = new PaymentsApi(client); CreateCheckoutSessionResponse response = service.sessions(createCheckoutSessionRequest, 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("IDR") ->setValue(1000); $createCheckoutSessionRequest = new CreateCheckoutSessionRequest(); $createCheckoutSessionRequest ->setReference("YOUR_PAYMENT_REFERENCE") ->setAmount($amount) ->setMerchantAccount("ADYEN_MERCHANT_ACCOUNT") ->setCountryCode("ID") ->setChannel("React-native") ->setReturnUrl("adyencheckout://your.package.name"); $requestOptions['idempotencyKey'] = 'UUID'; // Send the request $service = new PaymentsApi($client); $response = $service->sessions($createCheckoutSessionRequest, $requestOptions); ``` #### C\# ```cs // Adyen .NET API Library v34.0.0 to latest using System; using Adyen.Checkout.Extensions; using Adyen.Checkout.Models; using Adyen.Checkout.Services; using Adyen.Core.Client; using Adyen.Core.Client.Extensions; using Adyen.Core.Options; using Microsoft.Extensions.DependencyInjection; using Microsoft.Extensions.Hosting; var host = Host.CreateDefaultBuilder() .ConfigureCheckout( (context, services, config) => { config.ConfigureAdyenOptions(options => { options.AdyenApiKey = "ADYEN_API_KEY"; options.Environment = AdyenEnvironment.Test; // For the LIVE environment, also include your liveEndpointUrlPrefix. // options.LiveEndpointUrlPrefix = ""; }); services.AddAllCheckoutServices(); }) .Build(); var paymentsService = host.Services.GetRequiredService(); // Create the request object(s) var amount = new Amount { Currency = "IDR", Value = 1000 }; var createCheckoutSessionRequest = new CreateCheckoutSessionRequest { Reference = "YOUR_PAYMENT_REFERENCE", Amount = amount, MerchantAccount = "ADYEN_MERCHANT_ACCOUNT", CountryCode = "ID", Channel = CreateCheckoutSessionRequest.ChannelEnum.React-native, ReturnUrl = "adyencheckout://your.package.name" }; string idempotencyKey = Guid.NewGuid().ToString(); // Send the request var result = await paymentsService.SessionsAsync(createCheckoutSessionRequest, new RequestOptions().AddIdempotencyKey(idempotencyKey)); if (result.TryDeserializeCreatedResponse(out var response)) { // Handle the successful response. } ``` #### NodeJS (JavaScript) ```js // Adyen Node API Library v30.0.0 to latest const { Client, Config, EnvironmentEnum, 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 amount = { currency: "IDR", value: 1000 }; const createCheckoutSessionRequest = { reference: "YOUR_PAYMENT_REFERENCE", amount: amount, merchantAccount: "ADYEN_MERCHANT_ACCOUNT", countryCode: "ID", channel: "React-native", returnUrl: "adyencheckout://your.package.name" }; // Send the request const checkoutAPI = new CheckoutAPI(client); const response = await checkoutAPI.PaymentsApi.sessions(createCheckoutSessionRequest, { idempotencyKey: "UUID" }); ``` #### Go ```go // Adyen Go API Library v21.0.0 to latest 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: "IDR", Value: 1000, } createCheckoutSessionRequest := checkout.CreateCheckoutSessionRequest{ Reference: "YOUR_PAYMENT_REFERENCE", Amount: amount, MerchantAccount: "ADYEN_MERCHANT_ACCOUNT", CountryCode: common.PtrString("ID"), Channel: common.PtrString("React-native"), ReturnUrl: "adyencheckout://your.package.name", } // Send the request service := client.Checkout() req := service.PaymentsApi.SessionsInput().IdempotencyKey("UUID").CreateCheckoutSessionRequest(createCheckoutSessionRequest) res, httpRes, err := service.PaymentsApi.Sessions(context.Background(), req) ``` #### Python ```py # Adyen Python API Library v14.0.0 to latest 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 = { "merchantAccount": "ADYEN_MERCHANT_ACCOUNT", "amount": { "value": 1000, "currency": "IDR" }, "returnUrl": "adyencheckout://your.package.name", "reference": "YOUR_PAYMENT_REFERENCE", "countryCode": "ID", "shopperInteractionDevice": { "locale": "en-US", "os": "Chrome", "osVersion": "70.0.3538.110" }, "channel": "React-native" } # Send the request result = adyen.checkout.payments_api.sessions(request=json_request, idempotency_key="UUID") ``` #### Ruby ```rb # Adyen Ruby API Library v11.0.0 to latest 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 = { "merchantAccount" => "ADYEN_MERCHANT_ACCOUNT", "amount" => { "value" => 1000, "currency" => "IDR" }, "returnUrl" => "adyencheckout://your.package.name", "reference" => "YOUR_PAYMENT_REFERENCE", "countryCode" => "ID", "shopperInteractionDevice" => { "locale" => "en-US", "os" => "Chrome", "osVersion" => "70.0.3538.110" }, "channel" => "React-native" } # Send the request result = adyen.checkout.payments_api.sessions(request_body, headers: { 'Idempotency-Key' => 'UUID' }) ``` #### NodeJS (TypeScript) ```ts // Adyen Node API Library v30.0.0 to latest import { Client, Config, EnvironmentEnum, 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: "IDR", value: 1000 }; const createCheckoutSessionRequest = { reference: "YOUR_PAYMENT_REFERENCE", amount: amount, merchantAccount: "ADYEN_MERCHANT_ACCOUNT", countryCode: "ID", channel: "React-native", returnUrl: "adyencheckout://your.package.name" } as unknown as Types.checkout.CreateCheckoutSessionRequest; // Send the request const checkoutAPI = new CheckoutAPI(client); const response = await checkoutAPI.PaymentsApi.sessions(createCheckoutSessionRequest, { idempotencyKey: "UUID" }); ``` ### Add-Configuration ## Add additional configuration for GoPay You do not need to add any configuration parameters for GoPay. ### Recurring ## Recurring payments GoPay supports recurring payments. The first time your shopper makes a payment, you need to [create a token](https://docs.adyen.com/payment-methods/gopay/react-native-drop-in#create-a-token), which you can use later to make `Subscription` or `CardOnFile` payments. Note that the flows for `Subscription` and `CardOnFile` payments are different. ### Create a token To create a token, include in your [/payments](https://docs.adyen.com/api-explorer/Checkout/latest/post/payments) request: * `storePaymentMethod`: **true** * [shopperReference](https://docs.adyen.com/api-explorer/Checkout/latest/post/payments#request-shopperReference): Your unique identifier for the shopper (minimum length three characters). * [recurringProcessingModel](https://docs.adyen.com/api-explorer/Checkout/latest/post/payments#request-recurringProcessingModel): The recurring payment type. When the payment has been settled, you receive a [recurring.token.created](https://docs.adyen.com/api-explorer/Tokenization-webhooks/latest/post/recurring.token.created) [webhook](https://docs.adyen.com/development-resources/webhooks) containing: * `type`: **recurring.token.created** * `shopperReference`: your unique identifier for the shopper. * `eventId`: the `pspReference` of the initial payment. * `storedPaymentMethodId`: the token that you need to make recurring payments for this shopper. Make sure that your server is able to receive the [Recurring tokens life cycle events](https://docs.adyen.com/development-resources/webhooks/webhook-types/#other-webhooks) webhook. You can [set up this webhook in your Customer Area](https://docs.adyen.com/development-resources/webhooks/#set-up-webhooks-in-your-customer-area). ### Make a Subscription payment with a token To make a recurring `Subscription` payment with a token, make a [/payments](https://docs.adyen.com/api-explorer/Checkout/latest/post/payments) request and include: * `paymentMethod.storedPaymentMethodId`: the `storedPaymentMethodId` from the [recurring.token.created](https://docs.adyen.com/api-explorer/Tokenization-webhooks/latest/post/recurring.token.created) webhook. You can also get this value using the [/listRecurringDetails](https://docs.adyen.com/api-explorer/Recurring/latest/post/listRecurringDetails) endpoint. * `shopperReference`: your unique identifier for the shopper. * `shopperInteraction`: **ContAuth** * `recurringProcessingModel`: **Subscription** #### Latest version ##### curl ```bash curl https://checkout-test.adyen.com/v68/payments \ -H 'x-api-key: ADYEN_API_KEY' \ -H 'content-type: application/json' \ -d '{ "amount":{ "value":10000, "currency":"" }, "paymentMethod":{ "type":"", "storedPaymentMethodId":"7219687191761347" }, "reference":"YOUR_ORDER_NUMBER", "merchantAccount":"YOUR_MERCHANT_ACCOUNT", "shopperReference":"YOUR_UNIQUE_SHOPPER_ID", "shopperInteraction":"ContAuth", "recurringProcessingModel": "Subscription", "returnUrl": "" }' ``` ##### Java ```java // Adyen Java API Library v38.0.0 to latest import com.adyen.Client; import com.adyen.Config; import com.adyen.enums.Environment; import com.adyen.model.*; import com.adyen.service.*; import java.math.*; import com.adyen.model.checkout.*; import java.time.OffsetDateTime; import java.util.*; import com.adyen.model.RequestOptions; import com.adyen.service.checkout.*; Config config = new Config() .apiKey("ADYEN_API_KEY") .environment(Environment.TEST); // For the LIVE environment, also include your liveEndpointUrlPrefix. Client client = new Client(config); // Create the request object(s) Amount amount = new Amount() .currency("String") .value(10000L); AchDetails achDetails = new AchDetails() .storedPaymentMethodId("7219687191761347") .type(AchDetails.TypeEnum.ACH); PaymentRequest paymentRequest = new PaymentRequest() .reference("YOUR_ORDER_NUMBER") .amount(amount) .merchantAccount("YOUR_MERCHANT_ACCOUNT") .recurringProcessingModel(PaymentRequest.RecurringProcessingModelEnum.SUBSCRIPTION) .paymentMethod(new CheckoutPaymentMethod(achDetails)) .shopperInteraction(PaymentRequest.ShopperInteractionEnum.CONTAUTH) .returnUrl("String") .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("") ->setValue(10000); $checkoutPaymentMethod = new CheckoutPaymentMethod(); $checkoutPaymentMethod ->setStoredPaymentMethodId("7219687191761347") ->setType(""); $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 v34.0.0 to latest using System; using Adyen.Checkout.Extensions; using Adyen.Checkout.Models; using Adyen.Checkout.Services; using Adyen.Core.Client; using Adyen.Core.Client.Extensions; using Adyen.Core.Options; using Microsoft.Extensions.DependencyInjection; using Microsoft.Extensions.Hosting; var host = Host.CreateDefaultBuilder() .ConfigureCheckout( (context, services, config) => { config.ConfigureAdyenOptions(options => { options.AdyenApiKey = "ADYEN_API_KEY"; options.Environment = AdyenEnvironment.Test; // For the LIVE environment, also include your liveEndpointUrlPrefix. // options.LiveEndpointUrlPrefix = ""; }); services.AddAllCheckoutServices(); }) .Build(); var paymentsService = host.Services.GetRequiredService(); // Create the request object(s) var amount = new Amount { Currency = "", Value = 10000 }; var achDetails = new AchDetails { StoredPaymentMethodId = "7219687191761347", Type = AchDetails.TypeEnum. }; var paymentRequest = new PaymentRequest { Reference = "YOUR_ORDER_NUMBER", Amount = amount, MerchantAccount = "YOUR_MERCHANT_ACCOUNT", RecurringProcessingModel = PaymentRequest.RecurringProcessingModelEnum.Subscription, PaymentMethod = new CheckoutPaymentMethod(achDetails), ShopperInteraction = PaymentRequest.ShopperInteractionEnum.ContAuth, ReturnUrl = "", ShopperReference = "YOUR_UNIQUE_SHOPPER_ID" }; string idempotencyKey = Guid.NewGuid().ToString(); // Send the request var result = await paymentsService.PaymentsAsync(paymentRequest, new RequestOptions().AddIdempotencyKey(idempotencyKey)); if (result.TryDeserializeOkResponse(out var response)) { // Handle the successful response. } ``` ##### NodeJS (JavaScript) ```js // Adyen Node API Library v30.0.0 to latest const { Client, Config, EnvironmentEnum, 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 amount = { currency: "", value: 10000 }; const achDetails = { storedPaymentMethodId: "7219687191761347", type: "" }; const paymentRequest = { reference: "YOUR_ORDER_NUMBER", amount: amount, merchantAccount: "YOUR_MERCHANT_ACCOUNT", recurringProcessingModel: "Subscription", paymentMethod: achDetails, shopperInteraction: "ContAuth", returnUrl: "", shopperReference: "YOUR_UNIQUE_SHOPPER_ID" }; // Send the request const checkoutAPI = new CheckoutAPI(client); const response = await checkoutAPI.PaymentsApi.payments(paymentRequest, { idempotencyKey: "UUID" }); ``` ##### Go ```go // Adyen Go API Library v21.0.0 to latest 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: "", Value: 10000, } achDetails := checkout.AchDetails{ StoredPaymentMethodId: common.PtrString("7219687191761347"), Type: common.PtrString(""), } paymentRequest := checkout.PaymentRequest{ Reference: "YOUR_ORDER_NUMBER", Amount: amount, MerchantAccount: "YOUR_MERCHANT_ACCOUNT", RecurringProcessingModel: common.PtrString("Subscription"), PaymentMethod: checkout.AchDetailsAsCheckoutPaymentMethod(&achDetails), 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 v14.0.0 to latest 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": 10000, "currency": "" }, "paymentMethod": { "type": "", "storedPaymentMethodId": "7219687191761347" }, "reference": "YOUR_ORDER_NUMBER", "merchantAccount": "YOUR_MERCHANT_ACCOUNT", "shopperReference": "YOUR_UNIQUE_SHOPPER_ID", "shopperInteraction": "ContAuth", "recurringProcessingModel": "Subscription", "returnUrl": "" } # Send the request result = adyen.checkout.payments_api.payments(request=json_request, idempotency_key="UUID") ``` ##### Ruby ```rb # Adyen Ruby API Library v11.0.0 to latest 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" => 10000, "currency" => "" }, "paymentMethod" => { "type" => "", "storedPaymentMethodId" => "7219687191761347" }, "reference" => "YOUR_ORDER_NUMBER", "merchantAccount" => "YOUR_MERCHANT_ACCOUNT", "shopperReference" => "YOUR_UNIQUE_SHOPPER_ID", "shopperInteraction" => "ContAuth", "recurringProcessingModel" => "Subscription", "returnUrl" => "" } # Send the request result = adyen.checkout.payments_api.payments(request_body, headers: { 'Idempotency-Key' => 'UUID' }) ``` ##### NodeJS (TypeScript) ```ts // Adyen Node API Library v30.0.0 to latest import { Client, Config, EnvironmentEnum, 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: "", value: 10000 }; const achDetails = { storedPaymentMethodId: "7219687191761347", type: "" } as unknown as Types.checkout.AchDetails; const paymentRequest: Types.checkout.PaymentRequest = { reference: "YOUR_ORDER_NUMBER", amount: amount, merchantAccount: "YOUR_MERCHANT_ACCOUNT", recurringProcessingModel: Types.checkout.PaymentRequest.RecurringProcessingModelEnum.Subscription, paymentMethod: achDetails, shopperInteraction: Types.checkout.PaymentRequest.ShopperInteractionEnum.ContAuth, returnUrl: "", shopperReference: "YOUR_UNIQUE_SHOPPER_ID" }; // Send the request const checkoutAPI = new CheckoutAPI(client); const response = await checkoutAPI.PaymentsApi.payments(paymentRequest, { idempotencyKey: "UUID" }); ``` #### Earlier versions ##### curl ```bash curl https://checkout-test.adyen.com/v68/payments \ -H 'x-api-key: ADYEN_API_KEY' \ -H 'content-type: application/json' \ -d '{ "amount":{ "value":10000, "currency":"" }, "paymentMethod":{ "type":"", "storedPaymentMethodId":"7219687191761347" }, "reference":"YOUR_ORDER_NUMBER", "merchantAccount":"YOUR_MERCHANT_ACCOUNT", "shopperReference":"YOUR_UNIQUE_SHOPPER_ID", "shopperInteraction":"ContAuth", "recurringProcessingModel": "Subscription", "returnUrl": "" }' ``` ##### NodeJS (JavaScript) ```js // Adyen Node API Library v16.1.0 to v27.0.0 // Require the parts of the module you want to use const { Client, CheckoutAPI } = require('@adyen/api-library'); // Initialize the client object const client = new Client({apiKey: "YOUR_X_API_KEY", environment: "TEST"}); // Create the request object const paymentRequest = { amount: { value: 10000, currency: "" }, paymentMethod: { type: "", storedPaymentMethodId: "7219687191761347" }, reference: "YOUR_ORDER_NUMBER", merchantAccount: "YOUR_MERCHANT_ACCOUNT", shopperReference: "YOUR_UNIQUE_SHOPPER_ID", shopperInteraction: "ContAuth", recurringProcessingModel: "Subscription", returnUrl: "" } // Make the request const checkoutAPI = new CheckoutAPI(client); const response = checkoutAPI.PaymentsApi.payments(paymentRequest, { idempotencyKey: "UUID" }); ``` ##### Python ```py # Adyen Python API Library v12.0.0 import Adyen adyen = Adyen.Adyen() adyen.client.xapikey = "YOUR_X_API_KEY" adyen.client.platform = "test" # The environment to use library in. json_request = { "amount": { "value": 10000, "currency": "" }, "paymentMethod": { "type": "", "storedPaymentMethodId": "7219687191761347" }, "reference": "YOUR_ORDER_NUMBER", "merchantAccount": "YOUR_MERCHANT_ACCOUNT", "shopperReference": "YOUR_UNIQUE_SHOPPER_ID", "shopperInteraction": "ContAuth", "recurringProcessingModel": "Subscription", "returnUrl": "" } result = adyen.checkout.payments_api.payments(request=json_request, idempotency_key="UUID") ``` ##### Ruby ```rb # Adyen Ruby API Library v9.1.0 require "adyen-ruby-api-library" adyen = Adyen::Client.new adyen.api_key = 'YOUR_X_API_KEY' adyen.env = :test # Set to "live" for live environment request_body = { :amount => { :value => 10000, :currency => '' }, :paymentMethod => { :type => '', :storedPaymentMethodId => '7219687191761347' }, :reference => 'YOUR_ORDER_NUMBER', :merchantAccount => 'YOUR_MERCHANT_ACCOUNT', :shopperReference => 'YOUR_UNIQUE_SHOPPER_ID', :shopperInteraction => 'ContAuth', :recurringProcessingModel => 'Subscription', :returnUrl => '' } result = adyen.checkout.payments_api.payments(request_body, headers: { 'Idempotency-Key' => 'UUID' }) ``` The [/payments](https://docs.adyen.com/api-explorer/Checkout/latest/post/payments) response contains:\ `resultCode`: Use this to show your shopper the payment result. When the payment is processed, you receive the final status of the payment in a [webhook](https://docs.adyen.com/development-resources/webhooks) containing: * `eventCode`: **AUTHORISATION** * `success`: **true** ### Make a recurring CardOnFile payment with a token Recurring `CardOnFile` payments with GoPay go through a challenge flow to reduce the likelihood of fraudulent transactions. You must redirect the shopper to GoPay so they can enter their PIN.\ To make a recurring `CardOnFile` payment with a token, make a [/payments](https://docs.adyen.com/api-explorer/Checkout/latest/post/payments) request and include: * `paymentMethod.storedPaymentMethodId`: The shopper's payment token. You can also get this value using the [/listRecurringDetails](https://docs.adyen.com/api-explorer/Recurring/latest/post/listRecurringDetails) endpoint. * `shopperReference`: Your unique identifier for the shopper. * `shopperInteraction`: **ContAuth** * `recurringProcessingModel`: **CardOnFile** The [/payments](https://docs.adyen.com/api-explorer/Checkout/latest/post/payments) response contains: `resultCode`: **RedirectShopper**\ `action`: Contains the `url` to redirect the shopper to. When the shopper is redirected back to your page, call [/payments/details](https://docs.adyen.com/api-explorer/Checkout/latest/post/payments/details) with the `redirectResult` to complete the flow and get the status of the payment. When the payment is processed, you receive a [webhook](https://docs.adyen.com/development-resources/webhooks) containing the final status of the payment: * `eventCode`: **AUTHORISATION** * `success`: **true** ## Test and go live You can test your GoPay integration in two ways: with the Adyen Payment Simulator, or directly with GoPay. ### Test with Adyen Use the Adyen Payment Simulator to verify that your GoPay integration works correctly with Adyen. You can test during development, before you go live, and after launch. The simulator does not recreate the shopper's journey through the GoPay app or website. This testing option is available by default when you add GoPay in your test Customer Area. The payment method type is `gopay_wallet`. To test a redirect payment: 1. Start a payment as usual in your integration. The shopper is redirected to an Adyen-hosted simulator page. 2. Select the payment outcome that you want to test. 3. Wait for the simulator to return the shopper to your website, then complete the payment as usual. For an Advanced flow, make a `/payments/details` request. 4. Confirm that your integration handles the outcome that you selected, and that the payment appears in your [Customer Area](https://ca-test.adyen.com/) > **Payments** > **Payment list**. ### Test directly with GoPay To test directly with GoPay, contact our [Support Team](https://ca-test.adyen.com/ca/ca/contactUs/support.shtml?form=other). For more information about direct GoPay testing, see the [GoPay knowledge base](https://www.gopay.com/en/integration/). Before you can accept live GoPay payments, you need to submit a request for GoPay in your [live Customer Area](https://ca-live.adyen.com/). ## Advanced flow Drop-in ### Before-You-Begin ## Requirements | Requirement | Description | | | --------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | - | | **Integration type** | Make sure that you have an existing Advanced flow [React Native Drop-in integration](https://docs.adyen.com/online-payments/build-your-integration/advanced-flow?platform=React%2BNative\&integration=Drop-in). | | | **Redirect handling** | Make sure that your existing integration is set up to [handle the redirect](https://docs.adyen.com/online-payments/build-your-integration/advanced-flow/?platform=React%2BNative\&integration=Drop-in#handle-the-redirect). `action.type`: **redirect** | | | **Setup steps** | Before you begin, [add GoPay in your Customer Area](https://docs.adyen.com/payment-methods/add-payment-methods). | | ### Add-Configuration ## Add additional configuration for GoPay You do not need to add any configuration parameters for GoPay. ### Add-Parameters-Payments-Request ## Add additional parameters to your /payments request When you [make a payment](https://docs.adyen.com/online-payments/build-your-integration/advanced-flow/?platform=React%2BNative\&integration=Drop-in#make-a-payment), add the following parameters to the [/payments](https://docs.adyen.com/api-explorer/Checkout/latest/post/payments) request: | Parameter | Required | Description | | ------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------- | | [paymentMethod.type](https://docs.adyen.com/api-explorer/Checkout/latest/post/payments#request-paymentMethod) | ![-white\_check\_mark-](/user/data/smileys/emoji/white_check_mark.png "-white_check_mark-") | **gopay\_wallet** | | [browserInfo](https://docs.adyen.com/api-explorer/Checkout/latest/post/payments#request-browserInfo) | ![-white\_check\_mark-](/user/data/smileys/emoji/white_check_mark.png "-white_check_mark-") | Information about the shopper's browser. | | [channel](https://docs.adyen.com/api-explorer/Checkout/latest/post/payments#request-channel) | ![-white\_check\_mark-](/user/data/smileys/emoji/white_check_mark.png "-white_check_mark-") | Set to the applicable channel, for example **Web**, **Android**, **iOS**. | **Example payment request for GoPay** #### curl ```bash curl https://checkout-test.adyen.com/v72/payments \ -H 'x-API-key: ADYEN_API_KEY' \ -H 'idempotency-key: YOUR_IDEMPOTENCY_KEY' \ -H 'content-type: application/json' \ -X POST -d '{ "amount":{ "currency":"IDR", "value":1000 }, "paymentMethod":{ "type":"gopay_wallet" }, "reference":"YOUR_ORDER_NUMBER", "returnUrl":"https://your-company.com/checkout?shopperOrder=12xy..", "merchantAccount":"ADYEN_MERCHANT_ACCOUNT", "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":"en-ID", "colorDepth":24, "screenHeight":723, "screenWidth":1536, "timeZoneOffset":0, "javaEnabled":false }", "channel":"web" }' ``` #### Java ```java // Adyen Java API Library v38.0.0 to latest import com.adyen.Client; import com.adyen.Config; import com.adyen.enums.Environment; import com.adyen.model.*; import com.adyen.service.*; import java.math.*; import com.adyen.model.checkout.*; import java.time.OffsetDateTime; import java.util.*; import com.adyen.model.RequestOptions; import com.adyen.service.checkout.*; Config config = new Config() .apiKey("ADYEN_API_KEY") .environment(Environment.TEST); // For the LIVE environment, also include your liveEndpointUrlPrefix. Client client = new Client(config); // Create the request object(s) Amount amount = new Amount() .currency("IDR") .value(1000L); StoredPaymentMethodDetails storedPaymentMethodDetails = new StoredPaymentMethodDetails() .type(StoredPaymentMethodDetails.TypeEnum.GOPAY_WALLET); 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(false) .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("en-ID") .colorDepth(24); PaymentRequest paymentRequest = new PaymentRequest() .reference("YOUR_ORDER_NUMBER") .amount(amount) .merchantAccount("ADYEN_MERCHANT_ACCOUNT") .channel(PaymentRequest.ChannelEnum.WEB) .paymentMethod(new CheckoutPaymentMethod(storedPaymentMethodDetails)) .returnUrl("https://your-company.com/checkout?shopperOrder=12xy..") .browserInfo(browserInfo); // 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("IDR") ->setValue(1000); $checkoutPaymentMethod = new CheckoutPaymentMethod(); $checkoutPaymentMethod ->setType("gopay_wallet"); $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(false) ->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("en-ID") ->setColorDepth(24); $paymentRequest = new PaymentRequest(); $paymentRequest ->setReference("YOUR_ORDER_NUMBER") ->setAmount($amount) ->setMerchantAccount("ADYEN_MERCHANT_ACCOUNT") ->setChannel("web") ->setPaymentMethod($checkoutPaymentMethod) ->setReturnUrl("https://your-company.com/checkout?shopperOrder=12xy..") ->setBrowserInfo($browserInfo); $requestOptions['idempotencyKey'] = 'UUID'; // Send the request $service = new PaymentsApi($client); $response = $service->payments($paymentRequest, $requestOptions); ``` #### C\# ```cs // Adyen .NET API Library v34.0.0 to latest using System; using Adyen.Checkout.Extensions; using Adyen.Checkout.Models; using Adyen.Checkout.Services; using Adyen.Core.Client; using Adyen.Core.Client.Extensions; using Adyen.Core.Options; using Microsoft.Extensions.DependencyInjection; using Microsoft.Extensions.Hosting; var host = Host.CreateDefaultBuilder() .ConfigureCheckout( (context, services, config) => { config.ConfigureAdyenOptions(options => { options.AdyenApiKey = "ADYEN_API_KEY"; options.Environment = AdyenEnvironment.Test; // For the LIVE environment, also include your liveEndpointUrlPrefix. // options.LiveEndpointUrlPrefix = ""; }); services.AddAllCheckoutServices(); }) .Build(); var paymentsService = host.Services.GetRequiredService(); // Create the request object(s) var amount = new Amount { Currency = "IDR", Value = 1000 }; var storedPaymentMethodDetails = new StoredPaymentMethodDetails { Type = StoredPaymentMethodDetails.TypeEnum.GopayWallet }; var browserInfo = new BrowserInfo { AcceptHeader = "text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,image/apng,*/*;q=0.8", ScreenWidth = 1536, JavaEnabled = false, 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 = "en-ID", ColorDepth = 24 }; var paymentRequest = new PaymentRequest { Reference = "YOUR_ORDER_NUMBER", Amount = amount, MerchantAccount = "ADYEN_MERCHANT_ACCOUNT", Channel = PaymentRequest.ChannelEnum.Web, PaymentMethod = new CheckoutPaymentMethod(storedPaymentMethodDetails), ReturnUrl = "https://your-company.com/checkout?shopperOrder=12xy..", BrowserInfo = browserInfo }; string idempotencyKey = Guid.NewGuid().ToString(); // Send the request var result = await paymentsService.PaymentsAsync(paymentRequest, new RequestOptions().AddIdempotencyKey(idempotencyKey)); if (result.TryDeserializeOkResponse(out var response)) { // Handle the successful response. } ``` #### NodeJS (JavaScript) ```js // Adyen Node API Library v30.0.0 to latest const { Client, Config, EnvironmentEnum, 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 amount = { currency: "IDR", value: 1000 }; const storedPaymentMethodDetails = { type: "gopay_wallet" }; const browserInfo = { acceptHeader: "text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,image/apng,*/*;q=0.8", screenWidth: 1536, javaEnabled: false, 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: "en-ID", colorDepth: 24 }; const paymentRequest = { reference: "YOUR_ORDER_NUMBER", amount: amount, merchantAccount: "ADYEN_MERCHANT_ACCOUNT", channel: "web", paymentMethod: storedPaymentMethodDetails, returnUrl: "https://your-company.com/checkout?shopperOrder=12xy..", browserInfo: browserInfo }; // Send the request const checkoutAPI = new CheckoutAPI(client); const response = await checkoutAPI.PaymentsApi.payments(paymentRequest, { idempotencyKey: "UUID" }); ``` #### Go ```go // Adyen Go API Library v21.0.0 to latest 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: "IDR", Value: 1000, } storedPaymentMethodDetails := checkout.StoredPaymentMethodDetails{ Type: common.PtrString("gopay_wallet"), } browserInfo := checkout.BrowserInfo{ AcceptHeader: "text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,image/apng,*/*;q=0.8", ScreenWidth: 1536, JavaEnabled: false, 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: "en-ID", ColorDepth: 24, } paymentRequest := checkout.PaymentRequest{ Reference: "YOUR_ORDER_NUMBER", Amount: amount, MerchantAccount: "ADYEN_MERCHANT_ACCOUNT", Channel: common.PtrString("web"), PaymentMethod: checkout.StoredPaymentMethodDetailsAsCheckoutPaymentMethod(&storedPaymentMethodDetails), ReturnUrl: "https://your-company.com/checkout?shopperOrder=12xy..", BrowserInfo: &browserInfo, } // 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 v14.0.0 to latest 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": { "currency": "IDR", "value": 1000 }, "paymentMethod": { "type": "gopay_wallet" }, "reference": "YOUR_ORDER_NUMBER", "returnUrl": "https://your-company.com/checkout?shopperOrder=12xy..", "merchantAccount": "ADYEN_MERCHANT_ACCOUNT", "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": "en-ID", "colorDepth": 24, "screenHeight": 723, "screenWidth": 1536, "timeZoneOffset": 0, "javaEnabled": False }, "channel": "web" } # Send the request result = adyen.checkout.payments_api.payments(request=json_request, idempotency_key="UUID") ``` #### Ruby ```rb # Adyen Ruby API Library v11.0.0 to latest 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" => { "currency" => "IDR", "value" => 1000 }, "paymentMethod" => { "type" => "gopay_wallet" }, "reference" => "YOUR_ORDER_NUMBER", "returnUrl" => "https://your-company.com/checkout?shopperOrder=12xy..", "merchantAccount" => "ADYEN_MERCHANT_ACCOUNT", "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" => "en-ID", "colorDepth" => 24, "screenHeight" => 723, "screenWidth" => 1536, "timeZoneOffset" => 0, "javaEnabled" => false }, "channel" => "web" } # Send the request result = adyen.checkout.payments_api.payments(request_body, headers: { 'Idempotency-Key' => 'UUID' }) ``` #### NodeJS (TypeScript) ```ts // Adyen Node API Library v30.0.0 to latest import { Client, Config, EnvironmentEnum, 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: "IDR", value: 1000 }; const storedPaymentMethodDetails: Types.checkout.StoredPaymentMethodDetails = { type: Types.checkout.StoredPaymentMethodDetails.TypeEnum.GopayWallet }; 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: false, 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: "en-ID", colorDepth: 24 }; const paymentRequest: Types.checkout.PaymentRequest = { reference: "YOUR_ORDER_NUMBER", amount: amount, merchantAccount: "ADYEN_MERCHANT_ACCOUNT", channel: Types.checkout.PaymentRequest.ChannelEnum.Web, paymentMethod: storedPaymentMethodDetails, returnUrl: "https://your-company.com/checkout?shopperOrder=12xy..", browserInfo: browserInfo }; // Send the request const checkoutAPI = new CheckoutAPI(client); const response = await checkoutAPI.PaymentsApi.payments(paymentRequest, { idempotencyKey: "UUID" }); ``` The response includes the `action.type`: **redirect**. **Example response with an additional action** ```json { "resultCode":"RedirectShopper", "action":{ "paymentMethodType":"gopay_wallet", "method":"GET", "url":"https://checkoutshopper-test.adyen.com/checkoutshopper/checkoutPaymentRedirect?redirectData=...", "type":"redirect" } } ``` ### Recurring ## Recurring payments GoPay supports recurring payments. The first time your shopper makes a payment, you need to [create a token](https://docs.adyen.com/payment-methods/gopay/react-native-drop-in#create-a-token), which you can use later to make `Subscription` or `CardOnFile` payments. Note that the flows for `Subscription` and `CardOnFile` payments are different. ### Create a token To create a token, include in your [/payments](https://docs.adyen.com/api-explorer/Checkout/latest/post/payments) request: * `storePaymentMethod`: **true** * [shopperReference](https://docs.adyen.com/api-explorer/Checkout/latest/post/payments#request-shopperReference): Your unique identifier for the shopper (minimum length three characters). * [recurringProcessingModel](https://docs.adyen.com/api-explorer/Checkout/latest/post/payments#request-recurringProcessingModel): The recurring payment type. When the payment has been settled, you receive a [recurring.token.created](https://docs.adyen.com/api-explorer/Tokenization-webhooks/latest/post/recurring.token.created) [webhook](https://docs.adyen.com/development-resources/webhooks) containing: * `type`: **recurring.token.created** * `shopperReference`: your unique identifier for the shopper. * `eventId`: the `pspReference` of the initial payment. * `storedPaymentMethodId`: the token that you need to make recurring payments for this shopper. Make sure that your server is able to receive the [Recurring tokens life cycle events](https://docs.adyen.com/development-resources/webhooks/webhook-types/#other-webhooks) webhook. You can [set up this webhook in your Customer Area](https://docs.adyen.com/development-resources/webhooks/#set-up-webhooks-in-your-customer-area). ### Make a Subscription payment with a token To make a recurring `Subscription` payment with a token, make a [/payments](https://docs.adyen.com/api-explorer/Checkout/latest/post/payments) request and include: * `paymentMethod.storedPaymentMethodId`: the `storedPaymentMethodId` from the [recurring.token.created](https://docs.adyen.com/api-explorer/Tokenization-webhooks/latest/post/recurring.token.created) webhook. You can also get this value using the [/listRecurringDetails](https://docs.adyen.com/api-explorer/Recurring/latest/post/listRecurringDetails) endpoint. * `shopperReference`: your unique identifier for the shopper. * `shopperInteraction`: **ContAuth** * `recurringProcessingModel`: **Subscription** #### Latest version ##### curl ```bash curl https://checkout-test.adyen.com/v68/payments \ -H 'x-api-key: ADYEN_API_KEY' \ -H 'content-type: application/json' \ -d '{ "amount":{ "value":10000, "currency":"" }, "paymentMethod":{ "type":"", "storedPaymentMethodId":"7219687191761347" }, "reference":"YOUR_ORDER_NUMBER", "merchantAccount":"YOUR_MERCHANT_ACCOUNT", "shopperReference":"YOUR_UNIQUE_SHOPPER_ID", "shopperInteraction":"ContAuth", "recurringProcessingModel": "Subscription", "returnUrl": "" }' ``` ##### Java ```java // Adyen Java API Library v38.0.0 to latest import com.adyen.Client; import com.adyen.Config; import com.adyen.enums.Environment; import com.adyen.model.*; import com.adyen.service.*; import java.math.*; import com.adyen.model.checkout.*; import java.time.OffsetDateTime; import java.util.*; import com.adyen.model.RequestOptions; import com.adyen.service.checkout.*; Config config = new Config() .apiKey("ADYEN_API_KEY") .environment(Environment.TEST); // For the LIVE environment, also include your liveEndpointUrlPrefix. Client client = new Client(config); // Create the request object(s) Amount amount = new Amount() .currency("String") .value(10000L); AchDetails achDetails = new AchDetails() .storedPaymentMethodId("7219687191761347") .type(AchDetails.TypeEnum.ACH); PaymentRequest paymentRequest = new PaymentRequest() .reference("YOUR_ORDER_NUMBER") .amount(amount) .merchantAccount("YOUR_MERCHANT_ACCOUNT") .recurringProcessingModel(PaymentRequest.RecurringProcessingModelEnum.SUBSCRIPTION) .paymentMethod(new CheckoutPaymentMethod(achDetails)) .shopperInteraction(PaymentRequest.ShopperInteractionEnum.CONTAUTH) .returnUrl("String") .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("") ->setValue(10000); $checkoutPaymentMethod = new CheckoutPaymentMethod(); $checkoutPaymentMethod ->setStoredPaymentMethodId("7219687191761347") ->setType(""); $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 v34.0.0 to latest using System; using Adyen.Checkout.Extensions; using Adyen.Checkout.Models; using Adyen.Checkout.Services; using Adyen.Core.Client; using Adyen.Core.Client.Extensions; using Adyen.Core.Options; using Microsoft.Extensions.DependencyInjection; using Microsoft.Extensions.Hosting; var host = Host.CreateDefaultBuilder() .ConfigureCheckout( (context, services, config) => { config.ConfigureAdyenOptions(options => { options.AdyenApiKey = "ADYEN_API_KEY"; options.Environment = AdyenEnvironment.Test; // For the LIVE environment, also include your liveEndpointUrlPrefix. // options.LiveEndpointUrlPrefix = ""; }); services.AddAllCheckoutServices(); }) .Build(); var paymentsService = host.Services.GetRequiredService(); // Create the request object(s) var amount = new Amount { Currency = "", Value = 10000 }; var achDetails = new AchDetails { StoredPaymentMethodId = "7219687191761347", Type = AchDetails.TypeEnum. }; var paymentRequest = new PaymentRequest { Reference = "YOUR_ORDER_NUMBER", Amount = amount, MerchantAccount = "YOUR_MERCHANT_ACCOUNT", RecurringProcessingModel = PaymentRequest.RecurringProcessingModelEnum.Subscription, PaymentMethod = new CheckoutPaymentMethod(achDetails), ShopperInteraction = PaymentRequest.ShopperInteractionEnum.ContAuth, ReturnUrl = "", ShopperReference = "YOUR_UNIQUE_SHOPPER_ID" }; string idempotencyKey = Guid.NewGuid().ToString(); // Send the request var result = await paymentsService.PaymentsAsync(paymentRequest, new RequestOptions().AddIdempotencyKey(idempotencyKey)); if (result.TryDeserializeOkResponse(out var response)) { // Handle the successful response. } ``` ##### NodeJS (JavaScript) ```js // Adyen Node API Library v30.0.0 to latest const { Client, Config, EnvironmentEnum, 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 amount = { currency: "", value: 10000 }; const achDetails = { storedPaymentMethodId: "7219687191761347", type: "" }; const paymentRequest = { reference: "YOUR_ORDER_NUMBER", amount: amount, merchantAccount: "YOUR_MERCHANT_ACCOUNT", recurringProcessingModel: "Subscription", paymentMethod: achDetails, shopperInteraction: "ContAuth", returnUrl: "", shopperReference: "YOUR_UNIQUE_SHOPPER_ID" }; // Send the request const checkoutAPI = new CheckoutAPI(client); const response = await checkoutAPI.PaymentsApi.payments(paymentRequest, { idempotencyKey: "UUID" }); ``` ##### Go ```go // Adyen Go API Library v21.0.0 to latest 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: "", Value: 10000, } achDetails := checkout.AchDetails{ StoredPaymentMethodId: common.PtrString("7219687191761347"), Type: common.PtrString(""), } paymentRequest := checkout.PaymentRequest{ Reference: "YOUR_ORDER_NUMBER", Amount: amount, MerchantAccount: "YOUR_MERCHANT_ACCOUNT", RecurringProcessingModel: common.PtrString("Subscription"), PaymentMethod: checkout.AchDetailsAsCheckoutPaymentMethod(&achDetails), 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 v14.0.0 to latest 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": 10000, "currency": "" }, "paymentMethod": { "type": "", "storedPaymentMethodId": "7219687191761347" }, "reference": "YOUR_ORDER_NUMBER", "merchantAccount": "YOUR_MERCHANT_ACCOUNT", "shopperReference": "YOUR_UNIQUE_SHOPPER_ID", "shopperInteraction": "ContAuth", "recurringProcessingModel": "Subscription", "returnUrl": "" } # Send the request result = adyen.checkout.payments_api.payments(request=json_request, idempotency_key="UUID") ``` ##### Ruby ```rb # Adyen Ruby API Library v11.0.0 to latest 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" => 10000, "currency" => "" }, "paymentMethod" => { "type" => "", "storedPaymentMethodId" => "7219687191761347" }, "reference" => "YOUR_ORDER_NUMBER", "merchantAccount" => "YOUR_MERCHANT_ACCOUNT", "shopperReference" => "YOUR_UNIQUE_SHOPPER_ID", "shopperInteraction" => "ContAuth", "recurringProcessingModel" => "Subscription", "returnUrl" => "" } # Send the request result = adyen.checkout.payments_api.payments(request_body, headers: { 'Idempotency-Key' => 'UUID' }) ``` ##### NodeJS (TypeScript) ```ts // Adyen Node API Library v30.0.0 to latest import { Client, Config, EnvironmentEnum, 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: "", value: 10000 }; const achDetails = { storedPaymentMethodId: "7219687191761347", type: "" } as unknown as Types.checkout.AchDetails; const paymentRequest: Types.checkout.PaymentRequest = { reference: "YOUR_ORDER_NUMBER", amount: amount, merchantAccount: "YOUR_MERCHANT_ACCOUNT", recurringProcessingModel: Types.checkout.PaymentRequest.RecurringProcessingModelEnum.Subscription, paymentMethod: achDetails, shopperInteraction: Types.checkout.PaymentRequest.ShopperInteractionEnum.ContAuth, returnUrl: "", shopperReference: "YOUR_UNIQUE_SHOPPER_ID" }; // Send the request const checkoutAPI = new CheckoutAPI(client); const response = await checkoutAPI.PaymentsApi.payments(paymentRequest, { idempotencyKey: "UUID" }); ``` #### Earlier versions ##### curl ```bash curl https://checkout-test.adyen.com/v68/payments \ -H 'x-api-key: ADYEN_API_KEY' \ -H 'content-type: application/json' \ -d '{ "amount":{ "value":10000, "currency":"" }, "paymentMethod":{ "type":"", "storedPaymentMethodId":"7219687191761347" }, "reference":"YOUR_ORDER_NUMBER", "merchantAccount":"YOUR_MERCHANT_ACCOUNT", "shopperReference":"YOUR_UNIQUE_SHOPPER_ID", "shopperInteraction":"ContAuth", "recurringProcessingModel": "Subscription", "returnUrl": "" }' ``` ##### NodeJS (JavaScript) ```js // Adyen Node API Library v16.1.0 to v27.0.0 // Require the parts of the module you want to use const { Client, CheckoutAPI } = require('@adyen/api-library'); // Initialize the client object const client = new Client({apiKey: "YOUR_X_API_KEY", environment: "TEST"}); // Create the request object const paymentRequest = { amount: { value: 10000, currency: "" }, paymentMethod: { type: "", storedPaymentMethodId: "7219687191761347" }, reference: "YOUR_ORDER_NUMBER", merchantAccount: "YOUR_MERCHANT_ACCOUNT", shopperReference: "YOUR_UNIQUE_SHOPPER_ID", shopperInteraction: "ContAuth", recurringProcessingModel: "Subscription", returnUrl: "" } // Make the request const checkoutAPI = new CheckoutAPI(client); const response = checkoutAPI.PaymentsApi.payments(paymentRequest, { idempotencyKey: "UUID" }); ``` ##### Python ```py # Adyen Python API Library v12.0.0 import Adyen adyen = Adyen.Adyen() adyen.client.xapikey = "YOUR_X_API_KEY" adyen.client.platform = "test" # The environment to use library in. json_request = { "amount": { "value": 10000, "currency": "" }, "paymentMethod": { "type": "", "storedPaymentMethodId": "7219687191761347" }, "reference": "YOUR_ORDER_NUMBER", "merchantAccount": "YOUR_MERCHANT_ACCOUNT", "shopperReference": "YOUR_UNIQUE_SHOPPER_ID", "shopperInteraction": "ContAuth", "recurringProcessingModel": "Subscription", "returnUrl": "" } result = adyen.checkout.payments_api.payments(request=json_request, idempotency_key="UUID") ``` ##### Ruby ```rb # Adyen Ruby API Library v9.1.0 require "adyen-ruby-api-library" adyen = Adyen::Client.new adyen.api_key = 'YOUR_X_API_KEY' adyen.env = :test # Set to "live" for live environment request_body = { :amount => { :value => 10000, :currency => '' }, :paymentMethod => { :type => '', :storedPaymentMethodId => '7219687191761347' }, :reference => 'YOUR_ORDER_NUMBER', :merchantAccount => 'YOUR_MERCHANT_ACCOUNT', :shopperReference => 'YOUR_UNIQUE_SHOPPER_ID', :shopperInteraction => 'ContAuth', :recurringProcessingModel => 'Subscription', :returnUrl => '' } result = adyen.checkout.payments_api.payments(request_body, headers: { 'Idempotency-Key' => 'UUID' }) ``` The [/payments](https://docs.adyen.com/api-explorer/Checkout/latest/post/payments) response contains:\ `resultCode`: Use this to show your shopper the payment result. When the payment is processed, you receive the final status of the payment in a [webhook](https://docs.adyen.com/development-resources/webhooks) containing: * `eventCode`: **AUTHORISATION** * `success`: **true** ### Make a recurring CardOnFile payment with a token Recurring `CardOnFile` payments with GoPay go through a challenge flow to reduce the likelihood of fraudulent transactions. You must redirect the shopper to GoPay so they can enter their PIN.\ To make a recurring `CardOnFile` payment with a token, make a [/payments](https://docs.adyen.com/api-explorer/Checkout/latest/post/payments) request and include: * `paymentMethod.storedPaymentMethodId`: The shopper's payment token. You can also get this value using the [/listRecurringDetails](https://docs.adyen.com/api-explorer/Recurring/latest/post/listRecurringDetails) endpoint. * `shopperReference`: Your unique identifier for the shopper. * `shopperInteraction`: **ContAuth** * `recurringProcessingModel`: **CardOnFile** The [/payments](https://docs.adyen.com/api-explorer/Checkout/latest/post/payments) response contains: `resultCode`: **RedirectShopper**\ `action`: Contains the `url` to redirect the shopper to. When the shopper is redirected back to your page, call [/payments/details](https://docs.adyen.com/api-explorer/Checkout/latest/post/payments/details) with the `redirectResult` to complete the flow and get the status of the payment. When the payment is processed, you receive a [webhook](https://docs.adyen.com/development-resources/webhooks) containing the final status of the payment: * `eventCode`: **AUTHORISATION** * `success`: **true** ## Test and go live You can test your GoPay integration in two ways: with the Adyen Payment Simulator, or directly with GoPay. ### Test with Adyen Use the Adyen Payment Simulator to verify that your GoPay integration works correctly with Adyen. You can test during development, before you go live, and after launch. The simulator does not recreate the shopper's journey through the GoPay app or website. This testing option is available by default when you add GoPay in your test Customer Area. The payment method type is `gopay_wallet`. To test a redirect payment: 1. Start a payment as usual in your integration. The shopper is redirected to an Adyen-hosted simulator page. 2. Select the payment outcome that you want to test. 3. Wait for the simulator to return the shopper to your website, then complete the payment as usual. For an Advanced flow, make a `/payments/details` request. 4. Confirm that your integration handles the outcome that you selected, and that the payment appears in your [Customer Area](https://ca-test.adyen.com/) > **Payments** > **Payment list**. ### Test directly with GoPay To test directly with GoPay, contact our [Support Team](https://ca-test.adyen.com/ca/ca/contactUs/support.shtml?form=other). For more information about direct GoPay testing, see the [GoPay knowledge base](https://www.gopay.com/en/integration/). Before you can accept live GoPay payments, you need to submit a request for GoPay in your [live Customer Area](https://ca-live.adyen.com/).