Google Pay for Web

Google Pay merchant application

Submit your company details through the Google Pay Business Console and await approval (typically takes 3-5 business days).

Google Pay merchant application configuration


  1. Bind your website domain to the approved merchant account.
  2. Provide a screenshot of the website’s Google Pay payment flow for review.
  3. Choose integration mode:
    1. Gateway mode (recommended): Process card data through an accredited payment gateway (OSL Pay has completed the payment gateway integration, so you don’t need to handle it), no need to submit PCI compliance materials.
    2. Direct mode (for PCI-certified merchants only): Directly connect to the card network, and merchants are responsible for completing PCI DSS compliance certification and configuring security certificates.

Web integration


  1. Google Pay official documentation: Google Pay API for Web
  2. Google Pay official tutorial: Google Pay API for Web

Server-side integration


  1. Invoke Google Pay Merchants can either construct Google Pay invoke parameters themselves following the Google Pay documentation or call OSL Pay’s API to obtain the invoke parameters. Use the OSL Pay API to fetch Google Pay invoke parameters (https://openapitest.osl-pay.com/api/v1/config/waken/query) to retrieve the following data:
{
    "provider": "google_pay",
    "data": {
        "environment": "TEST",
        "apiVersion": 2,
        "apiVersionMinor": 0,
        "allowedPaymentMethods": [
            {
                "type": "CARD",
                "parameters": {
                    "allowedAuthMethods": [
                        "PAN_ONLY",
                        "CRYPTOGRAM_3DS"
                    ],
                    "allowedCardNetworks": [
                        "AMEX",
                        "DISCOVER",
                        "INTERAC",
                        "JCB",
                        "MASTERCARD",
                        "VISA"
                    ],
                    "billingAddressRequired": true,
                    "billingAddressParameters": {
                        "format": "FULL",
                        "phoneNumberRequired": true
                    }
                },
                "tokenizationSpecification": {
                    "type": "PAYMENT_GATEWAY",
                    "parameters": {
                        "gateway": "checkoutltd",
                        "gatewayMerchantId": "pk_sbox_zgr63qrlpc41e2jiha37qyxikvax"
                    }
                }
            }
        ],
        "merchantInfo": {
            "merchantId": 12345674141234567890,
            "merchantName": "OSL PAY"
        },
        "transactionInfo": {
            "totalPriceStatus": "FINAL",
            "totalPriceLabel": "Total",
            "countryCode": "US"
        }
    }
}

  1. Retrieve the encrypted raw payment data for Google Pay The raw payment data format for Google Pay is as follows:
{
  "signature": "MEYCIQDoAM2OPXFVgtxLAohhXI8ohrj636MhPpZZRC5XnuNQFRepQIhAIUHULQ4Rsg5vvhu6b1oqPIv/KiY46opK0dP0tOM48AE",
  "intermediateSigningKey": {
    "signedKey": "{\"keyValue\":\"MFkwEwYHKo525ZIzj0CAQYIKoZIzj0DAQcDQgAEe+VE+/4EkzgZTsZ3n+DZrIDyEXKXr0NN66Np+cd1iAXdqDu672fuuehNHUhokvbvEOypnVFO11IRlBx8rpXtKA\\u003d\\u003d\",\"keyExpiration\":\"1753395565884\"}",
    "signatures": [
      "MEYCIQDSXC+znswX0fBNIACXiv+t212k5bI/bGPDIQ+Bubyd6436iAIhAK3RDIBg7phTz24zMZEsIxW9BCMnO7viJtfWY6zfqaC+"
    ]
  },
  "protocolVersion": "ECv2",
  "signedMessage": "{\"encryptedMessage\":\"+u3y1MkcFHmbPF53JEpsa8Ks5iOa1YwmnuEWQEAEd70dvhb2lWJ1Bg/iMCDGBqJt4JWPJeHI+SNP+A1ILxh4vunZkW6v/M/zlVN6EHbhIwGTMyAIHfyLV+zgskTyTkqUbC18Vv6mOcEd56sJr4P1C1NBYR6cI6AR03Q4qlg44VWYB3pjVZWEkF6joy6422ymcoEE7sra+IpuXTwCVjntFAb8JEWFqhHIWvlFBfN9A1UEu9LDvIQTX3VOwbL4vEzX2ROnQQZIP1EwlxDA+mqFIFGqk04kdcAkD9J9wy9Co7SS0Cw5hry7zxcIkpIROfj/TIjeFEMBf1QTfipyIEYWRYY7Pm7GlO3eH7XuV/eziRga+2HtBqNhwnRDAjGLIVkdyXkEPqTYhzWYa9ra9UKMt1khwbQBvCscM\\u003d\",\"ephemeralPublicKey\":\"BHvxY3vIuePLWAklgGFVI1xwu2w/Ovm8xucgU0HJqwqEc0kA9KFf2GQn0f0pUojUyRCi7LseTdALldnJoPqJmxI\\u003d\",\"tag\":\"0gK5cOx+gGTEKZ0m9erDAEirHTuGuqTpW3IpCQDCjMc\\u003d\"}"
}

  1. Retrieve Google Pay billing information The format for Google Pay billing information is as follows:
{
    "name": "John Doe",
    "address1": "c/o Google LLC",
    "address2": "1600 Amphitheatre Pkwy",
    "address3": "Building 40",
    "locality": "Mountain View",
    "administrativeArea": "CA",
    "countryCode": "US",
    "postalCode": "94043",
    "sortingCode": ""
}

  1. Pass Google Pay parameters to OSL Pay When placing an order, the merchant must pass Google Pay payment and billing information to OSL Pay. Some Google Pay billing fields have different field names from those used by OSL Pay and need to be mapped accordingly. The mapping rules are as follows:
name -> fullName
postalCode -> zip
administrativeArea -> state
locality -> city

Testing Google Pay


  1. Environment requirements:

    1. HTTPS protocol must be used.
    2. A Google account must be available for login.
    3. Payments must be made using a Mastercard or Visa card.
    4. The canMakePayments() method provided by the Google Pay API can be used to indirectly and accurately verify if all pre-configuration steps (including adding a payment card) have been completed.
  2. Testing steps using Google test cards in the testing environment

    • Log into your Google account in the browser.
    • Add a test card from the Test card suite

    • Join the user group.


    • After successful addition, testing can proceed. You can choose to exit the test group after testing (or remain in the test group if desired).

Using Google Pay Web in Android Apps

Option 1: WebView does not natively support Google Pay. The user will be redirected to the system browser to complete the Google Pay payment.

Option 2: Adjust WebView to support Google Pay. Using Android WebView