Integration Guide

Technical architecture of Google Pay inside Gateway checkout

Important The merchant does not build a separate Google-hosted Google Pay flow. Gateway fully renders and controls Google Pay inside the Gateway checkout.
1. Architecture

Gateway checkout (hosted or iframe) is responsible for:

  • evaluating Google Pay requirements based on session, device, browser, merchant configuration, and routing rules;
  • rendering the Google Pay button when all requirements are met;
  • opening the Google Pay payment window;
  • receiving the Google Pay payload;
  • sending payment data to the acquirer or downstream processor.

The merchant site does not call the Google Pay API directly.

const button = paymentsClient.createButton({
  onClick: onGooglePayClicked
});
2. Eligibility and rendering rules

The Google Pay button is shown only when all conditions are met:

Google Pay availability depends on eligibility conditions including device, browser, merchant configuration, region, and Google Pay support.

  • Google Pay is enabled in the merchant account.
  • Session currency and country are supported.
  • Shopper device and browser are supported.
  • Routing rules allow Google Pay for the transaction.

The Gateway frontend evaluates these conditions and shows or hides the button accordingly.

3. Relative prominence rules

Each checkout session passes the following parameters to the Gateway frontend:

Parameter
Value
environment
TEST / PRODUCTION
apiVersion
2
apiVersionMinor
0
allowedCardNetworks
VISA, MASTERCARD
allowedAuthMethods
PAN_ONLY, CRYPTOGRAM_3DS
gateway
billmate
gatewayMerchantId
Value is provided by the Gateway during integration setup.
merchantName
Value is provided by the Gateway during integration setup.
countryCode
Value is provided by the Gateway during integration setup.
currencyCode
Value is provided by the Gateway during integration setup.
sessionId
Value is provided by the Gateway during integration setup.
checkoutToken
Value is provided by the Gateway during integration setup.
publicCheckoutKey / clientKey
Value is provided by the Gateway during integration setup.
3a. Tokenization specification

Each checkout session passes the following parameters to the Gateway frontend:

{
  "type": "PAYMENT_GATEWAY",
  "parameters": {
    "gateway": "billmate",
    "gatewayMerchantId": "YOUR_GATEWAY_MERCHANT_ID"
  }
}
3b. Full PaymentDataRequest
{
  "apiVersion": 2,
  "apiVersionMinor": 0,
  "allowedPaymentMethods": [{
    "type": "CARD",
    "parameters": {
      "allowedAuthMethods": ["PAN_ONLY", "CRYPTOGRAM_3DS"],
      "allowedCardNetworks": ["VISA", "MASTERCARD"]
    },
    "tokenizationSpecification": {
      "type": "PAYMENT_GATEWAY",
      "parameters": {
        "gateway": "billmate",
        "gatewayMerchantId": "YOUR_GATEWAY_MERCHANT_ID"
      }
    }
  }],
  "merchantInfo": {
    "merchantId": "YOUR_GOOGLE_MERCHANT_ID",
    "merchantName": "Merchant Name"
  }
}
3c. Google Pay client initialization
const paymentsClient = new google.payments.api.PaymentsClient({
  environment: 'TEST'
});
3d. Eligibility check
paymentsClient.isReadyToPay(request)
4. Frontend initialization

Gateway frontend initializes the Google Pay API client when the checkout page loads. The button is added to the Gateway checkout UI if eligibility checks pass.

5. Google Pay payment sheet invocation

Gateway frontend initializes the Google Pay API client when the checkout page loads. The button is added to the Gateway checkout UI if eligibility checks pass.

  • Gateway frontend calls loadPaymentData() with a configured PaymentDataRequest.
  • The Google Pay payment sheet opens in the browser.
  • The shopper selects a card and authorizes the payment.
  • Google returns a PaymentData object to the Gateway frontend.
6. Payload handling

Gateway frontend sends the PaymentData payload to Gateway backend via a secure call. The payload contains an encrypted payment token.

7. Token processing

The Gateway securely processes payment data according to its payment model and Google Pay requirements. The merchant does not access raw payment data.

The merchant does not handle or access raw payment data.

8. Submission to acquirer or processor

After token processing, Gateway backend submits payment data to the acquirer or downstream processor. Routing rules determine which provider receives the transaction.

Routing configuration is managed by Gateway. Contact the Gateway integration team for details specific to your setup.

9. Errors and retries
  • Shopper cancels the Google Pay payment sheet — no action needed, return to checkout.
  • loadPaymentData() fails — log the error and show a generic payment failure message.
  • Backend submission error — follow the standard Gateway error handling flow.
10. Logging and diagnostics

Gateway logs transaction events and errors. Raw card data and payment tokens are never logged. Logging scope is limited to data permitted under PCI DSS requirements.

11. Test vs production
Aspect
Test
Production
environment
TEST
PRODUCTION
gatewayMerchantId
Value is provided by the Gateway during integration setup.
Value is provided by the Gateway during integration setup.
Live charges
No
Yes
Google confirmation
Not required
Required
Definition of Done

Integration is considered complete when:

  • Google Pay button is rendered correctly
  • Payment sheet opens successfully
  • Payment token is received and processed
  • Transaction is completed successfully via Gateway