Payment-method icon

GoPay for API only

Add GoPay to your API-only 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.

Requirements

Requirement Description
Integration type Make sure that you have an existing API-only integration.
Redirect handling Make sure that your existing integration is set up to handle the redirect.
action.type: redirect.
Setup steps Before you begin, add GoPay in your Customer Area.

How it works

  1. The shopper selects GoPay as the payment method.
  2. The shopper enters their details in the payment form that you build, if applicable.
  3. When you make the payment request, you include additional information about the items that the shopper intends to purchase.
  4. Your existing integration setup will handle the redirect.

Build your payment form

Include GoPay in the list of available payment methods.

There is not any other specific field to include in the payment form to collect information from your shopper.

You can download the logo for GoPay to use in your form.

Get GoPay as an available payment method

When you make the /paymentMethods to get available payment methods, specify the following so that GoPay is included in the response.

Parameter Values
countryCode ID
amount.currency IDR
amount.value The value of the payment, in minor units.
channel Specify the relevant channel, for example Web, iOS, or Android.

Add additional parameters to your /payments request

When you make a payment, add the following parameters:

Parameter Required Description
paymentMethod.type -white_check_mark- gopay_wallet
browserInfo -white_check_mark- Information about the shopper's browser.
channel -white_check_mark- Set to the applicable channel, for example Web, Android, iOS.

The response includes action.type: redirect.

Recurring payments

GoPay 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.

Create a token

To create a token, include in your /payments request:

When the payment has been settled, you receive a recurring.token.created webhook 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 webhook. You can set up this webhook in your Customer Area.

Make a Subscription payment with a token

To make a recurring Subscription payment with a token, make a /payments request and include:

  • paymentMethod.storedPaymentMethodId: the storedPaymentMethodId from the recurring.token.created webhook.

    You can also get this value using the /listRecurringDetails endpoint.

  • shopperReference: your unique identifier for the shopper.

  • shopperInteraction: ContAuth

  • recurringProcessingModel: Subscription

The /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 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 request and include:

  • paymentMethod.storedPaymentMethodId: The shopper's payment token.

    You can also get this value using the /listRecurringDetails endpoint.

  • shopperReference: Your unique identifier for the shopper.

  • shopperInteraction: ContAuth

  • recurringProcessingModel: CardOnFile

The /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 with the redirectResult to complete the flow and get the status of the payment.

When the payment is processed, you receive a webhook 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 > Payments > Payment list.

Test directly with GoPay

To test directly with GoPay, contact our Support Team.

For more information about direct GoPay testing, see the GoPay knowledge base.

Before you can accept live GoPay payments, you need to submit a request for GoPay in your live Customer Area.

See also