Set up Google Pay™ integration

Before you begin, review Get started with Google Pay integration to understand how Google Pay works with CentroBill.

CentroBill does not provide a hosted checkout solution for Google Pay. You must implement the Google Pay Web integration on the client side, then send the encrypted payment token to CentroBill using the /payment endpoint.

Review payment flow before you start

🚧

Client-side integration requirement: you must load the Google Pay JavaScript library and implement readiness checks using isReadyToPay before displaying the Google Pay button.

The Google Pay payment process through CentroBill follows these steps:

  1. The customer selects Google Pay at checkout.
  2. Google Pay returns an encrypted payment payload containing the customer's payment credentials.
  3. You securely send the encrypted payload to the CentroBill payment API.
  4. CentroBill decrypts the payload within a PCI DSS-compliant environment.
  5. The transaction is submitted for authorization.
  6. If required, 3D Secure authentication is triggered.
  7. CentroBill returns the authorization result.
📘

You never handle raw card data.


Add JavaScript library

Include the Google Pay JavaScript library on your checkout page:

<script async
  src="https://pay.google.com/gp/p/js/pay.js"
  onload="onGooglePayLoaded()">
</script>

Define request objects

Google Pay requests are built using the following objects:

  • merchantInfo — production merchant identification
  • allowedPaymentMethods — card method configuration, including allowedCardNetworks
  • isReadyToPayRequest — checks whether the customer can pay using Google Pay
  • PaymentDataRequest — requests the encrypted payment token and payment details

merchantInfo

You must define merchantInfo on the client side. In production:

merchantId is your Google-assigned Merchant ID from the Google Pay & Wallet Console. Register in the Google Pay & Wallet Console to obtain this value.

merchantName is your display name.

{
  "merchantInfo": {
    "merchantId": "01234567890123456789",
    "merchantName": "Your Merchant Name"
  }
}
📘

merchantId (Google-assigned) is separate from CentroBill’s gatewayMerchantId.

allowedPaymentMethods (CARD)

allowedPaymentMethods defines how Google Pay should process card payments. You use this object in both isReadyToPayRequest and PaymentDataRequest.

{
  "allowedPaymentMethods": [
    {
      "type": "CARD",
      "parameters": {
        "allowedAuthMethods": ["PAN_ONLY", "CRYPTOGRAM_3DS"],
        "allowedCardNetworks": ["VISA", "MASTERCARD", "MAESTRO"],
        "billingAddressRequired": true,
        "billingAddressParameters": {
          "format": "MIN",
          "phoneNumberRequired": true
        }
      },
      "tokenizationSpecification": {
        "type": "PAYMENT_GATEWAY",
        "parameters": {
          "gateway": "centrobill",
          "gatewayMerchantId": "YOUR_CENTROBILL_MERCHANT_ID"
        }
      }
    }
  ]
}
  • allowedCardNetworks must include only networks supported by CentroBill (Visa, Mastercard, Maestro).
  • allowedAuthMethods must include PAN_ONLY, CRYPTOGRAM_3DS or both, depending on your acceptance requirements.
  • tokenizationSpecification must specify CentroBill as the gateway and include your CentroBill gatewayMerchantId.
  • billingAddress you can request billing address details through Google Pay to support fraud prevention and verification. If you require a billing address, include these parameters:

"billingAddressRequired": true,
"billingAddressParameters": {
  "phoneNumberRequired": true,
  "format": "MIN"
}

You are responsible for ensuring that the customer data you collect complies with applicable privacy regulations. For more details, see billingAddressParameters.

isReadyToPayRequest (readiness check)

You should call isReadyToPay() before showing the Google Pay button.

This ensures that Google Pay is available for the customer and avoids showing a payment option they cannot use.

{
  "apiVersion": 2,
  "apiVersionMinor": 0,
  "allowedPaymentMethods": [
    {
      "type": "CARD",
      "parameters": {
        "allowedAuthMethods": ["PAN_ONLY", "CRYPTOGRAM_3DS"],
        "allowedCardNetworks": ["VISA", "MASTERCARD", "MAESTRO"]
      }
    }
  ]
}
paymentsClient.isReadyToPay(isReadyToPayRequest)

PaymentDataRequest (request the payment token)

