Add Google Pay to your integration
When a customer uses Google Pay® to pay for goods or services on a merchant’s website or mobile app, use the Google Pay API to retrieve the customer’s encrypted payment details. You can then use our API to run a transaction with the encrypted payment details.
Integration steps
- Integrate with the Google Pay API to retrieve encrypted payment details.
- Integrate with our API to run transactions.
- Register your integration.
Before you begin
Bearer tokens
Use our Identity Service to generate a Bearer token to include in the header of your requests. To generate your Bearer token, complete the following steps:
- Include your API key in the x-api-key parameter in the header of a POST request.
- Send your request to https://identity.payroc.com/authorize.
Note: You need to generate a new Bearer token before the previous Bearer token expires.
Example request
Example response
If your request is successful, we return a response that contains your Bearer token, information about its scope, and when it expires.
Headers
To create the header of each GET request, you must include the following parameters:
- Content-Type: Include application/json as the value for this parameter.
- Authorization: Include your Bearer token in this parameter.
To create the header of each POST request, you must include the following parameters:
- Content-Type: Include application/json as the value for this parameter.
- Authorization: Include your Bearer token in this parameter.
- Idempotency-Key: Include a UUID v4 to make the request idempotent.
Errors
If your request is unsuccessful, we return an error. For more information about errors, see Errors.
Step 1. Integrate with the Google Pay API
To integrate with the web version of the Google Pay API, go to https://developers.google.com/pay/api/web/overview. During your integration with the Google Pay API, you need the following:
- merchantId - Merchant ID that Google assigned to you.
- gatewayMerchantId - Merchant ID that we assigned to you. Also known as a MID.
- gateway – Name of the gateway that processes the transaction. Use the case-sensitive value of
worldnet
.
Note: Payroc now owns the Worldnet gateway and uses it to process transactions.
After you integrate with the Google Pay API, you can send requests to the Google Pay API to retrieve encrypted details that represent the customer’s payment details.
Convert the encrypted payment details into hexadecimal format.
Step 2. Run a sale
To run a sale, send a POST request to our Payments endpoint.
In your request, send the following parameters in the paymentMethod object:
- type – Provide a value of
digitalWallet
. - serviceProvider – Provide a value of
google
. - encryptedData – Provide the encrypted payment details that you retrieved from the Google Pay API in hexadecimal format.
Note: For more information about how to run other transaction types with our API, go to our API Explorer.
Example request
Step 3. Register your integration
To complete your integration and run live transactions with Google Pay:
- Contact Google to register your integration and website.
- Contact our Integrations Team at [email protected].