Google Pay
The library includes SecureGooglePayButton, which simplifies Google Pay integration in your app. The component automatically:
- checks Google Pay availability on device,
- displays the standard Google Pay button,
- processes payment flow and obtains payment token,
- sends token to payment gateway for processing.
Using Google Pay requires Checkout API activation and correct setup in Google Play Console and Google Pay Console, described below. Full documentation for native integration without SDK is available in Google Pay - Mobile apps.
1. Google Play Console
Before deploying Google Pay in production app version, app must be configured correctly and published in Google Play. This step is required by Google and is necessary to activate Google Pay in compliance with their terms.
App configuration, upload, and management are done in Google Play Console. Your app must be available at least in internal or closed testing. Full release is also possible.
This documentation does not include detailed Google Play Console setup instructions. The process can be extensive and depends on your situation, so follow official Google guidance.
During development, also consider additional Google requirements related to publishing an app with Google Pay.
2. Google Pay Console
Once app is available at least in internal testing, review approval requirements in Google Pay Console. This step is necessary for production Google Pay activation.
Full registration/configuration process is described in official docs.
Approval process may take several days and requires compliance with:
- brand guidelines,
- UX best practices,
- requirements in integration checklist.
Part of approval process is also providing screenshots of your Google Pay implementation.
At this stage, it is enough to get access to Google Pay Console and verify that your app configured in Google Play Console appears in "Google Pay API" section.
Submitting approval request is described later, after integration is finished.
3. Implementation
This section describes library components required to integrate Google Pay into your app.
The library automatically handles payment gateway configuration, payment request assembly, token extraction, and API submission. You only need to use SecureGooglePayButton and pass required parameters.
Requirements
| Requirement | Description |
|---|---|
googleMerchantId | Google Pay Merchant ID - required for production. |
googleMerchantName | Merchant name displayed in Google Pay dialog (optional). |
threeDSConfig | ThreeDSConfig instance passed to ComgateSecureSession (required also for Google Pay). |
| Checkout API activation | Google Pay configuration is loaded internally by the library during session initialization. |
How to obtain googleMerchantId
You can obtain googleMerchantId in Google Pay & Wallet Console in your merchant profile detail.
Quick steps:
- Open Google Pay & Wallet Console.
- Select your Merchant profile (or create a new one).
- In integration details section, copy Merchant ID value.
- Use this value as
googleMerchantIdinComgateSecureSession.
SecureGooglePayButton
Jetpack Compose
import cz.comgate.sdk.compose.*
SecureGooglePayButton(
session = session,
onPaymentResult = { result -> handleResult(result) },
paymentParamsProvider = {
PaymentParams(
email = "customer@example.com",
price = 100,
curr = "CZK",
country = "CZ",
label = "Payment name",
refId = "ref-123",
fullName = "John Smith"
)
},
modifier = Modifier
.fillMaxWidth()
.height(56.dp)
)
Button appearance setup
SecureGooglePayButton now supports customizing the Google Pay button appearance and type.
Styling methods
| Method | Parameter | Description |
|---|---|---|
setButtonTheme(theme) | GooglePayButtonTheme | Sets visual variant (DARK, LIGHT). |
setButtonType(type) | GooglePayButtonType | Sets button label type. |
setCornerRadius(radiusDp) | Int | Sets corner radius in dp. |
SecureGooglePayButton(
session = session,
onPaymentResult = { result -> /* ... */ },
paymentParamsProvider = { /* ... */ },
modifier = Modifier.fillMaxWidth().height(56.dp),
update = {
setButtonTheme(GooglePayButtonTheme.LIGHT)
setButtonType(GooglePayButtonType.CHECKOUT)
setCornerRadius(12)
}
)