When the customer clicks the Google Pay button, build a `PaymentDataRequest object that includes:

  • allowedPaymentMethods (with CentroBill tokenization)
  • **transactionInfo **(amount, currency, country)
  • merchantInfo (with your Google Merchant ID in production)

After Google Pay returns the response, extract the encrypted token from: paymentMethodData.tokenizationData.token . Then send it to CentroBill as described in Send encrypted token to CentroBill.

{
  "apiVersion": 2,
  "apiVersionMinor": 0,
  "allowedPaymentMethods": [
    {
      "type": "CARD",
      "parameters": {
        "allowedAuthMethods": ["PAN_ONLY", "CRYPTOGRAM_3DS"],
        "allowedCardNetworks": ["VISA", "MASTERCARD", "MAESTRO"],
        "billingAddressRequired": true,
        "billingAddressParameters": {
          "format": "MIN",
          "phoneNumberRequired": true
        }
      },
      "tokenizationSpecification": {
        "type": "PAYMENT_GATEWAY",
        "parameters": {
          "gateway": "centrobill",
          "gatewayMerchantId": "YOUR_CENTROBILL_MERCHANT_ID"
        }
      }
    }
  ],
  "transactionInfo": {
    "totalPriceStatus": "FINAL",
    "totalPrice": "10.00",
    "currencyCode": "USD",
    "countryCode": "US"
  },
  "merchantInfo": {
    "merchantId": "01234567890123456789",
    "merchantName": "Your Merchant Name"
  }
}

Choose authorization method

CentroBill supports the following Google Pay authorization methods:

  • PAN-ONLY
  • CRYPTOGRAM_3DS

PAN_ONLY

PAN_ONLY represents the customer's underlying physical card credentials stored within Google Pay. Transactions using PAN_ONLY are processed similarly to standard card-not-present payments. CentroBill applies fraud detection and risk evaluation to these transactions.

  • 3DS required: yes, standard 3DS flow applies.
  • Supported countries: US, Canada, and Japan.
📘

3D Secure may be triggered dynamically based on transaction risk.

CRYPTOGRAM_3DS

CRYPTOGRAM_3DS represents tokenized virtual card credentials stored on the device and authenticated by Google. These transactions typically provide stronger customer authentication and generally do not require additional step-up verification. However, CentroBill reserves the right to apply additional authentication when required by regulation or risk controls.

  • 3DS required: no, authentication is performed by Google Pay.
  • Supported country: US only.

Review CentroBill 3D Secure behavior

CentroBill uses a risk-based approach to authentication. The same criteria used for standard e-commerce card transactions also apply to Google Pay PAN_ONLY transactions.

Transactions are evaluated in real time using multiple risk signals, including (but not limited to):

  • Transaction amount
  • Device data
  • Merchant profile
  • Behavioral indicators

If a transaction exceeds predefined risk thresholds, 3D Secure authentication is initiated automatically. This ensures regulatory compliance while minimizing friction for legitimate customers.

Check when 3D Secure is triggered

Risk level3D Secure behavior
Low riskFrictionless authentication may be applied
Medium risk3D Secure may be triggered
High riskStep-up authentication is required

Process payments (via tokenization)

To process Google Pay payments through CentroBill, configure the tokenizationSpecification object as follows:

gateway — identifier assigned to CentroBill during Google technical onboarding. Set this value to centrobill.

gatewayMerchantId — a unique merchant identifier provided by CentroBill. Contact CentroBill support to obtain your merchant ID.

{
  "tokenizationSpecification": {
    "type": "PAYMENT_GATEWAY",
    "parameters": {
      "gateway": "centrobill",
      "gatewayMerchantId": "YOUR_MERCHANT_ID"
    }
  } 
}

Send encrypted token to CentroBill

After the customer authorizes a Google Pay payment, send the encrypted token to CentroBill using the /payment endpoint. Extract the encrypted token from the paymentMethodData.tokenizationData.token property of the PaymentData response object.

POST /payment
{
  "paymentSource": {
    "type": "googlePay",
    "token": "{GOOGLE_PAY_ENCRYPTED_TOKEN}"
  },
    ... 
}

CentroBill handles:

  • Payload decryption
  • Network authorization
  • Authentication orchestration
  • Fraud screening

Set allowed card networks

You must define the card networks you accept in the allowedCardNetworks object, based on the card networks implemented during technical onboarding with Google.

CentroBill supports VISA, Mastercard, and Maestro card networks with the Google Pay API. You can define these values in the allowedCardNetworks property using values listed in Google Pay's web developer documentation and Google Pay's Android developer documentation. Make sure your configuration matches your onboarding setup, including any additional network variables such as the settlement country.


Apply branding guidelines

You must use official Google Pay brand assets in accordance with:

❗️

Do not modify:

  • Button appearance
  • Colors
  • Proportions
  • Logo

If you offer Google Pay as a payment method to your customers, you must use the official Google Pay logo and button assets in compliance with the brand guidelines listed above, without modifications to the Google Pay asset colors, proportions, or appearance.

Always display Google Pay as a supported payment method where enabled.


Complete your integration checklist

If you integrate Google Pay through CentroBill, you must:


Support

For onboarding assistance, contact CentroBill Support at [email protected]