Google Pay

Google Pay is a digital wallet platform and online payment system that allows users to store their credit and debit cards, and other payment methods in the app to make purchases online and in stores.

Google Pay should be enabled from the tap side before using it on the Merchant side.

It's currently supported in UAE, KSA, and KW, with currencies AED, SAR, and KWD, respectively, and USD is an addition.
"We keep adding more countries and currencies. For more updates, please keep in touch with TAP support teams"


Integration with Google Pay

Google Pay integration depends on the UI mode chosen by the merchant.


Web-based [redirect/popup]

It doesn't require any configuration from the merchant's side. The Google Pay option will appear on our hosted payment page or popup window automatically. Customers can choose and make a payment.


Web-based [iframe]

Tap iFrame/embedded form does not support the Google Pay option. So, merchants can add a separate button for Google Pay on the checkout page for the customers' choice.

The button can be integrated with the backend APIs, as explained below

Google Pay Integration Google References

When you follow google example in the link above you will find an object named tokenizationSpecification and inside that object you will find another object called parameters you have to pass the keyword tappayments in the gateway and your MID with tap inside gatewayMerchantId like below

const tokenizationSpecification = {
      type: "PAYMENT_GATEWAY",
      parameters: {
        gateway: "tappayments",
        gatewayMerchantId: "your MID",
      },
    };

After you send the request you will get the token data in the response under paymentData.paymentMethodData.tokenizationData.token as per the example in google pay documentation.


Mobile-based

You can follow our documentation on github for Google Pay integration with full details.

API Call for tokenizing the data that comes from the google pay callback function, as below:

API request

Sample request

curl --location --request POST 'https://api.tap.company/v2/tokens' \
--header 'Authorization: Bearer sk_test_jrJQTIMVt9oY0FNyEbCguXXX' \
--header 'Content-Type: application/json' \
--data-raw '{
    "type": "googlepay",
    "token_data": {
        "signature": "MEUCIQCgAIHrd65KhLQR4KMDqwfSYyjdF/rKUQG7eVPAP2NIuAIgWcA02MjvXAD9Xo4u2O6gl6PBjNNJeLTNy++paOGE3nE=",
        "intermediateSigningKey": {
            "signedKey": "{\"keyValue\":\"/uCLf1SqYc4feUicYPJSIu1djT3RQXe/71W50TegMLcs94OScACGtOPaiJmZwUPxCA\\u003d\\u003d\",\"keyExpiration\":\"1663134862361\"}",
            "signatures": [
                "MEYCIQDf7b5O3xatEfZu9aK1+IebTs1N2otF++MtdgwitZK6iUf2hNdb4XXut+k5H8tHj"
            ]
        },
        "protocolVersion": "ECv2",
        "signedMessage": "{\"encryptedMessage\":\"8tW8iQuL8dOyZ1+OhZMMzVXFggBsE2dKobOsNw00nOQI7JuY7Zfqq4kbae+o48HoXDayEHkjFlnXW/QZBIHBqWgrMce9LJj+jnYTN7WcAAxLNbwf3leZs+zV7GMV+0aMAsOOdvKdurCg7LBIDJZeNbMyomtp9HqQ+paLjgxqtvOGnZ5jJoYMTQqOR+qdFmxvsOqhHZHtiRvdTQi8Z9p9+jvbn28M0DRle1COyQOrhnOVZ7RUu1kYaMm7cOxeXbXP4CuuCb2EQZ\",\"ephemeralPublicKey\":\"BPYdAC923D/jRypCseOUA9bersY0i\\u003d\",\"tag\":\"UcPrx3j4NzXy38/pKZ4nXEViVSKacXEQpxeRxqdkZPU\\u003d\"}"
    },
    "client_ip": "192.168.1.20"
}'

API Response

A token_id is expected in the API response, and it also contains the card information.


{
   "id": "tok_zMMQ40227330XHU6SXXXXX",
   "created": 1662449620276,
   "object": "token",
   "live_mode": false,
   "type": "GOOGLEPAY",
   "used": false,
   "card": {
       "id": "card_3snF4022733eqh56yL8E279",
       "object": "card",
       "funding": "CREDIT",
       "fingerprint": "FEAWi7M8%2BpIXbsraeWsHfuMOg2AeIpG5Pp2wkf4LHPU%3D",
       "brand": "VISA",
       "scheme": "VISA",
       "exp_month": 12,
       "exp_year": 2027,
       "last_four": "3478",
       "first_six": "489537"
   }
}

   "type": "googlepay"

}

Charge the Token

Sample to control the source object in the charge API: with "token_id"

{
...
	"source": {
		"id": "tok_zMMQ40227330XHU6SXXXXX"
    }
"post": {
    "url": "https://webhook.site/fd8b0712-d70a-4280-8d6f-9f14407b3bbd"
     },
 "redirect": {
    "url": "https://customer.redirection_url"
     }
...
}

If 3Ds card, the API response would be INITIATED, and then it processes the further authentication.

If a Non-3Ds card is used in the google pay token, payment will be directly CAPTURED in the API response (Not Initiated).