- Show Google Pay as a separate option.
- Trigger payment when the user clicks Google Pay at your checkout.
-
Collect Request Flow: This flow is available on desktop and mobile browsers. The customers enter their Google Pay VPA on the checkout form. Upon triggering a payment request via Razorpay’s
upimethod, the Collect request reaches the customer’s Google Pay application. The customer then completes the payment. - Intent-based Payment: This flow is applicable only to mobile and mobile-web payments. In these cases, the customer is redirected to Google Pay’s application to complete the payment. Intent-based payments are available on the Android SDK and on Google Chrome for Android (v56 and above, but not on Google Chrome WebViews).
Prerequisites
- Sign up for a business account with Google Pay.
- Contact our Support Team and have them whitelist your VPA (UPI ID).
- Verify your VPA (UPI ID) details on the Google Merchant Console. Google deposits a small amount into the bank account linked to your VPA (UPI ID).
- You should have already integrated one of the following:
- Generate API Keys from the Dashboard.
General Branding Guidelines
Refer to Google’s Branding Guidelines to learn about the general branding guidelines for Google Pay on the front-end of your websites and apps.Desktop Integration
On desktop browsers, the Collect request flow works the same way as Razorpay’s UPI.- Collect the customer’s VPA and pass it in the payment request with method as
upi. - Razorpay then triggers a Collect request. The collection request is sent to the customer’s Google Pay application where they can make the payment.
Mobile-Web Integration (Google Chrome)
Handy TipsAs the APIs exposed by Google Pay are available only in Chrome’s JavaScript engine, you will need to use our JavaScript-based integration.
Detect Google Pay Installation on Device
-
Add Razorpay.js to your website
Know more about Custom Web Integration.
-
Instantiate Razorpay
-
Detect if Google Pay on available on the device
Initiate Payment Using Google Pay
-
Create a payment through Google Pay. Skip passing the
vpafield in the payment data and pass{ gpay: true }as the second argument tocreatePayment.
Android Integration
Intent-Based Integration
On Android, for intent-based payments, first you need to check if Google Pay is installed on the user’s device. You can use therazorpay.getAppsWhichSupportUpi method to retrieve the list of apps that support intent-based payments installed on a phone.
When a user selects Google Pay as the payment method, you need to submit the Google Pay’s package name along with other checkout options to the Razorpay function razorpay.submit:
Intent-Based Integration Using Google Pay SDK
You also have the option to integrate Google Pay with the Custom Checkout on your Android app using Google’s SDK. This offers the advantage of letting you open Google Pay within your application for customers to make the payment without any redirection, improving the user experience.Collect-Based Integration
This is the same as the existing UPI Collect Integration.- Collect the customer’s VPA and pass it in the payment request, with method as
upi. - Razorpay then triggers a collect request. The collection request is sent to the customer’s Google Pay application, where they can make the payment.
Restricted MCC Codes
MCC Code | Category
5816 | Digital Goods: Games
6540 | POI Funding Transactions (excluding MoneySend)
4812 | Telecommunication Equipment and Telephone Sales
4814 | Telecommunication Services
7408 | Lending Platform
6513 | Real Estate Agents and Managers - Rentals
7995 | Betting/Lottery
5412 | Grocery Stores, Supermarkets
5413 | Grocery Stores, Supermarkets To integrate Google Pay with the Checkout on your Android app using Google’s SDK:- Download the Google Pay SDK and add the
.aarfiles to the application library.
Handy TipsThe Razorpay-Google Pay SDK acts as a wrapper over the native Google-SDK. This SDK connects Razorpay’s SDK with the Google SDK. You need all the 3 SDKs (listed below) for the flow to work.
- Razorpay Android SDK
- Google Pay SDK
- Razorpay-Google Pay SDK
-
Add the following lines of code to the
build.gradlefile of your application:build.gradle