Accept Google Pay™ with Buya

Google Pay™ is a digital wallet provided by Google. With Google Pay, your customers can tap to pay on a payment terminal, and safely pay in websites and mobile apps.

  1. Streamline Checkout

    Google Pay customers can reuse previously saved payment methods, eliminating the need to enter the payment details over and over again on every website. This makes the checkout process quick and painless, and increases the chances of the customer completing the payment.

  2. Improve Conversion

    Google Pay is integrated into supporting Android mobile devices and the popular Chrome browser. Google Pay provides a native look and feel your customers are familiar with on their own personal device. Merchants that use Google Pay can benefit from this trust and improve the conversion of their checkout process.

  3. Authenticated Payment

    Google Pay authenticates the customer with a fingerprint, PIN code, facial recognition or other forms, depending on the platform and the device capabilities. Just like 3-D secure, authenticated payments with Google Pay may prevent merchants from being liable for any chargebacks.

Integration Guide

Before you start

Create a new business in the Google Pay Business Console and obtain your Google Pay Merchant ID. See Request production access for more information about the approval process and how to obtain your Google merchant identifier.

Register with Buya and get your Buya Merchant ID.

Google Pay Web Integration

If you plan to accept Google Pay on your website, refer to the Google Pay Web developer documentation, Google Pay Web integration checklist and Google Pay Web Brand Guidelines.

Note that you will need to register your website in the Google Pay Business Console and submit for approval.

To accept a payment with Google Pay using Buya, follow these steps:

  1. Load the Google Pay script
    <script src="https://pay.google.com/gp/p/js/pay.js"></script>
  2. Create a new PaymentsClient
    Make sure to provide the Google Pay Merchant ID you obtained from the Google Business Console.
  3. Prepare a PaymentDataRequest with the transaction details
    Make sure to provide the following values for tokenizationSpecification:
    tokenizationSpecification: {
        type: 'PAYMENT_GATEWAY',
        parameters: {
                gateway: 'buya'
                gatewayMerchantId: '<your Buya merchant ID>'
        },
    },
  4. Use PaymentClient.loadPaymentData with your payment data request to prompt the user for payment
    At this point the user will be presented with a Google Pay payment window, and will be asked to either fill in their payment card info, or select a previously added payment card.
  5. Extract the payment token from the PaymentData response If the payment was successful you will receive a PaymentData in the response. From the response, obtain the token from tokenizationData.token.
  6. Create a Charge with Buya Pass the token to your backend server, and use the Buya API to create a new Charge using the “googlepay” payment method. Buya supports both charge and authorization requests using Google Pay payment tokens.

Google Pay Android Integration

If you plan to accept Google Pay on an Android app, refer to the Google Pay Android developer documentation, Google Pay Android integration checklist and Google Pay Android brand guidelines.

Note that you will need to register your Android app in the Google Pay Business Console and submit for approval.

To accept a payment with Google Pay and Buya, follow these steps:

  1. Follow the Google Pay tutorial for Android
    Make sure to provide the following parameters to gatewayTokenizationSpecification:
    private static JSONObject getGatewayTokenizationSpecification() throws JSONException {
        return new JSONObject() {{
            put("type", "PAYMENT_GATEWAY");
                put("parameters", new JSONObject() {{
                    put("gateway", "buya");
                    put("gatewayMerchantId", "<your Buya Merchant ID>");
                }});
        }};
    }
  2. Extract the payment token from the paymentData response
    If the payment was successful you will receive a payment token in the response. From the response, obtain the token from tokenizationData.token.
  3. Create a Charge with Buya
    Pass the token to your backend server, and use the Buya API to create a new Charge using the "googlepay" payment method. Buya supports both charge and authorization requests using Google Pay payment tokens.

Additional Guidelines and Limitations

To use Buya for processing Google Pay payments you must register with Buya, and have a Buya Merchant ID

Buya supports the following allowed auth methods:

Buya supports the following card networks:

To perform billing address verification (AVS), set the following card parameters:

{
    // ...
    "allowedPaymentMethods": [{
        "type": "CARD",
        // ...
        "parameters": {
            // ...
            "billingAddressRequired": true,
            "billingAddressParameters": {
                "format": "FULL",
                "phoneNumberRequired": false
            }
        },
    }
}

You are now ready to accept payments using Google Pay and Buya!