stripe / stripe-android

Stripe Android SDK
https://stripe.com/docs/mobile/android
MIT License
1.28k stars 645 forks source link

[BUG] [GooglePay] PaymentSheet does not work with GooglePay environment = Test #9548

Open gabediazm opened 4 days ago

gabediazm commented 4 days ago

Summary

Im integrating Google Pay into our existing Stripe PaymentSheet implementation. According to this discussion, enabling Google Pay in the Test environment requires setting the existingPaymentMethodRequired flag to false. However, the PaymentSheet configuration does not currently provide a way to set this flag.

Code to reproduce

PaymentSheet.presentWithSetupIntent(
        setupIntentClientSecret = clientSecret,
        configuration = PaymentSheet.Configuration(
            googlePay = PaymentSheet.GooglePayConfiguration(
                environment = PaymentSheet.GooglePayConfiguration.Environment.Production,
                countryCode = Locale.CANADA.country,
                currencyCode = Currency.getInstance(Locale.CANADA).currencyCode,
                buttonType = PaymentSheet.GooglePayConfiguration.ButtonType.Plain
            ),
...

Android version

Impacted devices

Installation method

Dependency Versions

kotlin: 1.9.22 stripe-android: 20.53.0 Android Gradle Plugin: 8.5.2 Gradle: 8.7

SDK classes

Video

Other information

samer-stripe commented 1 day ago

Hey @gabediazm! Sorry to hear you are experiencing this issue. Unfortunately we don't provide an option to override this behavior in PaymentSheet as we only want to show the Google Pay when there are payment methods available. We set existingPaymentMethodRequired to true internally.

This appears to be an issue on Google's side in regards to the response on whether we should or should not show the Google Pay button. We've contacted them to hopefully resolve this issue. In the meantime, if you have a Google account with payment methods attached them, logging onto that account should show the Google Pay button in PaymentSheet.

gabediazm commented 1 day ago

Hey @samer-stripe we’re facing a significant blocker with this issue. When setting the PaymentSheet to the TEST environment, Google Pay button is not showing, only show up when configured to PRODUCTION. However, attempting to proceed in PRODUCTION results in a “merchant could not accept payment” error.

For review and approval of our business account, Google requires screenshots of the implementation pointing to the TEST environment, which creates a challenging loop for us.

Is there any workaround available? Thank you for your prompt response and assistance!

samer-stripe commented 1 day ago

Hey @gabediazm! I've sometimes seen this issue occur on emulators but then work completely fine on real devices. Have you tried both emulators & real devices?

gabediazm commented 1 day ago

I've only tried in real device

samer-stripe commented 1 day ago

Have you checked your dashboard settings to ensure that Google Pay is enabled when in test mode, not just live mode?