{"title":"GoPay for API only","category":"default","creationDate":1776961628,"content":"<p>You can add GoPay to your existing integration. The following instructions show only what you must add to your integration specifically for GoPay.<\/p>\n<p>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.<\/p>\n<h2>Requirements<\/h2>\n<table>\n<thead>\n<tr>\n<th style=\"text-align: left;\">Requirement<\/th>\n<th style=\"text-align: left;\">Description<\/th>\n<\/tr>\n<\/thead>\n<tbody>\n<tr>\n<td style=\"text-align: left;\"><strong>Integration type<\/strong><\/td>\n<td style=\"text-align: left;\">Make sure that you have an existing <a href=\"\/pt\/online-payments\/build-your-integration\/advanced-flow\/?platform=Web&amp;integration=API%20only\">API-only integration<\/a>.<\/td>\n<td> <\/td>\n<\/tr>\n<tr>\n<td style=\"text-align: left;\"><strong>Redirect handling<\/strong><\/td>\n<td style=\"text-align: left;\">Make sure that your existing integration is set up to <a href=\"\/pt\/online-payments\/build-your-integration\/advanced-flow\/?platform=Web&amp;integration=API%20only#handle-the-redirect\">handle the redirect<\/a>. <br>  <code>action.type<\/code>: <strong>redirect<\/strong>.<\/td>\n<td><\/td>\n<\/tr>\n<tr>\n<td style=\"text-align: left;\"><strong>Setup steps<\/strong><\/td>\n<td style=\"text-align: left;\"> Before you begin, <a href=\"\/pt\/payment-methods\/add-payment-methods\">add GoPay in your Customer Area<\/a>. <\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<h2>How it works<\/h2>\n<ol>\n<li>The shopper selects GoPay as the payment method.<\/li>\n<li>The shopper enters their details in the <a href=\"#build-your-payment-form\">payment form that you build<\/a>, if applicable.<\/li>\n<li>When you make the payment request, you <a href=\"#additional-parameters-payments\">include additional information about the items that the shopper intends to purchase<\/a>.<\/li>\n<li>Your existing integration setup will <a href=\"\/pt\/online-payments\/build-your-integration\/advanced-flow\/?platform=Web&amp;integration=API%20only#handle-the-redirect\">handle the redirect<\/a>.<\/li>\n<\/ol>\n<h2 id=\"build-your-payment-form\">Build your payment form<\/h2>\n<p>Include GoPay in the list of available payment methods.<\/p>\n<p>There is not any other specific field to include in the payment form to collect information from your shopper.<\/p>\n<div class=\"notices green\">\n<p>You can <a href=\"\/pt\/online-payments\/build-your-integration\/advanced-flow\/?platform=Web&amp;integration=API%2Bonly&amp;version=71#downloading-logos\">download the logo for GoPay<\/a> to use in your form.<\/p>\n<\/div>\n<h2>Get GoPay as an available payment method<\/h2>\n<p>When you make the  <a href=\"https:\/\/docs.adyen.com\/api-explorer\/Checkout\/latest\/post\/paymentMethods\" class=\"codeLabel  external-link no-image\" target=\"_blank\" rel=\"nofollow noopener noreferrer\">\/paymentMethods<\/a> to <a href=\"\/pt\/online-payments\/build-your-integration\/advanced-flow\/?platform=Web&amp;integration=API%20only#get-available-payment-methods\">get available payment methods<\/a>, specify the following so that GoPay is included in the response.<\/p>\n<table>\n<thead>\n<tr>\n<th>Parameter<\/th>\n<th>Values<\/th>\n<\/tr>\n<\/thead>\n<tbody>\n<tr>\n<td> <a href=\"https:\/\/docs.adyen.com\/api-explorer\/Checkout\/latest\/post\/paymentMethods#request-countryCode\" class=\"codeLabel  external-link no-image\" target=\"_blank\" rel=\"nofollow noopener noreferrer\">countryCode<\/a><\/td>\n<td><strong>ID<\/strong><\/td>\n<\/tr>\n<tr>\n<td> <a href=\"https:\/\/docs.adyen.com\/api-explorer\/Checkout\/latest\/post\/paymentMethods#request-amount-currency\" class=\"codeLabel  external-link no-image\" target=\"_blank\" rel=\"nofollow noopener noreferrer\">amount.currency<\/a><\/td>\n<td><strong>IDR<\/strong><\/td>\n<\/tr>\n<tr>\n<td> <a href=\"https:\/\/docs.adyen.com\/api-explorer\/Checkout\/latest\/post\/paymentMethods#request-amount-value\" class=\"codeLabel  external-link no-image\" target=\"_blank\" rel=\"nofollow noopener noreferrer\">amount.value<\/a><\/td>\n<td>The value of the payment, in <a href=\"\/pt\/development-resources\/currency-codes\/\">minor units<\/a>.<\/td>\n<\/tr>\n<tr>\n<td> <a href=\"https:\/\/docs.adyen.com\/api-explorer\/Checkout\/latest\/post\/paymentMethods#request-channel\" class=\"codeLabel  external-link no-image\" target=\"_blank\" rel=\"nofollow noopener noreferrer\">channel<\/a><\/td>\n<td>Specify the relevant channel, for example <span translate=\"no\"><strong>Web<\/strong><\/span>, <span translate=\"no\"><strong>iOS<\/strong><\/span>, or <span translate=\"no\"><strong>Android<\/strong><\/span>.<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<div data-component-wrapper=\"code-sample\">\n    <code-sample :title=\"'Example request for available payment methods'\" :id=\"'payment-methods-request'\" :code-data=\"[{&quot;language&quot;:&quot;bash&quot;,&quot;tabTitle&quot;:&quot;&quot;,&quot;content&quot;:&quot;curl https:\\\/\\\/checkout-test.adyen.com\\\/v72\\\/paymentMethods \\\\\\n-H 'x-api-key: ADYEN_API_KEY' \\\\\\n-H 'idempotency-key: YOUR_IDEMPOTENCY_KEY' \\\\\\n-H 'content-type: application\\\/json' \\\\\\n-X POST\\n-d '{\\n   \\&quot;merchantAccount\\&quot;: \\&quot;ADYEN_MERCHANT_ACCOUNT\\&quot;,\\n   \\&quot;countryCode\\&quot;: \\&quot;ID\\&quot;,\\n   \\&quot;amount\\&quot;: {\\n      \\&quot;currency\\&quot;: \\&quot;IDR\\&quot;,\\n\\t  \\&quot;value\\&quot;: 1000\\n   },\\n   \\&quot;shopperLocale\\&quot;: \\&quot;id-ID\\&quot;\\n}'&quot;}]\" :enable-copy-link-to-code-block=\"true\" :code-sample-card-size=\"'fullsize'\"><\/code-sample>\n<\/div>\n<div data-component-wrapper=\"code-sample\">\n    <code-sample :title=\"'Example response with GoPay available'\" :id=\"'payment-methods-response'\" :code-data='[{\"language\":\"json\",\"tabTitle\":\"\",\"content\":\"{\\n    \\\"paymentMethods\\\": [\\n        {\\n            \\\"name\\\": \\\"GoPay\\\",\\n            \\\"type\\\": \\\"gopay_wallet\\\"\\n        }\\n    ]\\n}\"}]' :enable-copy-link-to-code-block=\"true\" :code-sample-card-size=\"'fullsize'\"><\/code-sample>\n<\/div>\n<h2 id=\"additional-parameters-payments\">Add additional parameters to your \/payments request<\/h2>\n<p>When you <a href=\"\/pt\/online-payments\/build-your-integration\/advanced-flow\/?platform=Web&amp;integration=API%20only#make-a-payment\">make a payment<\/a>, add the following parameters:<\/p>\n<table>\n<thead>\n<tr>\n<th>Parameter<\/th>\n<th>Required<\/th>\n<th>Description<\/th>\n<\/tr>\n<\/thead>\n<tbody>\n<tr>\n<td> <a href=\"https:\/\/docs.adyen.com\/api-explorer\/Checkout\/latest\/post\/payments#request-paymentMethod\" class=\"codeLabel  external-link no-image\" target=\"_blank\" rel=\"nofollow noopener noreferrer\">paymentMethod.type<\/a><\/td>\n<td><img title=\"-white_check_mark-\" alt=\"-white_check_mark-\" class=\"smileys\" src=\"\/user\/data\/smileys\/emoji\/white_check_mark.png\" \/><\/td>\n<td><strong>gopay_wallet<\/strong><\/td>\n<\/tr>\n<tr>\n<td> <a href=\"https:\/\/docs.adyen.com\/api-explorer\/Checkout\/latest\/post\/payments#request-browserInfo\" class=\"codeLabel  external-link no-image\" target=\"_blank\" rel=\"nofollow noopener noreferrer\">browserInfo<\/a><\/td>\n<td><img title=\"-white_check_mark-\" alt=\"-white_check_mark-\" class=\"smileys\" src=\"\/user\/data\/smileys\/emoji\/white_check_mark.png\" \/><\/td>\n<td>Information about the shopper's browser.<\/td>\n<\/tr>\n<tr>\n<td> <a href=\"https:\/\/docs.adyen.com\/api-explorer\/Checkout\/latest\/post\/payments#request-channel\" class=\"codeLabel  external-link no-image\" target=\"_blank\" rel=\"nofollow noopener noreferrer\">channel<\/a><\/td>\n<td><img title=\"-white_check_mark-\" alt=\"-white_check_mark-\" class=\"smileys\" src=\"\/user\/data\/smileys\/emoji\/white_check_mark.png\" \/><\/td>\n<td>Set to the applicable channel, for example <strong>Web<\/strong>, <strong>Android<\/strong>, <strong>iOS<\/strong>.<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<div data-component-wrapper=\"code-sample\">\n    <code-sample :title=\"'Example payment request for GoPay'\" :id=\"'payments-request'\" :code-data=\"[{&quot;language&quot;:&quot;bash&quot;,&quot;tabTitle&quot;:&quot;&quot;,&quot;content&quot;:&quot;curl https:\\\/\\\/checkout-test.adyen.com\\\/v72\\\/payments \\\\\\n-H 'x-API-key: ADYEN_API_KEY' \\\\\\n-H 'idempotency-key: YOUR_IDEMPOTENCY_KEY' \\\\\\n-H 'content-type: application\\\/json' \\\\\\n-X POST\\n-d '{\\n  \\&quot;amount\\&quot;:{\\n    \\&quot;currency\\&quot;:\\&quot;IDR\\&quot;,\\n    \\&quot;value\\&quot;:1000\\n  },\\n  \\&quot;paymentMethod\\&quot;:{\\n    \\&quot;type\\&quot;:\\&quot;gopay_wallet\\&quot;\\n  },\\n  \\&quot;reference\\&quot;:\\&quot;YOUR_ORDER_NUMBER\\&quot;,\\n  \\&quot;returnUrl\\&quot;:\\&quot;https:\\\/\\\/your-company.com\\\/checkout?shopperOrder=12xy..\\&quot;,\\n  \\&quot;merchantAccount\\&quot;:\\&quot;ADYEN_MERCHANT_ACCOUNT\\&quot;,\\n  \\&quot;browserInfo\\&quot;:\\&quot;{\\n                     \\&quot;userAgent\\&quot;:\\&quot;Mozilla\\\\\\\/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit\\\\\\\/537.36 (KHTML, like Gecko) Chrome\\\\\\\/70.0.3538.110 Safari\\\\\\\/537.36\\&quot;,\\n                     \\&quot;acceptHeader\\&quot;:\\&quot;text\\\\\\\/html,application\\\\\\\/xhtml+xml,application\\\\\\\/xml;q=0.9,image\\\\\\\/webp,image\\\\\\\/apng,*\\\\\\\/*;q=0.8\\&quot;,\\n                     \\&quot;language\\&quot;:\\&quot;en-ID\\&quot;,\\n                     \\&quot;colorDepth\\&quot;:24,\\n                     \\&quot;screenHeight\\&quot;:723,\\n                     \\&quot;screenWidth\\&quot;:1536,\\n                     \\&quot;timeZoneOffset\\&quot;:0,\\n                     \\&quot;javaEnabled\\&quot;:false\\n                   }\\&quot;,\\n  \\&quot;channel\\&quot;:\\&quot;web\\&quot;\\n}'&quot;}]\" :enable-copy-link-to-code-block=\"true\" :code-sample-card-size=\"'fullsize'\"><\/code-sample>\n<\/div>\n<p>The response includes <code>action.type<\/code>: <strong>redirect<\/strong>.<\/p>\n<div data-component-wrapper=\"code-sample\">\n    <code-sample :title=\"'Example response with a redirect action'\" :id=\"'payments-response'\" :code-data='[{\"language\":\"json\",\"tabTitle\":\"\",\"content\":\"{\\n    \\\"resultCode\\\":\\\"RedirectShopper\\\",\\n    \\\"action\\\":{\\n        \\\"paymentMethodType\\\":\\\"gopay_wallet\\\",\\n        \\\"method\\\":\\\"GET\\\",\\n        \\\"url\\\":\\\"https:\\\/\\\/checkoutshopper-test.adyen.com\\\/checkoutshopper\\\/checkoutPaymentRedirect?redirectData=...\\\",\\n        \\\"type\\\":\\\"redirect\\\"\\n    }\\n}\"}]' :enable-copy-link-to-code-block=\"true\" :code-sample-card-size=\"'fullsize'\"><\/code-sample>\n<\/div>\n<h2>Recurring payments<\/h2>\n<p>GoPay supports recurring payments. The first time your shopper makes a payment, you need to <a href=\"#create-a-token\">create a token<\/a>, which you can use later to make <code>Subscription<\/code> or <code>CardOnFile<\/code> payments. Note that the flows for <code>Subscription<\/code> and <code>CardOnFile<\/code> payments are different.<\/p>\n<h3 id=\"create-a-token\">Create a token<\/h3>\n<p>To create a token, include in your  <a href=\"https:\/\/docs.adyen.com\/api-explorer\/Checkout\/latest\/post\/payments\" class=\"codeLabel  external-link no-image\" target=\"_blank\" rel=\"nofollow noopener noreferrer\">\/payments<\/a> request:<\/p>\n<ul>\n<li><code>storePaymentMethod<\/code>: <strong>true<\/strong><\/li>\n<li> <a href=\"https:\/\/docs.adyen.com\/api-explorer\/Checkout\/latest\/post\/payments#request-shopperReference\" class=\"codeLabel  external-link no-image\" target=\"_blank\" rel=\"nofollow noopener noreferrer\">shopperReference<\/a>&#58; Your unique identifier for the shopper (minimum length three characters).<\/li>\n<li> <a href=\"https:\/\/docs.adyen.com\/api-explorer\/Checkout\/latest\/post\/payments#request-recurringProcessingModel\" class=\"codeLabel  external-link no-image\" target=\"_blank\" rel=\"nofollow noopener noreferrer\">recurringProcessingModel<\/a>: The recurring payment type.<\/li>\n<\/ul>\n<p>When the payment has been settled, you receive a  <a href=\"https:\/\/docs.adyen.com\/api-explorer\/Tokenization-webhooks\/latest\/post\/recurring.token.created\" class=\"codeLabel  external-link no-image\" target=\"_blank\" rel=\"nofollow noopener noreferrer\">recurring.token.created<\/a> <a href=\"\/pt\/development-resources\/webhooks\">webhook<\/a> containing:<\/p>\n<ul>\n<li><code>type<\/code>: <strong>recurring.token.created<\/strong><\/li>\n<li><code>shopperReference<\/code>: your unique identifier for the shopper.<\/li>\n<li><code>eventId<\/code>: the <code>pspReference<\/code> of the initial payment.<\/li>\n<li><code>storedPaymentMethodId<\/code>: the token that you need to make recurring payments for this shopper.<\/li>\n<\/ul>\n<div class=\"notices green\">\n<p>Make sure that your server is able to receive the <a href=\"\/pt\/development-resources\/webhooks\/webhook-types\/#other-webhooks\">Recurring tokens life cycle events<\/a> webhook. You can <a href=\"\/pt\/development-resources\/webhooks\/#set-up-webhooks-in-your-customer-area\">set up this webhook in your Customer Area<\/a>.<\/p>\n<\/div>\n<h3 id=\"make-payment-with-token-subscription\">Make a Subscription payment with a token<\/h3>\n<p>To make a recurring <code>Subscription<\/code> payment with a token, make a  <a href=\"https:\/\/docs.adyen.com\/api-explorer\/Checkout\/latest\/post\/payments\" class=\"codeLabel  external-link no-image\" target=\"_blank\" rel=\"nofollow noopener noreferrer\">\/payments<\/a> request and include:<\/p>\n<ul>\n<li>\n<p><code>paymentMethod.storedPaymentMethodId<\/code>: the <code>storedPaymentMethodId<\/code> from the  <a href=\"https:\/\/docs.adyen.com\/api-explorer\/Tokenization-webhooks\/latest\/post\/recurring.token.created\" class=\"codeLabel  external-link no-image\" target=\"_blank\" rel=\"nofollow noopener noreferrer\">recurring.token.created<\/a> webhook.<\/p>\n<div class=\"notices green\">\n<p>You can also get this value using the  <a href=\"https:\/\/docs.adyen.com\/api-explorer\/Recurring\/latest\/post\/listRecurringDetails\" class=\"codeLabel  external-link no-image\" target=\"_blank\" rel=\"nofollow noopener noreferrer\">\/listRecurringDetails<\/a> endpoint.<\/p>\n<\/div>\n<\/li>\n<li>\n<p><code>shopperReference<\/code>: your unique identifier for the shopper.<\/p>\n<\/li>\n<li>\n<p><code>shopperInteraction<\/code>: <strong>ContAuth<\/strong><\/p>\n<\/li>\n<li>\n<p><code>recurringProcessingModel<\/code>: <strong>Subscription<\/strong><\/p>\n<div data-component-wrapper=\"code-sample\">\n<code-sample :title=\"''\" :id=\"'recurring-gopay'\" :code-data=\"[{&quot;language&quot;:&quot;bash&quot;,&quot;tabTitle&quot;:&quot;curl&quot;,&quot;content&quot;:&quot;curl https:\\\/\\\/checkout-test.adyen.com\\\/v68\\\/payments \\\\\\n-H 'x-api-key: ADYEN_API_KEY' \\\\\\n-H 'content-type: application\\\/json' \\\\\\n-d '{\\n       \\&quot;amount\\&quot;:{\\n          \\&quot;value\\&quot;:10000,\\n          \\&quot;currency\\&quot;:\\&quot;IDR\\&quot;\\n       },\\n       \\&quot;paymentMethod\\&quot;:{\\n          \\&quot;type\\&quot;:\\&quot;gopay_wallet\\&quot;,\\n          \\&quot;storedPaymentMethodId\\&quot;:\\&quot;7219687191761347\\&quot;\\n       },\\n       \\&quot;reference\\&quot;:\\&quot;YOUR_ORDER_NUMBER\\&quot;,\\n       \\&quot;merchantAccount\\&quot;:\\&quot;YOUR_MERCHANT_ACCOUNT\\&quot;,\\n       \\&quot;shopperReference\\&quot;:\\&quot;YOUR_UNIQUE_SHOPPER_ID\\&quot;,\\n       \\&quot;shopperInteraction\\&quot;:\\&quot;ContAuth\\&quot;,\\n       \\&quot;recurringProcessingModel\\&quot;: \\&quot;Subscription\\&quot;,\\n       \\&quot;returnUrl\\&quot;: \\&quot;https:\/\/your-company.example.com\/checkout?shopperOrder=12xy...\\&quot;\\n}'&quot;},{&quot;language&quot;:&quot;java&quot;,&quot;tabTitle&quot;:&quot;Java&quot;,&quot;content&quot;:&quot;\\\/\\\/ Set ADYEN_API_KEY with the API key from the Customer Area.\\n\\\/\\\/ Change to Environment.LIVE and add the Live URL prefix when you are ready to accept live payments.\\nClient client = new Client(\\&quot;ADYEN_API_KEY\\&quot;, Environment.TEST);\\nCheckout checkout = new Checkout(client);\\n\\nPaymentsRequest paymentsRequest = new PaymentsRequest();\\n\\nString merchantAccount = \\&quot;YOUR_MERCHANT_ACCOUNT\\&quot;;\\npaymentsRequest.setMerchantAccount(merchantAccount);\\n\\nAmount amount = new Amount();\\namount.setCurrency(\\&quot;IDR\\&quot;);\\namount.setValue(10000);\\npaymentsRequest.setAmount(amount);\\n\\nDefaultPaymentMethodDetails paymentMethodDetails = new DefaultPaymentMethodDetails();\\npaymentMethodDetails.storedPaymentMethodId(\\&quot;7219687191761347\\&quot;);\\npaymentMethodDetails.setType(\\&quot;gopay_wallet\\&quot;);\\npaymentsRequest.setPaymentMethod(paymentMethodDetails);\\n\\npaymentsRequest.setReference(\\&quot;YOUR_ORDER_NUMBER\\&quot;);\\npaymentsRequest.setReturnUrl(\\&quot;https:\/\/your-company.example.com\/checkout?shopperOrder=12xy...\\&quot;);\\npaymentsRequest.setShopperReference(\\&quot;YOUR_UNIQUE_SHOPPER_ID\\&quot;);\\npaymentsRequest.setShopperInteraction(\\&quot;ContAuth\\&quot;);\\npaymentsRequest.setRecurringProcessingModel(\\&quot;Subscription\\&quot;);\\n\\nPaymentsResponse paymentsResponse = checkout.payments(paymentsRequest);&quot;},{&quot;language&quot;:&quot;php&quot;,&quot;tabTitle&quot;:&quot;PHP&quot;,&quot;content&quot;:&quot;\\\/\\\/ Set your X-API-KEY with the API key from the Customer Area.\\n$client = new \\\\Adyen\\\\Client();\\n$client-&gt;setXApiKey(\\&quot;ADYEN_API_KEY\\&quot;);\\n$service = new \\\\Adyen\\\\Service\\\\Checkout($client);\\n\\n$params = array(\\n  \\&quot;amount\\&quot; =&gt; array(\\n    \\&quot;currency\\&quot; =&gt; \\&quot;IDR\\&quot;,\\n    \\&quot;value\\&quot; =&gt; 10000\\n  ),\\n  \\&quot;reference\\&quot; =&gt; \\&quot;YOUR_ORDER_NUMBER\\&quot;,\\n  \\&quot;paymentMethod\\&quot; =&gt; array(\\n    \\&quot;type\\&quot; =&gt; \\&quot;gopay_wallet\\&quot;,\\n    \\&quot;storedPaymentMethodId\\&quot; =&gt; \\&quot;7219687191761347\\&quot;\\n  ),\\n  \\&quot;returnUrl\\&quot; =&gt; \\&quot;https:\/\/your-company.example.com\/checkout?shopperOrder=12xy...\\&quot;,\\n  \\&quot;shopperReference\\&quot; =&gt; \\&quot;YOUR_UNIQUE_SHOPPER_ID\\&quot;,\\n  \\&quot;recurringProcessingModel\\&quot; =&gt; \\&quot;Subscription\\&quot;,\\n  \\&quot;shopperInteraction\\&quot; =&gt; \\&quot;ContAuth\\&quot;,\\n  \\&quot;merchantAccount\\&quot; =&gt; \\&quot;YOUR_MERCHANT_ACCOUNT\\&quot;\\n);\\n$result = $service-&gt;payments($params);&quot;},{&quot;language&quot;:&quot;cs&quot;,&quot;tabTitle&quot;:&quot;C#&quot;,&quot;content&quot;:&quot;\\\/\\\/ Set your X-API-KEY with the API key from the Customer Area.\\nvar client = new Client (\\&quot;ADYEN_API_KEY\\&quot;, Environment.Test);\\nvar checkout = new Checkout(client);\\n\\nvar amount = new Adyen.Model.Checkout.Amount(\\&quot;IDR\\&quot;, 10000);\\nvar details = new Adyen.Model.Checkout.DefaultPaymentMethodDetails{\\n  Type = \\&quot;gopay_wallet\\&quot;,\\n  StoredPaymentMethodId = \\&quot;7219687191761347\\&quot;\\n};\\nvar paymentsRequest = new Adyen.Model.Checkout.PaymentRequest\\n{\\n  Reference = \\&quot;YOUR_ORDER_NUMBER\\&quot;,\\n  Amount = amount,\\n  ReturnUrl = @\\&quot;https:\/\/your-company.example.com\/checkout?shopperOrder=12xy...\\&quot;,\\n  MerchantAccount = \\&quot;YOUR_MERCHANT_ACCOUNT\\&quot;,\\n  ShopperReference = \\&quot;YOUR_UNIQUE_SHOPPER_ID\\&quot;,\\n  RecurringProcessingModel = Adyen.Model.Checkout.PaymentRequest.RecurringProcessingModelEnum.Subscription,\\n  ShopperInteraction = Adyen.Model.Checkout.PaymentRequest.ShopperInteractionEnum.ContAuth,\\n  PaymentMethod = details\\n};\\n\\nvar paymentResponse = checkout.Payments(paymentsRequest);&quot;},{&quot;language&quot;:&quot;js&quot;,&quot;tabTitle&quot;:&quot;NodeJS (JavaScript)&quot;,&quot;content&quot;:&quot;\\\/\\\/ Adyen Node API Library v16.1.0\\n\\\/\\\/ Require the parts of the module you want to use\\nconst { Client, CheckoutAPI } = require('@adyen\\\/api-library');\\n\\n\\\/\\\/ Initialize the client object\\nconst client = new Client({apiKey: \\&quot;YOUR_X_API_KEY\\&quot;, environment: \\&quot;TEST\\&quot;});\\n\\n\\\/\\\/ Create the request object\\nconst paymentRequest = {\\n  amount: {\\n    value: 10000,\\n    currency: \\&quot;IDR\\&quot;\\n  },\\n  paymentMethod: {\\n    type: \\&quot;gopay_wallet\\&quot;,\\n    storedPaymentMethodId: \\&quot;7219687191761347\\&quot;\\n  },\\n  reference: \\&quot;YOUR_ORDER_NUMBER\\&quot;,\\n  merchantAccount: \\&quot;YOUR_MERCHANT_ACCOUNT\\&quot;,\\n  shopperReference: \\&quot;YOUR_UNIQUE_SHOPPER_ID\\&quot;,\\n  shopperInteraction: \\&quot;ContAuth\\&quot;,\\n  recurringProcessingModel: \\&quot;Subscription\\&quot;,\\n  returnUrl: \\&quot;https:\/\/your-company.example.com\/checkout?shopperOrder=12xy...\\&quot;\\n}\\n\\n\\\/\\\/ Make the request\\nconst checkoutAPI = new CheckoutAPI(client);\\nconst response = checkoutAPI.PaymentsApi.payments(paymentRequest, { idempotencyKey: \\&quot;UUID\\&quot; });&quot;},{&quot;language&quot;:&quot;py&quot;,&quot;tabTitle&quot;:&quot;Python&quot;,&quot;content&quot;:&quot;# Adyen Python API Library v12.0.0\\nimport Adyen\\n\\nadyen = Adyen.Adyen()\\nadyen.client.xapikey = \\&quot;YOUR_X_API_KEY\\&quot;\\nadyen.client.platform = \\&quot;test\\&quot; # The environment to use library in.\\n\\njson_request = {\\n  \\&quot;amount\\&quot;: {\\n    \\&quot;value\\&quot;: 10000,\\n    \\&quot;currency\\&quot;: \\&quot;IDR\\&quot;\\n  },\\n  \\&quot;paymentMethod\\&quot;: {\\n    \\&quot;type\\&quot;: \\&quot;gopay_wallet\\&quot;,\\n    \\&quot;storedPaymentMethodId\\&quot;: \\&quot;7219687191761347\\&quot;\\n  },\\n  \\&quot;reference\\&quot;: \\&quot;YOUR_ORDER_NUMBER\\&quot;,\\n  \\&quot;merchantAccount\\&quot;: \\&quot;YOUR_MERCHANT_ACCOUNT\\&quot;,\\n  \\&quot;shopperReference\\&quot;: \\&quot;YOUR_UNIQUE_SHOPPER_ID\\&quot;,\\n  \\&quot;shopperInteraction\\&quot;: \\&quot;ContAuth\\&quot;,\\n  \\&quot;recurringProcessingModel\\&quot;: \\&quot;Subscription\\&quot;,\\n  \\&quot;returnUrl\\&quot;: \\&quot;https:\/\/your-company.example.com\/checkout?shopperOrder=12xy...\\&quot;\\n}\\n\\nresult = adyen.checkout.payments_api.payments(request=json_request, idempotency_key=\\&quot;UUID\\&quot;)&quot;},{&quot;language&quot;:&quot;rb&quot;,&quot;tabTitle&quot;:&quot;Ruby&quot;,&quot;content&quot;:&quot;# Adyen Ruby API Library v9.1.0\\nrequire \\&quot;adyen-ruby-api-library\\&quot;\\n\\nadyen = Adyen::Client.new\\nadyen.api_key = 'YOUR_X_API_KEY'\\nadyen.env = :test # Set to \\&quot;live\\&quot; for live environment\\n\\nrequest_body = {\\n  :amount =&gt; {\\n    :value =&gt; 10000,\\n    :currency =&gt; 'IDR'\\n  },\\n  :paymentMethod =&gt; {\\n    :type =&gt; 'gopay_wallet',\\n    :storedPaymentMethodId =&gt; '7219687191761347'\\n  },\\n  :reference =&gt; 'YOUR_ORDER_NUMBER',\\n  :merchantAccount =&gt; 'YOUR_MERCHANT_ACCOUNT',\\n  :shopperReference =&gt; 'YOUR_UNIQUE_SHOPPER_ID',\\n  :shopperInteraction =&gt; 'ContAuth',\\n  :recurringProcessingModel =&gt; 'Subscription',\\n  :returnUrl =&gt; 'https:\/\/your-company.example.com\/checkout?shopperOrder=12xy...'\\n}\\n\\nresult = adyen.checkout.payments_api.payments(request_body, headers: { 'Idempotency-Key' =&gt; 'UUID' })&quot;}]\" :enable-copy-link-to-code-block=\"true\" :code-sample-card-size=\"'fullsize'\"><\/code-sample>\n<\/div>\n<\/li>\n<\/ul>\n<p>The  <a href=\"https:\/\/docs.adyen.com\/api-explorer\/Checkout\/latest\/post\/payments\" class=\"codeLabel  external-link no-image\" target=\"_blank\" rel=\"nofollow noopener noreferrer\">\/payments<\/a> response contains:<br \/>\n<code>resultCode<\/code>: Use this to show your shopper the payment result.<\/p>\n<p>When the payment is processed, you receive the final status of the payment in a <a href=\"\/pt\/development-resources\/webhooks\">webhook<\/a> containing:<\/p>\n<ul>\n<li><code>eventCode<\/code>: <strong>AUTHORISATION<\/strong><\/li>\n<li><code>success<\/code>: <strong>true<\/strong><\/li>\n<\/ul>\n<h3 id=\"make-payment-with-token-cardonfile\">Make a recurring CardOnFile payment with a token<\/h3>\n<p>Recurring <code>CardOnFile<\/code> 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.<br \/>\nTo make a recurring <code>CardOnFile<\/code> payment with a token, make a  <a href=\"https:\/\/docs.adyen.com\/api-explorer\/Checkout\/latest\/post\/payments\" class=\"codeLabel  external-link no-image\" target=\"_blank\" rel=\"nofollow noopener noreferrer\">\/payments<\/a> request and include:<\/p>\n<ul>\n<li>\n<p><code>paymentMethod.storedPaymentMethodId<\/code>: The shopper's payment token.<\/p>\n<div class=\"notices green\">\n<p>You can also get this value using the  <a href=\"https:\/\/docs.adyen.com\/api-explorer\/Recurring\/latest\/post\/listRecurringDetails\" class=\"codeLabel  external-link no-image\" target=\"_blank\" rel=\"nofollow noopener noreferrer\">\/listRecurringDetails<\/a> endpoint.<\/p>\n<\/div>\n<\/li>\n<li>\n<p><code>shopperReference<\/code>: Your unique identifier for the shopper.<\/p>\n<\/li>\n<li>\n<p><code>shopperInteraction<\/code>: <strong>ContAuth<\/strong><\/p>\n<\/li>\n<li>\n<p><code>recurringProcessingModel<\/code>: <strong>CardOnFile<\/strong><\/p>\n<\/li>\n<\/ul>\n<p>The  <a href=\"https:\/\/docs.adyen.com\/api-explorer\/Checkout\/latest\/post\/payments\" class=\"codeLabel  external-link no-image\" target=\"_blank\" rel=\"nofollow noopener noreferrer\">\/payments<\/a> response contains:<\/p>\n<p><code>resultCode<\/code>: <strong>RedirectShopper<\/strong><br \/>\n<code>action<\/code>: Contains the <code>url<\/code> to redirect the shopper to.<\/p>\n<p>When the shopper is redirected back to your page, call <a href=\"https:\/\/docs.adyen.com\/api-explorer\/#\/CheckoutService\/latest\/post\/payments\/details\" class=\"codeLabel external-link no-image\" target=\"_blank\" rel=\"nofollow noopener noreferrer\">\/payments\/details<\/a> with the <code>redirectResult<\/code> to complete the flow and get the status of the payment.<\/p>\n<p>When the payment is processed, you receive a <a href=\"\/pt\/development-resources\/webhooks\">webhook<\/a> containing the final status of the payment:<\/p>\n<ul>\n<li><code>eventCode<\/code>: <strong>AUTHORISATION<\/strong><\/li>\n<li><code>success<\/code>: <strong>true<\/strong><\/li>\n<\/ul>\n<h2>Test and go live<\/h2>\n<p>When you want to test GoPay, contact our <a href=\"https:\/\/ca-test.adyen.com\/ca\/ca\/contactUs\/support.shtml?form=other\" target=\"_blank\" rel=\"nofollow noopener noreferrer\" class=\"external-link no-image\">Support Team<\/a>.<\/p>\n<p>Refer to GoPay's <a href=\"https:\/\/www.gopay.com\/en\/integration\/\" target=\"_blank\" rel=\"nofollow noopener noreferrer\" class=\"external-link no-image\">knowledge base<\/a> for more information about testing GoPay payments.<\/p>\n<p>Before you can accept live GoPay payments, you need to submit a request for GoPay in your <a href=\"https:\/\/ca-live.adyen.com\/\" target=\"_blank\" rel=\"nofollow noopener noreferrer\" class=\"external-link no-image\">live Customer Area<\/a>.<\/p>\n<h2 id=\"see-also\">See also<\/h2>\n<div class=\"see-also-links output-inline\" id=\"see-also\">\n<ul><li><a href=\"\/online-payments\/build-your-integration\/advanced-flow\/?platform=Web&amp;integration=API%20only\"\n                        target=\"_self\"\n                        >\n                    API-only integration guide\n                <\/a><\/li><\/ul><\/div>\n","url":"https:\/\/docs.adyen.com\/pt\/payment-methods\/gopay\/api-only","articleFields":{"description":"Add GoPay to your API-only integration.","never_cache_twig":true,"parameters":{"flow":"Advanced","integration_guide_url":"\/online-payments\/build-your-integration\/advanced-flow\/?platform=Web&integration=API%20only","payment_method":"GoPay","payment_method_type":"gopay_wallet","payment_method_type_capitalized":"Gopay_wallet","tx_variant":"gopay_wallet","tx_variant_capitalized":"Gopay_wallet","country_codes":"<strong>ID<\/strong>","currency_codes":"<strong>IDR<\/strong>","additional_api":"true","api_version":"none","action_type":"<strong>redirect<\/strong>","pm_directory":"gopay","contact":"false"}},"algolia":{"url":"https:\/\/docs.adyen.com\/pt\/payment-methods\/gopay\/api-only","title":"GoPay for API only","content":"You can add GoPay to your existing integration. The following instructions show only what you must add to your integration specifically for GoPay.\nIf 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.\nRequirements\n\n\n\nRequirement\nDescription\n\n\n\n\nIntegration type\nMake sure that you have an existing API-only integration.\n \n\n\nRedirect handling\nMake sure that your existing integration is set up to handle the redirect.   action.type: redirect.\n\n\n\nSetup steps\n Before you begin, add GoPay in your Customer Area. \n\n\n\nHow it works\n\nThe shopper selects GoPay as the payment method.\nThe shopper enters their details in the payment form that you build, if applicable.\nWhen you make the payment request, you include additional information about the items that the shopper intends to purchase.\nYour existing integration setup will handle the redirect.\n\nBuild your payment form\nInclude GoPay in the list of available payment methods.\nThere is not any other specific field to include in the payment form to collect information from your shopper.\n\nYou can download the logo for GoPay to use in your form.\n\nGet GoPay as an available payment method\nWhen you make the  \/paymentMethods to get available payment methods, specify the following so that GoPay is included in the response.\n\n\n\nParameter\nValues\n\n\n\n\n countryCode\nID\n\n\n amount.currency\nIDR\n\n\n amount.value\nThe value of the payment, in minor units.\n\n\n channel\nSpecify the relevant channel, for example Web, iOS, or Android.\n\n\n\n\n    \n\n\n    \n\nAdd additional parameters to your \/payments request\nWhen you make a payment, add the following parameters:\n\n\n\nParameter\nRequired\nDescription\n\n\n\n\n paymentMethod.type\n\ngopay_wallet\n\n\n browserInfo\n\nInformation about the shopper's browser.\n\n\n channel\n\nSet to the applicable channel, for example Web, Android, iOS.\n\n\n\n\n    \n\nThe response includes action.type: redirect.\n\n    \n\nRecurring payments\nGoPay supports recurring payments. The first time your shopper makes a payment, you need to 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.\nCreate a token\nTo create a token, include in your  \/payments request:\n\nstorePaymentMethod: true\n shopperReference&#58; Your unique identifier for the shopper (minimum length three characters).\n recurringProcessingModel: The recurring payment type.\n\nWhen the payment has been settled, you receive a  recurring.token.created webhook containing:\n\ntype: recurring.token.created\nshopperReference: your unique identifier for the shopper.\neventId: the pspReference of the initial payment.\nstoredPaymentMethodId: the token that you need to make recurring payments for this shopper.\n\n\nMake sure that your server is able to receive the Recurring tokens life cycle events webhook. You can set up this webhook in your Customer Area.\n\nMake a Subscription payment with a token\nTo make a recurring Subscription payment with a token, make a  \/payments request and include:\n\n\npaymentMethod.storedPaymentMethodId: the storedPaymentMethodId from the  recurring.token.created webhook.\n\nYou can also get this value using the  \/listRecurringDetails endpoint.\n\n\n\nshopperReference: your unique identifier for the shopper.\n\n\nshopperInteraction: ContAuth\n\n\nrecurringProcessingModel: Subscription\n\n\n\n\n\nThe  \/payments response contains:\nresultCode: Use this to show your shopper the payment result.\nWhen the payment is processed, you receive the final status of the payment in a webhook containing:\n\neventCode: AUTHORISATION\nsuccess: true\n\nMake a recurring CardOnFile payment with a token\nRecurring 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.\nTo make a recurring CardOnFile payment with a token, make a  \/payments request and include:\n\n\npaymentMethod.storedPaymentMethodId: The shopper's payment token.\n\nYou can also get this value using the  \/listRecurringDetails endpoint.\n\n\n\nshopperReference: Your unique identifier for the shopper.\n\n\nshopperInteraction: ContAuth\n\n\nrecurringProcessingModel: CardOnFile\n\n\nThe  \/payments response contains:\nresultCode: RedirectShopper\naction: Contains the url to redirect the shopper to.\nWhen the shopper is redirected back to your page, call \/payments\/details with the redirectResult to complete the flow and get the status of the payment.\nWhen the payment is processed, you receive a webhook containing the final status of the payment:\n\neventCode: AUTHORISATION\nsuccess: true\n\nTest and go live\nWhen you want to test GoPay, contact our Support Team.\nRefer to GoPay's knowledge base for more information about testing GoPay payments.\nBefore you can accept live GoPay payments, you need to submit a request for GoPay in your live Customer Area.\nSee also\n\n\n                    API-only integration guide\n                \n","type":"page","locale":"pt","boost":17,"hierarchy":{"lvl0":"Home","lvl1":"Payment methods","lvl2":"GoPay","lvl3":"GoPay for API only"},"hierarchy_url":{"lvl0":"https:\/\/docs.adyen.com\/pt","lvl1":"https:\/\/docs.adyen.com\/pt\/payment-methods","lvl2":"https:\/\/docs.adyen.com\/pt\/payment-methods\/gopay","lvl3":"\/pt\/payment-methods\/gopay\/api-only"},"levels":4,"category":"Payment method","category_color":"green","tags":["GoPay"]},"articleFiles":{"payment-methods-response.json":"<p alt=\"\">payment-methods-response.json<\/p>","payments-response.json":"<p alt=\"\">payments-response.json<\/p>","recurring-gopay.js":"<p alt=\"\">recurring-gopay.js<\/p>"}}
