flutter_stripe
flutter_stripe copied to clipboard
Google Pay Button is not showing on presentPaymentSheet
Describe the bug When I try to call presentPaymentSheet the carForm is showing good but I don't have the Google Pay button. This is how I call it:
var paymentIntent = await createPaymentIntent(amount, currency);
await Stripe.instance.initPaymentSheet(
paymentSheetParameters: SetupPaymentSheetParameters(
applePay: PaymentSheetApplePay(
merchantCountryCode: 'FR',
),
googlePay: PaymentSheetGooglePay(
merchantCountryCode: 'FR', currencyCode: 'EUR'),
style: ThemeMode.system,
merchantDisplayName: '128 Avenue',
paymentIntentClientSecret: paymentIntent['client_secret'],
));
await Stripe.instance.presentPaymentSheet();
Any error is displayed
package version : ^4.0.0
Could you provide more information about:
- Are you using test or live environment? Same environment for both server and mobile
- Are you running a simulator or a real device? Does the simulator have google services?
- If in test mode, you should set: PaymentSheetGooglePay(merchantCountryCode: 'FR', currencyCode: 'EUR', testEnv: true),
I just tried last version on my device and works as expected:

@YoucefSFPlus : Make sure Google Pay is available in your device because if Gpay is not installed in your device it won't show.
@jamesblasco I tried in test and live mode in a real device, the environment is the same for server and mobile. When I used the test mode I correctly added testEnv: true but the Google Pay button still not showing up. @ShwetaChauhan18 my Gpay is enabled on my device and I implemented exactly the same code in another app and every thing works good but this time it doesn't work.
Hi @jamesblasco @ShwetaChauhan18 ,
I forgot to add this line on my AndroidManifest
<meta-data android:name="com.google.android.gms.wallet.api.enabled" android:value="true" />
that's why the Gpay button was not showing.
Now it worked perfectly, thank you for your help !