Google Pay™

GPay Integration

Table of Contents


GooglePay is a type of Digital Wallet and acts as a virtual Payment Device, by allowing C9PG access to logged in customers’ payment information, stored in their Google Account.

C9PG uses secure credentials to obtain the payment data, which is then used with the relevant merchant account.

The merchant account is selected normally, with the GMID.

Here is an example of the Google Pay JSON transaction:



Getting Started with Google Pay

The first step is to register with the Google Pay Business Console and receive a Google merchant ID.  Please, contact us for more info


C9PG Google Pay Sample Code

   window.onload = function() {
   // console.log(document.getElementById(“gtid”));
  var localBaseRequest = {
     “Medium”: “Credit”,
     “CardPresent”: “N”,
     “GMID”: “2001008149”,
     “GTID”: “GT3010023905”,
     “MerchantID”: “123456”,
     “MerchantName”: “Cloud9”,
     “TransType”: “Sale”,
     “MainAmt”: “16000”,
     “TipAmt”: “0”
  let targetOrigin = ‘’;
  // send message to checkout
  window.frames[0].postMessage(JSON.stringify(localBaseRequest), targetOrigin);

window.addEventListener(‘message’, function(e) {
  console.log(“receive data from cloud9”);
  var obj = JSON.parse(;
  alert(“Transaction: ” + obj.Status +
    “\n” +
<div class=”button”>
  <iframe src=”” allowpaymentrequest=”true” sandbox=”allow-popups allow-same-origin allow-scripts” frameborder=’0′ scrolling=”no” referrerpolicy=”origin-when-cross-origin”>


Integration Instructions

1. Register with Google to get your Merchant Id & Merchant Name for Google Pay.
2. Embed C9PG GooglePay code into your web page
3. Post the base request to C9PG. The request need contains basic information (GMID,GTID,MerchantID,MerchantName, MainAmt, InvoiceNumber, TransType, Medium)

Additional Integration Info

Low Level Demo

This demo allows you to work with low level Google Pay API:
The following code illustrates a complete simple Google Pay turnaround

Sample C9PG Google Pay Web Page

To view source, right click and select “View Source”.

Configuring C9PG Google Pay Interface

  const tokenizationSpecification = {
        type: 'PAYMENT_GATEWAY',
        parameters: {
            'gateway': 'c9pg',
            'gatewayMerchantId': 'xxx'

Supported Card Networks

Visa, Mastercard, American Express, Discover, JCB

const allowedCardNetworks = ["AMEX", "DISCOVER", "INTERAC", "JCB", "MASTERCARD", "VISA"];

Supported Authorization Methods

Allowed Transaction Type SALE, PAN ONLY

const allowedCardAuthMethods = ["PAN_ONLY"];

Important: By using our SDK, you agree to  Google Pay APIs Acceptable Use Policy and accept the terms defined in the Google Pay API Terms of Service.

Scroll to Top