--- title: "GoPay Android Component" description: "Add GoPay to your Components integration." url: "https://docs.adyen.com/payment-methods/gopay/android-component" source_url: "https://docs.adyen.com/payment-methods/gopay/android-component.md" canonical: "https://docs.adyen.com/payment-methods/gopay/android-component" last_modified: "2026-05-23T12:56:20+02:00" language: "en" --- # GoPay Android Component Add GoPay to your Components integration. [View source](/payment-methods/gopay/android-component.md) 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](/online-payments/build-your-integration) that your integration uses: ## Sessions flow Component ### Before-You-Begin ## Requirements | Requirement | Description | | | --------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | - | | **Integration type** | Make sure that you have an existing Sessions flow [Android Components integration](/online-payments/build-your-integration/sessions-flow?platform=Android). | | | **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](/online-payments/build-your-integration/sessions-flow?platform=Android\&integration=Components#handle-the-redirect). `action.type`: **redirect** | | | **Setup steps** | Before you begin, [add GoPay in your Customer Area](/payment-methods/add-payment-methods). | | ### Add-Parameters-Sessions-Request ## Add additional parameters to your /sessions request When you [create a payment session](/online-payments/build-your-integration/sessions-flow?platform=Android\&integration=Components#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** ```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": "Android" }' ``` ### Import-Component ## Import the Component for GoPay To [import the library](/online-payments/build-your-integration/sessions-flow?platform=Android\&integration=Components#import) and include the module for GoPay. ### Tab: With Jetpack Compose **Import the module with Compose** ```java implementation "com.adyen.checkout:instant:YOUR_VERSION" implementation "com.adyen.checkout:components-compose:YOUR_VERSION" ``` ### Tab: Without Jetpack Compose **Import the module without Compose** ```java implementation "com.adyen.checkout:instant:YOUR_VERSION" ``` ### Add-Configuration ## Add additional configuration for GoPay [Add a configuration object](/online-payments/build-your-integration/sessions-flow?platform=Android\&integration=Components#3-optional-add-a-configuration-object) with the following parameters: | Parameter | Required | Description | | ---------------------- | -------- | -------------------------------------------------------------------- | | setSubmitButtonVisible | | Set to **false** to hide the submit button. The default is **true**. | **Add a configuration object** ```kotlin { .setSubmitButtonVisible(value) } ``` ### Launch-And-Show ## Launch and show the Component for GoPay To [create the Component](/online-payments/build-your-integration/sessions-flow?platform=Android\&integration=Components#launch-and-show) for GoPay, use the `InstantPaymentComponent` class. ### Tab: With Jetpack Compose **Launch and show the Component** ```kotlin import com.adyen.checkout.components.compose.get // Get the payment method. val paymentMethod = checkoutSession.getPaymentMethod(PaymentMethodTypes.SCHEME) @Composable private fun ComposableInstantPaymentComponent() { // Keep a reference to this Component in case you need to access it later. val instantComponent = InstantPaymentComponent.PROVIDER.get( checkoutSession = checkoutSession, paymentMethod = paymentMethod, configuration = checkoutConfiguration, componentCallback = callback, // This key is required to ensure a new Component gets created for each different screen or payment session. // Generate a new value for this key every time you need to reset the Component. key = "YOUR_UNIQUE_KEY_FOR_THIS_COMPONENT", ) // This is your composable, a wrapper around our xml view. AdyenComponent( component = instantComponent, modifier = YOUR_MODIFIER, ) } ``` ### Tab: Without Jetpack Compose ```kotlin // Get the payment method. val paymentMethod = checkoutSession.getPaymentMethod(PaymentMethodTypes.SCHEME) val instantComponent = InstantPaymentComponent.PROVIDER.get( activity, // Your activity or fragment. checkoutSession, paymentMethod, checkoutConfiguration, componentCallback ) // Attach the Component to your view. binding.instantView.attach(instantComponent, activity) // Your activity or fragment. ``` ### Recurring ## Recurring payments GoPay supports recurring payments. The first time your shopper makes a payment, you need to [create a token](#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](/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](/development-resources/webhooks/webhook-types/#other-webhooks) webhook. You can [set up this webhook in your Customer Area](/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** #### 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 // Set ADYEN_API_KEY with the API key from the Customer Area. // Change to Environment.LIVE and add the Live URL prefix when you are ready to accept live payments. Client client = new Client("ADYEN_API_KEY", Environment.TEST); Checkout checkout = new Checkout(client); PaymentsRequest paymentsRequest = new PaymentsRequest(); String merchantAccount = "YOUR_MERCHANT_ACCOUNT"; paymentsRequest.setMerchantAccount(merchantAccount); Amount amount = new Amount(); amount.setCurrency(""); amount.setValue(10000); paymentsRequest.setAmount(amount); DefaultPaymentMethodDetails paymentMethodDetails = new DefaultPaymentMethodDetails(); paymentMethodDetails.storedPaymentMethodId("7219687191761347"); paymentMethodDetails.setType(""); paymentsRequest.setPaymentMethod(paymentMethodDetails); paymentsRequest.setReference("YOUR_ORDER_NUMBER"); paymentsRequest.setReturnUrl(""); paymentsRequest.setShopperReference("YOUR_UNIQUE_SHOPPER_ID"); paymentsRequest.setShopperInteraction("ContAuth"); paymentsRequest.setRecurringProcessingModel("Subscription"); PaymentsResponse paymentsResponse = checkout.payments(paymentsRequest); ``` #### PHP ```php // Set your X-API-KEY with the API key from the Customer Area. $client = new \Adyen\Client(); $client->setXApiKey("ADYEN_API_KEY"); $service = new \Adyen\Service\Checkout($client); $params = array( "amount" => array( "currency" => "", "value" => 10000 ), "reference" => "YOUR_ORDER_NUMBER", "paymentMethod" => array( "type" => "", "storedPaymentMethodId" => "7219687191761347" ), "returnUrl" => "", "shopperReference" => "YOUR_UNIQUE_SHOPPER_ID", "recurringProcessingModel" => "Subscription", "shopperInteraction" => "ContAuth", "merchantAccount" => "YOUR_MERCHANT_ACCOUNT" ); $result = $service->payments($params); ``` #### C\# ```cs // Set your X-API-KEY with the API key from the Customer Area. var client = new Client ("ADYEN_API_KEY", Environment.Test); var checkout = new Checkout(client); var amount = new Adyen.Model.Checkout.Amount("", 10000); var details = new Adyen.Model.Checkout.DefaultPaymentMethodDetails{ Type = "", StoredPaymentMethodId = "7219687191761347" }; var paymentsRequest = new Adyen.Model.Checkout.PaymentRequest { Reference = "YOUR_ORDER_NUMBER", Amount = amount, ReturnUrl = @"", MerchantAccount = "YOUR_MERCHANT_ACCOUNT", ShopperReference = "YOUR_UNIQUE_SHOPPER_ID", RecurringProcessingModel = Adyen.Model.Checkout.PaymentRequest.RecurringProcessingModelEnum.Subscription, ShopperInteraction = Adyen.Model.Checkout.PaymentRequest.ShopperInteractionEnum.ContAuth, PaymentMethod = details }; var paymentResponse = checkout.Payments(paymentsRequest); ``` #### NodeJS (JavaScript) ```js // Adyen Node API Library v16.1.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](/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/#/CheckoutService/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](/development-resources/webhooks) containing the final status of the payment: * `eventCode`: **AUTHORISATION** * `success`: **true** ## Test and go live When you want to test GoPay, contact our [Support Team](https://ca-test.adyen.com/ca/ca/contactUs/support.shtml?form=other). Refer to GoPay's [knowledge base](https://www.gopay.com/en/integration/) for more information about testing GoPay payments. 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 Component ## Requirements | Requirement | Description | | | -------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | - | | **Integration type** | Make sure that you have an existing Advanced flow [Android Components integration](/online-payments/build-your-integration/advanced-flow?platform=Android). | | | **Action handling** | Make sure that your existing integration is set up to [handle the additional action](/online-payments/build-your-integration/advanced-flow/?platform=Android\&integration=Components#additional-action). `action.type`: redirect. | | | **Setup steps** | Before you begin, [add GoPay in your Customer Area](/payment-methods/add-payment-methods). | | ### Import ## Import the Component for GoPay To [import the library](/online-payments/build-your-integration/advanced-flow/?platform=Android\&integration=Components#import) and include the module for GoPay. ### Tab: With Jetpack Compose **Import the module with Compose** ```java implementation "com.adyen.checkout:instant:YOUR_VERSION" implementation "com.adyen.checkout:components-compose:YOUR_VERSION" ``` ### Tab: Without Jetpack Compose **Import the module without Compose** ```java implementation "com.adyen.checkout:instant:YOUR_VERSION" ``` ### Add Configuration ## Add additional configuration for GoPay [Add a configuration object](/online-payments/build-your-integration/advanced-flow/?platform=Android\&integration=Components#3-optional-add-a-configuration-object) with the following parameters: | Parameter | Required | Description | | ---------------------- | -------- | -------------------------------------------------------------------- | | setSubmitButtonVisible | | Set to **false** to hide the submit button. The default is **true**. | **Add a configuration object** ```kotlin { .setSubmitButtonVisible(value) } ``` ### Launch And Show ## Launch and show the Component for GoPay To [create the Component](/online-payments/build-your-integration/advanced-flow/?platform=Android\&integration=Components#launch-and-show) for GoPay, use the `InstantPaymentComponent` class. ### Tab: With Jetpack Compose **Launch and show the Component** ```kotlin import com.adyen.checkout.components.compose.get // Create the payment method object from the /paymentMethods response. val paymentMethod = paymentMethodsApiResponse?.paymentMethods.orEmpty().firstOrNull { it.type == PaymentMethodTypes.SCHEME } @Composable private fun ComposableInstantPaymentComponent() { // Keep a reference to this Component in case you need to access it later. val instantComponent = InstantPaymentComponent.PROVIDER.get( paymentMethod = paymentMethod, configuration = checkoutConfiguration, componentCallback = callback, // This key is required to ensure a new Component gets created for each different screen or payment session. // Generate a new value for this key every time you need to reset the Component. key = "UNIQUE_KEY_PER_COMPONENT", ) // This is your composable, a wrapper around our xml view. AdyenComponent( component = instantComponent, modifier = YOUR_MODIFIER, ) } ``` ### Tab: Without Jetpack Compose ```kotlin // Create the payment method object from the /paymentMethods response. val paymentMethod = paymentMethodsApiResponse?.paymentMethods.orEmpty().firstOrNull { it.type == PaymentMethodTypes.SCHEME } val instantComponent = InstantPaymentComponent.PROVIDER.get( activity, // Your activity or fragment. paymentMethod, checkoutConfiguration, componentCallback, ) //Attach the Component to your view. binding.instantView.attach(instantComponent, activity) // Your activity or fragment. ``` ### Add Parameters Payments Request ## Add additional parameters to your /payments request When you [make a payment](/online-payments/build-your-integration/advanced-flow/?platform=Android\&integration=Components#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** ```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" }' ``` 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](#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](/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](/development-resources/webhooks/webhook-types/#other-webhooks) webhook. You can [set up this webhook in your Customer Area](/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** #### 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 // Set ADYEN_API_KEY with the API key from the Customer Area. // Change to Environment.LIVE and add the Live URL prefix when you are ready to accept live payments. Client client = new Client("ADYEN_API_KEY", Environment.TEST); Checkout checkout = new Checkout(client); PaymentsRequest paymentsRequest = new PaymentsRequest(); String merchantAccount = "YOUR_MERCHANT_ACCOUNT"; paymentsRequest.setMerchantAccount(merchantAccount); Amount amount = new Amount(); amount.setCurrency(""); amount.setValue(10000); paymentsRequest.setAmount(amount); DefaultPaymentMethodDetails paymentMethodDetails = new DefaultPaymentMethodDetails(); paymentMethodDetails.storedPaymentMethodId("7219687191761347"); paymentMethodDetails.setType(""); paymentsRequest.setPaymentMethod(paymentMethodDetails); paymentsRequest.setReference("YOUR_ORDER_NUMBER"); paymentsRequest.setReturnUrl(""); paymentsRequest.setShopperReference("YOUR_UNIQUE_SHOPPER_ID"); paymentsRequest.setShopperInteraction("ContAuth"); paymentsRequest.setRecurringProcessingModel("Subscription"); PaymentsResponse paymentsResponse = checkout.payments(paymentsRequest); ``` #### PHP ```php // Set your X-API-KEY with the API key from the Customer Area. $client = new \Adyen\Client(); $client->setXApiKey("ADYEN_API_KEY"); $service = new \Adyen\Service\Checkout($client); $params = array( "amount" => array( "currency" => "", "value" => 10000 ), "reference" => "YOUR_ORDER_NUMBER", "paymentMethod" => array( "type" => "", "storedPaymentMethodId" => "7219687191761347" ), "returnUrl" => "", "shopperReference" => "YOUR_UNIQUE_SHOPPER_ID", "recurringProcessingModel" => "Subscription", "shopperInteraction" => "ContAuth", "merchantAccount" => "YOUR_MERCHANT_ACCOUNT" ); $result = $service->payments($params); ``` #### C\# ```cs // Set your X-API-KEY with the API key from the Customer Area. var client = new Client ("ADYEN_API_KEY", Environment.Test); var checkout = new Checkout(client); var amount = new Adyen.Model.Checkout.Amount("", 10000); var details = new Adyen.Model.Checkout.DefaultPaymentMethodDetails{ Type = "", StoredPaymentMethodId = "7219687191761347" }; var paymentsRequest = new Adyen.Model.Checkout.PaymentRequest { Reference = "YOUR_ORDER_NUMBER", Amount = amount, ReturnUrl = @"", MerchantAccount = "YOUR_MERCHANT_ACCOUNT", ShopperReference = "YOUR_UNIQUE_SHOPPER_ID", RecurringProcessingModel = Adyen.Model.Checkout.PaymentRequest.RecurringProcessingModelEnum.Subscription, ShopperInteraction = Adyen.Model.Checkout.PaymentRequest.ShopperInteractionEnum.ContAuth, PaymentMethod = details }; var paymentResponse = checkout.Payments(paymentsRequest); ``` #### NodeJS (JavaScript) ```js // Adyen Node API Library v16.1.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](/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/#/CheckoutService/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](/development-resources/webhooks) containing the final status of the payment: * `eventCode`: **AUTHORISATION** * `success`: **true** ## Test and go live When you want to test GoPay, contact our [Support Team](https://ca-test.adyen.com/ca/ca/contactUs/support.shtml?form=other). Refer to GoPay's [knowledge base](https://www.gopay.com/en/integration/) for more information about testing GoPay payments. 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/).