Before you start integrating the Google Pay SDK with your app, you need to have the following setup.
Prerequisites
Make sure you fulfill the following prerequisites before you get started:
- Your device must have Android version 21.
- Your device must have Google Play Services version 12.6.00 or higher.
- You must be onboarded on the Google Pay for Business program.
Set up Google Pay app.
- Provide your Gmail account(s) to your Google representative to get allowlisted, and to get access to the Google Pay SDK.
- Install the Google Pay app from Play Store.
Add a UPI form of payment.
- Businesses must be set up to accept UPI, and must be verified merchants by NPCI/banks.
- Ensure that you have the required APIs from your bank to check the status of a payment.
- Note that every transaction should use a unique transaction ID.
Ensure that your (merchant’s) VPA is allowlisted by the Google Pay team.
Configure your project
Add the Google maven repository to the top level
build.gradle
file of your project.allprojects { repositories { google() ... } }
Add the following app dependencies to the
build.gradle
file in the app module.dependencies { implementation 'com.google.android.gms:play-services-tasks:15.0.1' ... }
Android 11 requirements
Merchants targeting API level 30+ and running on Android 11 will only be able to see a few apps. For more details, see here.
Merchants have to make changes to their manifest files in order to access a set of other installed apps on the device that they intend to access. For more details, see here.
To include Google Pay app, include the package name in <package>
elements
inside the <queries>
element.
<manifest package="com.example.merchantapp">
<queries>
<package android:name="com.google.android.apps.nbu.paisa.user" />
</queries>
</manifest>