Google Pay for Android
Last updated: August 5, 2026
Accept Google Pay payments in your Android app with Flow for mobile, our pre-built, customizable payment user interface that you can embed directly into your mobile application. Flow enables you to accept payments using Checkout.com's global network of payment methods with a single integration.
- The customer opens the checkout screen.
- You perform a server-side request to create a payment session.
- You use the payment session data on the client side to create and render Flow for mobile.
- Flow for mobile displays the Google Pay payment method to the customer, if it's available on their device.
- When the customer taps Pay, Flow for mobile launches the Google Pay screen and performs the payment request.
- You receive a webhook notifying you of the payment status.
Make sure you have a test account with Checkout.com.
Create a public key and a secret key from the Dashboard, with the following key scopes:
- Public key –
payment-sessions:payandvault-tokenization - Secret key –
payment-sessions
To receive webhooks for the payment events, configure your webhook server.
Integrate with Flow for mobile before continuing.
Note
Google Pay has additional requirements you must adhere to.
In your project-level build.gradle file, add:
1repositories {2mavenCentral()34// Ensure the following Maven repositories are included, as they are specifically required for resolving Risk SDK dependencies:5maven { url = uri("https://jitpack.io") }6maven { url = uri("https://maven.fpregistry.io/releases") }7}
In your app-level build.gradle file, add:
1dependencies {2implementation 'com.checkout:checkout-android-components:$latest_version'3}
Google Pay support is included in the checkout-android-components package, so you don't need to add a separate dependency.
Add the Google Pay API to your Android manifest file. In your AndroidManifest.xml, add the following meta-data tag within the <application> element:
1<application>2<!-- Other application configuration -->34<meta-data5android:name="com.google.android.gms.wallet.api.enabled"6android:value="true" />78</application>
When the customer is ready to pay, send a server-side request to securely create a PaymentSession object. The PaymentSession contains the information required to handle all steps of the payment flow.
Note
Do not embed your secret key in your client-side code.
Call the Create a Payment Session endpoint.
Google Pay is processed as a card payment. The currency and billing.address.currency must be supported by Google Pay.
Information
Your base URL's {prefix} value is unique to your account and environment. To learn how to retrieve your base URLs for the sandbox and production environments, see API endpoints.
post
https://{prefix}.api.checkout.com/payment-sessions
1{2"amount": 1000,3"currency": "GBP",4"reference": "ORD-123A",5"billing": {6"address": {7"country": "GB"8}9},10"customer": {11"name": "Jia Tsang",12"email": "jia.tsang@example.com"13},14"success_url": "https://example.com/payments/success",15"failure_url": "https://example.com/payments/failure"16}
1{2"id": "ps_2Un6I6lRpIAiIEwQIyxWVnV9CqQ",3"payment_session_secret": "pss_e21237b4-214a-4e35-a35d-f33wkwo158f6"4}
The payment session response also determines which payment methods can be displayed to the customer. The response is determined by the customer's device, the customer's region, and the payment methods activated for your account.
To accept Google Pay, you must include a GooglePayFlowCoordinator in the flowCoordinators you pass to CheckoutComponentConfiguration, and forward the Google Pay activity result to CheckoutComponents.
- In the
ViewModelclass, create alateinitvariable ofCheckoutComponents, and expose a function to handle the Google Pay activity result:
1lateinit var checkoutComponents: CheckoutComponents23fun handleActivityResult(resultCode: Int, data: String) {4checkoutComponents.handleActivityResult(resultCode, data)5}
- In the
Activity#onCreatemethod, create aGooglePayFlowCoordinator, and passviewModel#handleActivityResultto it:
1val coordinator = GooglePayFlowCoordinator(2context = activity, // your activity context3handleActivityResult = { resultCode, data ->4viewModel.handleActivityResult(resultCode, data)5}6)78val flowCoordinators = mapOf(PaymentMethodName.GooglePay to coordinator)
Note
The activity object that you pass to GooglePayFlowCoordinator must implement ViewModelStoreOwner, ActivityResultRegistryOwner, and LifecycleOwner. A standard ComponentActivity or AppCompatActivity implements all three. If your activity object does not implement these interfaces, the creation of GooglePayFlowCoordinator fails, and the app throws an exception.
- Pass the
flowCoordinatorsback to theViewModel, and use them to create yourCheckoutComponentsinstance.CheckoutComponentsFactory#createis a suspend function, so call it from a coroutine:
1val config = CheckoutComponentConfiguration(2context = context,3paymentSession = paymentSession,4publicKey = publicKey,5environment = environment,6flowCoordinators = flowCoordinators,7)89CoroutineScope(Dispatchers.IO).launch {10try {11checkoutComponents = CheckoutComponentsFactory(config = config).create()12} catch (checkoutError: CheckoutError) {13handleError(checkoutError)14}15}
- Create a
googlePayComponent, and check that Google PayisAvailablebefore you render it.isAvailable()is also a suspend function:
1val googlePayComponent = checkoutComponents.create(PaymentMethodName.GooglePay)23lifecycleScope.launch {4if (googlePayComponent.isAvailable()) {5// Render it in a Composable function6googlePayComponent.Render()78// Or render it in a View based function9googlePayComponent.provideView(containerView)10}11}
Note
Render() and provideView() are alternative ways to display the component, one for Compose and one for View-based layouts. Use whichever matches your app's UI, not both.
You can listen to the existing onSuccess callback or onError callback to handle the payment response for Google Pay, alongside card and other payment method outcomes:
1val configuration = CheckoutComponentConfiguration(2context = context,3paymentSession = paymentSession,4publicKey = publicKey,5environment = environment,6flowCoordinators = flowCoordinators,7componentCallback = object : ComponentCallback {8override fun onSuccess(component: PaymentMethodComponent, paymentId: String) {9// Payment completed — navigate to confirmation screen10}11override fun onError(component: PaymentMethodComponent, error: CheckoutError) {12// Payment declined, failed, or cancelled — show error UI13}14}15)
If the customer dismisses the Google Pay screen, Flow for mobile calls onError.
We send you a webhook notifying you of changes to the payment's status. Wait for the webhook callback before you start your order fulfillment process.
For payments submitted with Flow, the PaymentSession ID appears in the webhook payload's data.metadata.cko_payment_session_id field.
Flow for mobile also provides other callbacks so you can customize the payment flow further. For example, you can dynamically adjust the payment amount or retrieve card metadata and card tokenization results. For more information, see Extend your Flow for mobile integration.
Use test cards to simulate different payment flows and ensure your integration is set up correctly and behaving as expected.
You can check the status of a payment from the Payments > Processing > All payments page in the Dashboard.
When you submit your Android app to Google Play, provide the required responses in your Data safety form.