Before you begin
To prepare your app, complete the steps in the following sections.
App prerequisites
Make sure that your app's build file uses the following values:
- A
minSdkVersion
of19
or higher - A
compileSdkVersion
of28
or higher
Set up your app in your Google Pay account
- Install the Google Play services version 19.2.1 or greater.
- Install the Google Pay app and add a payment method.
- Add a payment method to Google.
- Adhere to our Google Pay API Acceptable Use Policy and the Google Play developer policy.
Configure your app
To configure your app, complete the steps in the following sections.
App dependencies
In your project-level build.gradle file, include Google's Maven repository
and Maven central repository in both your
buildscript
and allprojects
sections:
buildscript { repositories { google() mavenCentral() } } allprojects { repositories { google() mavenCentral() } }
Add the Google Play services
dependency for the Google Pay API to your module's Gradle build file,
which is commonly app/build.gradle
:
dependencies { implementation 'com.google.android.gms:play-services-wallet:19.2.1' }
Modify your manifest
To enable Google Pay in your app, you need to add the following Google Pay API
meta-data element
to the
<application>
element of your project's
AndroidManifest.xml
file.
<meta-data android:name="com.google.android.gms.wallet.api.enabled" android:value="true" />