Introduction
Google Pay allows customers to make secure payments with any stored credit or debit card in one or two clicks. This is great for increasing conversion rates on your website.
You will need to register with Google for your site here to ensure full integration can be completed. Google will provide you a MerchantID for the integration.
Supported Integrations
Google Pay is available in the following integration options:
- COPYandPAY (hosted checkout) – our full Google Pay documentation link.
- Server-to-Server
COPYandPAY
Integrating the Google Pay button via our COPYandPAY payment widget is simple and just like loading any other payment brand in COPYandPAY. In step 2 of our COPYandPAY documentation, GOOGLEPAY must be specified as the brand. For example:
<form action="{shopperResultUrl}" class="paymentWidgets" data-brands="VISA MASTER GOOGLEPAY"></form>
The mandatory fields for Google Pay are:
wpwlOptions.googlePay.gatewayMerchantId // This is your EntityID provided by Qashpay.
wpwlOptions.googlePay.MerchantId // A Google merchant identifier issued after your website is approved by Google.
On the Cart Page (Fast Checkout)
Sometimes you might want to display the Google Pay button early in the payment workflow where you do not yet have a checkout ID. Usually, the shopper can decide whether to continue with the normal checkout or to immediately pay with Google Pay. It is possible to display the Google Button first and create a checkout ID later.
- In step 2 of our COPYandPAY documentation, use paymentWidgets.js without a checkout ID.
- Then define a callback function in wpwlOptions.createCheckout to create a checkout.
We will call the callback function once the Google Pay button is clicked. The function should return a checkout ID or a promise that will return a checkout ID. Specifically, the returned object can be any object.
You can see the full documentation on Fast Checkout here.
Customisation Options
You can modify the Google Pay behaviour by using wpwlOptions.googlePay and any of the parameters here.
Server-to-Server
There are two possibilities for server-to-server Google Pay integration
- With the encrypted payment token, or
- with decrypted card information.
With the Encrypted Payment Token
You can send the encrypted payment token from Google Pay as it is. It will be as below:
paymentBrand=GOOGLEPAY
googlePay.paymentToken={ ... } // is the JSON (payment token) received from the Google Pay API
With Decrypted Card Information
You can do the decryption yourself and send the decrypted card information with the usual card API. An example of the fields are below:
paymentBrand=GOOGLEPAY
card.number=4200000000000000
card.expiryMonth=05
card.expiryYear=2027
threeDSecure.verificationId=ABiKYvXjhcB7AAc+K04XAoABFA==
threeDSecure.eci=07
googlePay.source=webSupport
Qashpay are on hand to help with any issues you may have with your GooglePay integration. Please get in touch via our help centre live chat, or via email at support@qashpay.com.
Comments
0 comments
Please sign in to leave a comment.