Set up Google Pay API
Stay organized with collections
Save and categorize content based on your preferences.
Before you begin
To prepare your app, complete the steps in the following sections.
App prerequisites
To use the Google Pay API on Android, your app must be:
- Distributed through the Google Play store.
- Built using the following configuration:
- A
minSdkVersion
of 21
or higher
- A
compileSdkVersion
of 34
or higher
Set up your app and your Google Pay account
To configure your app, complete the steps in the following sections.
App dependencies
Add the Google Play services
dependency for the Google Pay API to your module's Gradle build file
(typically app/build.gradle
or app/build.gradle.kts
):
Groovy
dependencies {
implementation 'com.google.android.gms:play-services-wallet:19.4.0'
}
Kotlin
dependencies {
implementation("com.google.android.gms:play-services-wallet:19.4.0")
}
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" />
Except as otherwise noted, the content of this page is licensed under the Creative Commons Attribution 4.0 License, and code samples are licensed under the Apache 2.0 License. For details, see the Google Developers Site Policies. Java is a registered trademark of Oracle and/or its affiliates.
Last updated 2024-07-02 UTC.
[{
"type": "thumb-down",
"id": "missingTheInformationINeed",
"label":"Missing the information I need"
},{
"type": "thumb-down",
"id": "tooComplicatedTooManySteps",
"label":"Too complicated / too many steps"
},{
"type": "thumb-down",
"id": "outOfDate",
"label":"Out of date"
},{
"type": "thumb-down",
"id": "samplesCodeIssue",
"label":"Samples / code issue"
},{
"type": "thumb-down",
"id": "otherDown",
"label":"Other"
}]
[{
"type": "thumb-up",
"id": "easyToUnderstand",
"label":"Easy to understand"
},{
"type": "thumb-up",
"id": "solvedMyProblem",
"label":"Solved my problem"
},{
"type": "thumb-up",
"id": "otherUp",
"label":"Other"
}]