Closed mihiravdevs closed 2 weeks ago
I raised the same issue with the stipe support team, I am attaching the screenshot of reply
also experiencing this. further to your config above I have set the following in build.gradle as specified here https://developers.google.com/pay/api/android/guides/setup and https://docs.stripe.com/payments/accept-a-payment?platform=android&locale=en-GB : dependencies { implementation 'com.google.android.gms:play-services-wallet:19.4.0' implementation 'com.stripe:stripe-android:20.48.4' } but still seeing no googlepay button even in testEnv, same as @mihiravdevs
looks like potential dupliate of #1887
@remonh87 I think https://github.com/flutter-stripe/flutter_stripe/issues/1887 is different issue
Could you please guide what exactly I need to change to resolve the issue and make google pay button visible on my stripe payment sheet.
Describe the bug I am integrating Stripe in a Flutter project using the flutter_stripe package (version 11.0.0). The Google Pay button is not appearing in the payment sheet on physical devices (Xiaomi Redmi Note 10 Pro Max and Realme 10) even though the Google Pay app is installed and functional on these devices.
To Reproduce Steps to reproduce the behavior:
Expected behavior The Google Pay button should be visible in the Stripe payment sheet when Google Pay is available on the device.
Smartphone / tablet
Device: Xiaomi Redmi Note 10 Pro Max and Realme 10
Environment Flutter Stripe Dependency: flutter_stripe: ^11.0.0 Physical Devices: Xiaomi Redmi Note 10 Pro Max, Realme 10 Google Pay App: Installed and functional on both devices Test Environments: Tested with testEnv: true and testEnv: false in both test and production environments
Additional context Despite the correct setup and Google Pay being installed, the Google Pay button is not visible in the payment sheet on Android devices. I have verified that the Apple Pay button appears correctly on an iOS simulator. This issue persists even after uploading the app to the Play Store for internal testing.
Code Snippets:
Flutter Stripe Initialization:
void _initStripe() async { Stripe.publishableKey = AppConstant.stripePublishKey; Stripe.merchantIdentifier = StringResources.appName; await Stripe.instance.applySettings(); }
Future makePayment({
required SubscriptionProvider provider,
required String clientSecret,
required String ephemeralKey,
required String stripeUserID,
}) async {
provider.setLoading(true);
try { await Stripe.instance.initPaymentSheet( paymentSheetParameters: SetupPaymentSheetParameters( primaryButtonLabel: "Pay", customFlow: false, merchantDisplayName: StringResources.appName, setupIntentClientSecret: clientSecret, customerEphemeralKeySecret: ephemeralKey, applePay: const PaymentSheetApplePay( merchantCountryCode: 'CA', ), googlePay: PaymentSheetGooglePay( merchantCountryCode: 'CA', testEnv: true, // Set to false for production ), style: ThemeMode.system, ), );
} on StripeException catch (e) { provider.setLoading(false); context.showSnackBar( 'Payment sheet initialization failed: ${e.error.localizedMessage}', type: SnackBarType.warning, ); } catch (e) { provider.setLoading(false); context.showSnackBar( 'An unexpected error occurred. Please try again.', type: SnackBarType.warning, ); } }
<meta-data android:name="com.google.android.gms.wallet.api.enabled" android:value="true" />