On this page, you can find additional configuration for adding GoPay to your Drop-in integration.
Before you begin
This page assumes you have already:
API reference
Select which endpoint you're integrating:
This is the default with Drop-in v5.0.0 or later.
Parameter name | Required | Description |
---|---|---|
browserInfo | ![]() |
Information about the shopper's browser. |
channel | ![]() |
Set to Web. |
curl https://checkout-test.adyen.com/v68/payments \
-H "x-API-key: YOUR_X-API-KEY" \
-H "content-type: application/json" \
-d '{
"merchantAccount":"YOUR_MERCHANT_ACCOUNT",
"reference":"YOUR_ORDER_NUMBER",
"amount":{
"currency":"IDR",
"value":1000
},
"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",
"returnUrl":"https://your-company.com/checkout?shopperOrder=12xy..."
}'
Drop-in configuration
There is no GoPay specific configuration for Drop-in.
Recurring
GoPay supports recurring transactions. To make recurring transactions, you need to:Create a token
To create a token, include in your /payments request:
storePaymentMethod
: true- shopperReference: Your unique identifier for the shopper (minimum length three characters).
When the payment has been settled, you receive a webhook containing:
eventCode
: RECURRING_CONTRACToriginalReference
: ThepspReference
of the initial payment.pspReference
: This is the token that you need to make recurring payments for this shopper.
Make sure that your server is able to receive RECURRING_CONTRACT as part of your standard webhooks. You can enable the RECURRING_CONTRACT event code in the webhook settings page.
Make a payment with a token
To make a recurring with a token, make a /payments request and include:
-
paymentMethod.storedPaymentMethodId
: The shopper's payment token.You can also get this value by using the /listRecurringDetails endpoint.
-
shopperReference
: Your unique identifier for the shopper. -
shopperInteraction
: ContAuth. -
recurringProcessingModel
: Subscription.curl https://checkout-test.adyen.com/v68/payments \ -H "x-API-key: YOUR_X-API-KEY" \ -H "content-type: application/json" \ -d '{ "amount":{ "value":10000, "currency":"IDR" }, "paymentMethod":{ "type":"gopay_wallet", "storedPaymentMethodId":"7219687191761347" }, "reference":"YOUR_ORDER_NUMBER", "merchantAccount":"YOUR_MERCHANT_ACCOUNT", "shopperReference":"YOUR_UNIQUE_SHOPPER_ID", "shopperInteraction":"ContAuth", "recurringProcessingModel": "Subscription", "returnUrl": "https://your-company.com/checkout?shopperOrder=12xy..." }'
# Set your X-API-KEY with the API key from the Customer Area. adyen = Adyen::Client.new adyen.api_key = "YOUR_X-API-KEY" response = adyen.checkout.payments({ :amount => { :currency => "IDR", :value => 10000 }, :reference => "YOUR_ORDER_NUMBER", :paymentMethod => { :type => "gopay_wallet", :storedPaymentMethodId => "7219687191761347" }, :returnUrl => "https://your-company.com/checkout?shopperOrder=12xy...", :shopperReference => "YOUR_UNIQUE_SHOPPER_ID", :merchantAccount => "YOUR_MERCHANT_ACCOUNT", :shopperInteraction => "ContAuth", :recurringProcessingModel => "Subscription" })
// Set YOUR_X-API-KEY with the API key from the Customer Area. // Change to Environment.LIVE and add the Live URL prefix when you're ready to accept live payments. Client client = new Client("YOUR_X-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("IDR"); amount.setValue(10000); paymentsRequest.setAmount(amount); DefaultPaymentMethodDetails paymentMethodDetails = new DefaultPaymentMethodDetails(); paymentMethodDetails.storedPaymentMethodId("7219687191761347"); paymentMethodDetails.setType("gopay_wallet"); paymentsRequest.setPaymentMethod(paymentMethodDetails); paymentsRequest.setReference("YOUR_ORDER_NUMBER"); paymentsRequest.setReturnUrl("https://your-company.com/checkout?shopperOrder=12xy..."); paymentsRequest.setShopperReference("YOUR_UNIQUE_SHOPPER_ID"); paymentsRequest.setShopperInteraction("ContAuth"); paymentsRequest.setRecurringProcessingModel("Subscription"); PaymentsResponse paymentsResponse = checkout.payments(paymentsRequest);
// Set your X-API-KEY with the API key from the Customer Area. $client = new \Adyen\Client(); $client->setXApiKey("YOUR_X-API-KEY"); $service = new \Adyen\Service\Checkout($client); $params = array( "amount" => array( "currency" => "IDR", "value" => 10000 ), "reference" => "YOUR_ORDER_NUMBER", "paymentMethod" => array( "type" => "gopay_wallet", "storedPaymentMethodId" => "7219687191761347" ), "returnUrl" => "https://your-company.com/checkout?shopperOrder=12xy...", "shopperReference" => "YOUR_UNIQUE_SHOPPER_ID", "recurringProcessingModel" => "Subscription", "shopperInteraction" => "ContAuth", "merchantAccount" => "YOUR_MERCHANT_ACCOUNT" ); $result = $service->payments($params);
#Set your X-API-KEY with the API key from the Customer Area. adyen = Adyen.Adyen() adyen.client.xapikey = 'YOUR_X-API-KEY' result = adyen.checkout.payments({ 'amount': { 'value': 10000, 'currency': 'IDR' }, 'reference': 'YOUR_ORDER_NUMBER', 'paymentMethod': { 'type': 'gopay_wallet', 'storedPaymentMethodId': '7219687191761347' }, 'returnUrl': 'https://your-company.com/checkout?shopperOrder=12xy...', 'shopperReference': 'YOUR_UNIQUE_SHOPPER_ID' 'merchantAccount': 'YOUR_MERCHANT_ACCOUNT', 'shopperInteraction':'ContAuth', 'recurringProcessingModel': 'Subscription' })
// Set your X-API-KEY with the API key from the Customer Area. var client = new Client ("YOUR_X-API-KEY", Environment.Test); var checkout = new Checkout(client); var amount = new Adyen.Model.Checkout.Amount("IDR", 10000); var details = new Adyen.Model.Checkout.DefaultPaymentMethodDetails{ Type = "gopay_wallet", StoredPaymentMethodId = "7219687191761347" }; var paymentsRequest = new Adyen.Model.Checkout.PaymentRequest { Reference = "YOUR_ORDER_NUMBER", Amount = amount, ReturnUrl = @"https://your-company.com/checkout?shopperOrder=12xy...", 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);
// Set your X-API-KEY with the API key from the Customer Area. const {Client, Config, CheckoutAPI} = require('@adyen/api-library'); const config = new Config(); // Set your X-API-KEY with the API key from the Customer Area. config.apiKey = '[API_KEY]'; config.merchantAccount = '[YOUR_MERCHANT_ACCOUNT]'; const client = new Client({ config }); client.setEnvironment("TEST"); const checkout = new CheckoutAPI(client); checkout.payments({ amount: { currency: "IDR", value: 10000 }, paymentMethod: { type: 'gopay_wallet', storedPaymentMethodId: "7219687191761347" }, reference: "YOUR_ORDER_NUMBER", merchantAccount: config.merchantAccount, shopperReference: "YOUR_UNIQUE_SHOPPER_ID", returnUrl: "https://your-company.com/checkout?shopperOrder=12xy...", shopperInteraction: "ContAuth", recurringProcessingModel: "Subscription" }).then(res => res);
Test and go live
When you want to test GoPay, contact our Support Team.
Refer to GoPay's knowledge base 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.