Skip to main content
It is possible to use Google Pay without the SDK.

About this integration

Even without the Android SDK, there is only minimal configuration required to get set up to process Google Pay. Unlike some other integrations it does not require you to sign up for a Google Developer account.

Enable Google Pay

To enable Google Pay, head over to your dashboard and then go to Connections -> Catalog -> Google Pay. Next, fill in your merchant name and the one or more domain names where you want to use Google Pay. Google Pay connector setup

Integrate Google Pay

  • Java
  • React Native
To learn how to integrate Google Pay, following Google’s tutorial is recommended. The steps below highlight any differences and specifics for the API.

Set gateway and merchant ID

In step 2 of Google’s tutorial you are instructed to request a payment token for your provider. In this case, the value for gateway needs to be set to gr4vy, and the value of gatewayMerchantId needs to be set to app.gr4vy.sandbox.[gr4vy_id].[merchant_account_id] for your sandbox environment, and app.gr4vy.[gr4vy_id].[merchant_account_id] in production.
private static JSONObject getGatewayTokenizationSpecification() throws JSONException {
    return new JSONObject() {{
            put("type", "PAYMENT_GATEWAY");
            put("parameters", new JSONObject() {{
            put("gateway", "gr4vy");
            put("gatewayMerchantId", "app.gr4vy.sandbox.example.default");
        }});
    }};
}
The instance ID is the unique identifier for the deployment of the system and is included in every API call. Together with the environment (sandbox or production) it is used to connect to the right APIs, as well as dashboard.

Create a transaction

In step 9 of Google’s tutorial, you have a paymentData that needs to be sent to the gateway. You can send this object to the POST /transactions endpoint either directly or via your server.The payment method used needs to contain the data from the Google Pay payload.
{
  "amount": 1299,
  "currency": "AUD",
  "country": "AU",
  "payment_method": {
    "method": "googlepay",
    "token": "[paymentData.paymentMethodData.tokenizationData.token]",
    "card_suffix": "[paymentData.paymentMethodData.info.cardDetails]", 
    "card_scheme": "[paymentData.paymentMethodData.info.cardNetwork]",
    "redirect_url": "https://example.com/callback"
  }
}
We strongly recommend always providing a redirect_url, just in case any connection is configured to use 3-D Secure.This URL will be appended with both a transaction ID and status (for example https://example.com/callback?transaction_id=123 &transaction_status=capture_succeeded) after 3-D Secure has been completed.

Test Google Pay

Please follow the Google Pay documentation with further guides on how to add test cards for use in a sandbox environment.