This page explains how to use Google Pay to process payments using the EBANX Direct API. This integration offers a seamless way for customers to pay with their saved credit or debit cards and other payment information stored in their Google Account (including Android Pay, Chrome, and YouTube), making the checkout process faster and more convenient.
Requirements
Before beginning the integration, ensure you have the following:
- Google Pay business account - and access to the Google Pay API Console.
- EBANX account
- Ensure you have access to your EBANX dashboard.
- If not, complete the Merchant Signup Form.
- SSL Certificates - Make sure SSL certificates are properly installed on your servers (Google Pay requires HTTPS).
How it works
Follow the numbered steps below for a detailed explanation of the Google Pay integration process.
Availability
Google Pay is available in the following countries.
Country | Payment Methods | Currencies |
---|---|---|
![]() | Credit Cards | Brazilian Reais, Euros, US Dollars |
Instructions
Follow the steps below.
Set up Google Pay
When a customer selects Pay with Google, Google Pay uses the payment methods (credit or debit cards) saved in the customer’s Google account. Google Pay does not send raw payment data directly to your server. Instead, it returns a token to the client's browser, which represents the customer’s payment details (card number, expiration date, etc.). The token is received by the client (typically the browser or mobile app) and is sent to your backend. Your backend forwards this token, along with other transaction details (such as amount, currency, and customer information), to the EBANX API for processing.
To setup your Google Pay account to integrate with EBANX, see below.
- Google Pay Guide: Web Payments
- Google Pay Guide: Android Payments
When configuring Google Pay, you need to provide the following parameters specific to EBANX:
Parameter Details gatewayMerchantId
Retrieve from your EBANX Dashboard at:
Username / Account Settings / Integration / Test (or Live) Integration Keys / Secret Keysgateway
Set to ebanx Example response from Google Pay, when a shopper chooses Pay with Google (Step 2 above)
// Example client response from Google Pay.
{
"paymentMethodData": {
"type": "CARD",
"description": "Visa •••• 1234",
"tokenizationData": {
"type": "PAYMENT_GATEWAY",
"token": "eyJhbGciOiJSUzI1NiIsImtpZCI6Ijc2Y..." // tokenized payment method
}
}
}Build your EBANX Direct API call
Google Pay token:
When you receive tokenized customer information from Google Pay, ensure that you include the token in the
google_pay
parameter when building your EBANX Direct API request.Example:
// Add to your EBANX request.
{
"card" :
{
"google_pay": "your_google_pay_token_here" // string
}
}Required Fields - When processing a Google Pay transaction, ensure that the following information is included in your EBANX Direct API request.
Parameter Description integration_key
Your unique EBANX integration key. Required operation
Indicates the operation type. Set to "request"
.Required payment.name
Customer's full name. Required payment.email
Customer's email address. Required payment.document
Customer's CPF (Cadastro de Pessoas Físicas) number. Required for Brazilian payments. Required payment.address
Customer's street address. Required payment.street_number
Street number of the customer's address. Required payment.city
Customer's city. Required payment.state
Customer's state. Required payment.zipcode
Customer's postal code. Required payment.country
Customer's country code (e.g., "BR" for Brazil). Required payment.phone_number
Customer's phone number. payment.payment_type_code
Payment type. Set to "creditcard"
.Required payment.merchant_payment_code
Unique identifier for the payment in your system. Required payment.currency_code
Currency code (e.g., "BRL" for Brazilian Real). Required payment.amount_total
Total transaction amount. Required payment.card.card_name
Cardholder's name. Required payment.card.google_pay
Token received from Google Pay. Required For more information, refer to theEBANX Direct API guidechevron_rightSample request
Use the following example to initiate a payment request.
curl -X POST \
--location 'https://api.ebanxpay.com/ws/direct' \
--header 'Content-Type: application/json' \
--data '{
"integration_key": "your_ebanx_integration_key",
"operation": "request",
"payment": {
"name": "José Silva",
"email": "jose@example.com",
"document": "853.513.468-93",
"address": "Rua E",
"street_number": "1040",
"city": "Maracanaú",
"state": "CE",
"zipcode": "61919-230",
"country": "br",
"phone_number": "8522847035",
"payment_type_code": "creditcard",
"merchant_payment_code": "<%= random_order_id %>",
"currency_code": "BRL",
"amount_total": 100,
"card": {
"card_name": "José Silva",
"google_pay": "{\"signature\":\"MEUCIFU/vJavw2HKB4bHbVxZp1JqaIdUa5R1ENbk59MG +
fHFAiEA1UBu7ZS1YC1v + Go6ScIbel / XyBKVt29Qr1mSdObWIig\\ u003d\ ",\"protoc
olVersion\ ":\"ECv1\",\"signedMessage\":\"{\\\"encryptedMessage\\\":\\\
"ZkxOdAiV2EJXbNRkU1izADoLPyQtidbSvAC4HxnAGJPkFcnFbwwMVKHeXYjmkGbIjAg
3 uzIqsds1G5NrDMzwwztdwmPQ0BjE3lIhVASIg1iljIiNQzcTkhHqTMc01Rs9yn3w2T9W
gws2UGJ42YEnkeiVPjQfM3NvIAmxwCA8CAWrYZFmQfQCUGHK6H0dZolvjGGI8YtNwaImo
4 aC6YMCo4t9FfwT + pITZdS9BfIMmjx2iXzjZF1Iy + c53lwzVVFEljGF5mh6cHEzZdKCVj
F5U11tKt6MybAkEU6yxEqOfdjp41FwjcJ3SknlzrDBrFXqL66cq + xtfCGTPfRvzs7SnFE
h5MKtzg14VmAQ0TyoQpZuBvrhRnmWxkQU4yzj4q6wCX2VSDO4M4KVvSpVUVTCWVydPmdn
hFKzL84uVU2YKV8dxjGz7VJNOlF4sJH + G158Ru + w\\\\ u003d\\\ ",\\\"ephemeralPu
blicKey\\\ ":\\\"BF1s3ATPQMJkfCvLmOAgG9oTcF+P9Wdh5WNJyGeMjcywjEtBhfFdG
HOkZTZR + poT2LQjBrRADtWkD5yFuEEV7w\\\\ u003d\\\ ",\\\"tag\\\":\\\"SP4tH1
HxhSTbcNEhmFfEgSRHW7G46B1J3m / FEl6mPzg\\\\ u003d\\\ "}\"}"
}
}
}'Sample response
Each request returns a response similar to the example below.
{
"payment": {
"hash": "5a1c6820f28a2fd24c11a1dcde32e79c01c9814b66183cc3",
"merchant_payment_code": "80b83352839",
"order_number": null,
"status": "CO",
"status_date": "2017-11-27 19:31:43",
"open_date": "2017-11-27 19:31:43",
"confirm_date": "2017-11-27 19:31:43",
"transfer_date": null,
"amount_br": "100.38",
"amount_ext": "100.00",
"amount_iof": "0.38",
"currency_rate": "1.0000",
"currency_ext": "BRL",
"due_date": "2017-11-30",
"instalments": "1",
"payment_type_code": "visa",
"details": {
"billing_descriptor": "YOUR DESCRIPTOR"
},
"transaction_status": {
"acquirer": "EBANX",
"code": "OK",
"description": "Accepted",
"authcode": "82656"
},
"pre_approved": true,
"capture_available": false
},
"status": "SUCCESS"
}Congratulations!
You have completed the necessary steps to integrate Google Pay.
Resources
Use the following resources when testing in your sandbox environment.
Sample Cards
Click here to view mock card data to validate your payment integration.
API Reference
Click here to access detailed API documentation to integrate efficiently.
Mock Customer Data
Click here to view mock customer data for testing and validating user flows.
Error Codes
Click here to review common error codes to troubleshoot and resolve issues quickly.
Still need help?
We hope this article was helpful. If you still have questions, you can explore the following options:
- Merchant support: Contact our support team at sales.engineering@ebanx.com for assistance.
- Not a partner yet? Please complete the Merchant Signup Form, and our commercial team will reach out to you.