Google Pay on Android without the SDK
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 domain name(s) where you want to use Google Pay.
Integrate Google Pay
To learn how to integrate Google Pay we recommend following Google’s tutorial. The steps below will highlight any differences and specifics for our 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 our 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.
The Gr4vy ID is the unique identifier for your instance. Together with the environment (sandbox or production) it is used to connect to the right APIs.
Create a transaction
In step 9 of Google’s tutorial, you will have a paymentData
that needs to be
sent to the gateway. You can send this object to our POST /transactions
endpoint.
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 (e.g. https://example.com/callback?transaction_id=123 &transaction_status=capture_succeeded
) after 3-D Secure has been completed.
To learn how to integrate Google Pay we recommend following Google’s tutorial. The steps below will highlight any differences and specifics for our 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 our 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.
The Gr4vy ID is the unique identifier for your instance. Together with the environment (sandbox or production) it is used to connect to the right APIs.
Create a transaction
In step 9 of Google’s tutorial, you will have a paymentData
that needs to be
sent to the gateway. You can send this object to our POST /transactions
endpoint.
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 (e.g. https://example.com/callback?transaction_id=123 &transaction_status=capture_succeeded
) after 3-D Secure has been completed.
In React Native you can use any Google Pay integration, together with your merchant identifier. One of the easiest solutions is to use a library like React Native Google Pay to get a Google Pay token.
On initialization, any of these libraries will require you to set the Google Pay merchant identifier
and our gateway ID. You should set the gateway value to gr4vy
and the gatewayMerchantId
to your
environment, e.g. app.gr4vy.sandbox.[gr4vy_id].[merchant_account_id]
.
The Gr4vy ID is the unique identifier for your instance. Together with the environment (sandbox or production) it is used to connect to the right APIs.
Once the user has approved the payment, your application will receive a Google Pay token from the library.
You can pass this library to our server for processing.
We strongly recommend always providing a redirect_url
, just in case any connection
is configured to use 3-D Secure. This can be set to an application URL or URN if needed.
This URL will be appended with both a transaction ID
and status (e.g. 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.
Was this page helpful?