-
-
Notifications
You must be signed in to change notification settings - Fork 649
Google Pay does not appear in a Payment Sheet #2332
Description
Google Pay Not Appearing in Payment Sheet - Issue Report
Summary
Google Pay does not appear as a payment option in the Stripe payment sheet on Android despite following all documentation and having proper configuration. Apple Pay works correctly on iOS, confirming the Stripe integration is functional.
Environment
Flutter & Dart
- Flutter: 3.38.7
- Dart: 3.10.7
Package Versions
flutter_stripe: ^12.2.0
stripe_android: 12.2.0
stripe_platform_interface: 12.2.0Android Configuration
- Test Device: Samsung Galaxy S25 Ultra
- Android Version: 16, One UI Version 8.0
- Google Play Services: 26.04.34 (verified via adb)
- Google Wallet: Installed (com.google.android.apps.walletnfcrel)
- Samsung Pay: Also installed (com.samsung.android.spay)
- play-services-wallet: 19.5.0
Backend
- Stripe SDK: PHP v19.3.0
- API Keys: Test mode (pktest*)
- PaymentIntent: automatic_payment_methods enabled
- Customer: Created with full billing details
- Currency: USD
Configuration Implemented
1. Android build.gradle.kts
dependencies {
implementation("com.google.android.material:material:1.13.0")
implementation("com.google.android.gms:play-services-wallet:19.5.0")
}2. AndroidManifest.xml
<!-- Enable Google Pay -->
<meta-data
android:name="com.google.android.gms.wallet.api.enabled"
android:value="true" />3. Flutter Stripe Initialization
note: app name and company, as well as private keys have been removed for privacy
Stripe.publishableKey = key;
Stripe.merchantIdentifier = 'merchant.com.mycompany.myapp';
Stripe.urlScheme = 'flutterstripe';
await Stripe.instance.applySettings();4. Payment Sheet Configuration
await Stripe.instance.initPaymentSheet(
paymentSheetParameters: SetupPaymentSheetParameters(
paymentIntentClientSecret: clientSecret,
merchantDisplayName: 'MyApp - MyCompany.com',
style: ThemeMode.system,
returnURL: 'flutterstripe://redirect',
billingDetails: BillingDetails(
name: shippingDetails['name'],
email: shippingDetails['email'],
phone: shippingDetails['phone'],
address: Address(
line1: shippingDetails['street'] ?? '',
line2: shippingDetails['street2'],
city: shippingDetails['city'] ?? '',
state: shippingDetails['state'] ?? '',
postalCode: shippingDetails['zip'] ?? '',
country: shippingDetails['country'] ?? '',
),
),
googlePay: PaymentSheetGooglePay(
merchantCountryCode: 'US',
testEnv: _cachedPublishableKey?.startsWith('pk_test_') ?? true,
),
applePay: PaymentSheetApplePay(
merchantCountryCode: 'US',
),
billingDetailsCollectionConfiguration: const BillingDetailsCollectionConfiguration(
address: AddressCollectionMode.automatic,
),
),
);5. Backend PaymentIntent Configuration
$paymentIntent = \Stripe\PaymentIntent::create([
'amount' => $totalAmountCents,
'currency' => 'usd',
'customer' => $customer->id,
'automatic_payment_methods' => [
'enabled' => true,
],
'shipping' => [
'name' => $name,
'phone' => $phone,
'address' => [
'line1' => $street,
'line2' => $street2,
'city' => $city,
'state' => $state,
'postal_code' => $zip,
'country' => $country,
],
],
// ... metadata
]);The Issue
Observed Behavior
- Payment sheet displays successfully
- Credit card payment option is available
- Google Pay option does NOT appear <<------------ THE PROBLEM !!!
- Apple Pay appears correctly on iOS devices
- Amazon Pay appears correctly on both Android and iOS devices
Console Warnings
When filtering logcat for Google Pay, the following warning appears from the native Android Stripe SDK:
StripeSdk: GooglePayConfiguration is not set.
Despite the Flutter log showing:
Debug: Payment sheet initialized with Google Pay config (merchantCountryCode: US, testEnv: true address:AddressCollectionMode.automatic)
Testing Performed
Tested Configurations
- ✅ Release APK (not debug build)
- ✅ Developer mode disabled on device
- ✅ USB debugging disabled
- ✅ Google Wallet installed and verified (via adb) and has a payment card installed
- ✅ Google Play Services version confirmed sufficient (26.04.34)
- ✅ play-services-wallet dependency added
- ✅ URL schemes consistent across configuration
- ✅ MainActivity uses FlutterFragmentActivity
- ✅ All configuration matches flutter_stripe documentation
Attempted Diagnostics
When attempting to call Stripe.instance.isGooglePaySupported():
MissingPluginException(No implementation found for method isGooglePaySupported on channel flutter.stripe/payments)
When attempting to call Stripe.instance.initGooglePay():
MissingPluginException(No implementation found for method initGooglePay on channel flutter.stripe/payments)
These methods appear to not exist in flutter_stripe 12.2.0, suggesting incomplete Google Pay API implementation.
Expected Behavior
Google Pay should appear as a payment option in the payment sheet, similar to how Apple Pay appears on iOS devices.
Analysis
The native Android Stripe SDK warning GooglePayConfiguration is not set indicates that despite the Flutter-side configuration being passed correctly, the native Android SDK is not receiving the Google Pay configuration.
This suggests either:
- The flutter_stripe plugin is not properly bridging the Google Pay configuration to the native Android Stripe SDK
- Additional native Android configuration is required that flutter_stripe doesn't expose through the Flutter API
- There's a bug in flutter_stripe 12.2.0's Google Pay implementation
The fact that:
isGooglePaySupported()method doesn't existinitGooglePay()method doesn't exist- The native SDK reports missing configuration despite Flutter config being present
...suggests the Google Pay implementation in flutter_stripe may be incomplete.
Comparison with Working Setup
- Apple Pay on iOS: Works perfectly with similar configuration
- Card payments: Work correctly on both platforms
- Backend: Confirmed working (Apple Pay succeeds)
- Only Google Pay on Android: Fails to appear
Additional Context
- Configuration follows current flutter_stripe documentation (no currencyCode required per updated API)
- All code compared against flutter_stripe example app - matches expected setup
- Device has both Google Wallet and Samsung Pay installed (Samsung Pay may be interfering, but this shouldn't block Google Pay entirely). Google Wallet is set as the default wallet payment app.
BUG / PROBLEM
It seems the cause is flutter_stripe 12.2.0
Downgrading to flutter_stripe 12.1.1 seems to have resolved the issue
in pubspec.yaml
changed from flutter_stripe: ^12.2.0 to:
flutter_stripe: 12.1.1
stripe_android: 12.1.0
stripe_ios: 12.1.0
stripe_platform_interface: 12.1.1