flutter-stripe / flutter_stripe

Flutter SDK for Stripe.
https://pub.dev/packages/flutter_stripe
948 stars 523 forks source link

Apple Pay / Google Pay are not showings when presenting the Stripe Payment Sheet #1963

Closed Tom3652 closed 2 weeks ago

Tom3652 commented 2 weeks ago

Describe the bug I am using this code :

Stripe.merchantIdentifier = "mymerchant.bundle.id";
Stripe.urlScheme = "myscheme";
Stripe.publishableKey = "api_key"
String customerID = "customerIDFromBackend";
String secret = "secretFromBackend";
try {
  await Stripe.instance.applySettings();
  await Stripe.instance.initPaymentSheet(
    paymentSheetParameters: SetupPaymentSheetParameters(
        merchantDisplayName: "MyCompanyName",
        customerId: customerID,
        allowsDelayedPaymentMethods: true,
        applePay: const PaymentSheetApplePay(
          merchantCountryCode: "FR",
        ),
        googlePay: const PaymentSheetGooglePay(
            merchantCountryCode: "FR",
            testEnv: !kReleaseMode),
        style: ThemeMode.system,
        paymentIntentClientSecret: secret),
  );
  await Stripe.instance.presentPaymentSheet();

And it doesn't show either Google Pay or Apple Pay buttons.

Note iOS :

Note Android :

I am testing on real devices.

To Reproduce Steps to reproduce the behavior:

  1. Entering number 123-456-789 into the cardfield.
  2. Tapping the confirm button.
  3. Observe a failure with exception (including the part of the stack trace, belonging to this package) …

Expected behavior A clear and concise description of what you expected to happen.

Smartphone / tablet

Additional context I have searched multiple issues and read everything you said in your discussion but this doesn't help.

I have also tried to run the example app but i have got so many build errors from the stripe_js (/packages directory) classes with attributes not found, and so on.. That i could not try with your code to see if it was working unfortunately but there may be a real issue here.

remonh87 commented 2 weeks ago

did you enable apple pay in the Stripe dashboard console?

Tom3652 commented 2 weeks ago

hi @remonh87 thanks for your quick reply, yes indeed :

Capture d’écran 2024-10-15 à 18 46 42
Tom3652 commented 2 weeks ago

Okay @remonh87 i have the apple pay appearing on another phone (iPhone 12 Pro Max), i guess my own wallet has an issue 😅

For Google Play do you confirm i simply need to have a valid card in my Google Wallet for it to appear as well ?

Thanks for your help !

remonh87 commented 2 weeks ago

Hi for testing that is the case but in production you need to get approved by google. See https://docs.stripe.com/google-pay?platform=android#going-live

Tom3652 commented 1 week ago

Alright thank you for your help, my app is already live on the store for few months so i will check how to update all this.

Tom3652 commented 1 week ago

I confirm that Google Pay has appeared in debug mode after adding a Revolut card in my wallet and my app is under review for production. Thanks again for your time