This page's content:

AVAILABLE ONLY IN BRAZIL

One integration with many possibilities

There are millions of people using Google Products, and with the Google Pay integration, your customers won’t need to fill in all of their payment details each time that they make a purchase on your website.

Integration with Google Pay will increase your conversions and also offer a seamless checkout experience for the user.

With Google Pay your customers can pay for their purchases with the cards and information already saved in their Google Accounts, along with data saved on their Android Pay, Chrome and YouTube accounts.

View our step by step instructions for integration.

Integrate with Google Pay

To start processing payments with Google Pay, you need to integrate with Google via Web or SKD.

During the integration you will see that some parameters are required to process Google Pay through EBANX, these include:

  • Information for gatewayMerchantId – You will need to access your Dashboard Account, click on your “Username”, then on “Account Settings” and on “Integration”. It is the way you will see your gateway merchant ID in the “Secret Keys” area. If you have any questions, send an email to the Integration Team;

  • The parameter gateway should be filled with ebanx;

  • Mandatory fields: Name, address, phone, and email.

Pay attention: The CPF (government issued identification document in Brazil) is not a mandatory field for Google, and it can be requested in two ways: 1. Before clicking on pay with “Google Pay” OR   2. After filling all the fields but before finishing the purchase.

Otherwise, the CPF is obligatory for EBANX, so don’t forget to ask your customer about it, because Google will not provide it to you otherwise.

Change your server side

When you finish the integration with Google, you will have all the necessary information to continue and generate a payment with EBANX.

So, after you receive the customer’s information sent from Google and build the request body, make sure to send the “token” that you received from Google in the google_pay parameter like the example below.

Important to know: This parameter expects a string, so there’s no need to parse it to JSON.
Copy
curl -X POST 'https://api.ebanxpay.com/ws/direct'\
  -d 'request_body={
  "integration_key": "your_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": "visa",
      "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\\\ "}\"}"
    }
  }
}'

A successful request will return a JSON expression similar to the one below.

Copy
{
  "payment": {
    "hash": "5a1c6820f28a2fd24c11a1dcde32e79c01c9814b66183cc3",
    "pin": "467872297",
    "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"
}

Go live

Before starting to process payments with Google Pay and EBANX, do not forget to get in touch with our Integration Team to test and be sure that you are ready to go live!