Flutter Stripe Payment Sheet Google Pay Not Showing Android

410 Views Asked by At

I have integrated Stripe into flutter app, using flutter_stripe: ^7.0.0, every thing works fine when showing payment sheet for getting transaction from cards. Now I want to add Google Pay and Apple Pay as well, i have configured all things according to docs, but in Google pay case, in one of my mobile, Poco X3 NFC, Google pay button is showing, but in other mobiles Google pay button is not showing in flutter payment sheet. I have even logged-in the same google account from Poco x3 where google pay button was visible in other devices where google pay button is not visible, but still the problem is there.

Note: I am integrating these features in one of the app that is only available in Norway, mean Google Pay does have support there but i am doing my development in Pakistan where Google pay services neither google pay is available. But my question is why Google pay is even showing on Poco X3 device. What is the problem i am facing.

PaymentSheetGooglePay googlePay = const PaymentSheetGooglePay(
merchantCountryCode: 'NO',
testEnv: true,
currencyCode: 'NOK',
);

PaymentSheetApplePay applePay = const PaymentSheetApplePay(
  merchantCountryCode: 'NO',
);
await Stripe.instance.initPaymentSheet(
  paymentSheetParameters: SetupPaymentSheetParameters(
    paymentIntentClientSecret: paymentIntentClientSecret,
    merchantDisplayName: 'ABC',
    style: ThemeMode.light,
    appearance: const PaymentSheetAppearance(
      colors: PaymentSheetAppearanceColors(primary: AppColors.primaryColor),
    ),
    googlePay: googlePay,
    applePay: applePay,
  ),
);
try {
  await Stripe.instance.presentPaymentSheet();
  emit(StripePaymentSuccessful(stripeIntentId: stipeIntentId));
} on StripeException catch (e) {
  if (e.error.code == FailureCode.Canceled) {
    emit(StripePaymentCancelled(message: e.error.message!));
  } else if (e.error.code == FailureCode.Failed) {
    emit(StripePaymentFailed(message: e.error.message!));
  } else {
    emit(StripePaymentFailed(message: e.error.message!));
  }
}
0

There are 0 best solutions below