stripe-react-native icon indicating copy to clipboard operation
stripe-react-native copied to clipboard

Google Pay Platform Pay existingPaymentMethodRequired is inconsistent

Open jwoodmansey opened this issue 2 years ago • 3 comments

Describe the bug We are trying to integrate platform pay using the official Stripe react native SDK on Android. We have the requirement of only showing the platform pay modal if the user has an existing payment method within Google Pay.

Unfortunately we are seeing inconsistent behaviour with this setting. We have found that when a device has Google Pay completely disabled then the isPlatformPaySupported call with the existingPaymentMethodRequired parameter correctly returns false. However we are seeing inconsistent behaviour on devices with Google Pay set up. Sometimes users with no cards in their Google Pay account are getting a true value returned from this check. We originally thought this was maybe just a test environment issue but after switching to the production environment we are seeing the same issue.

To Reproduce

  • Remove all cards from Google Pay Wallet
  • isPlatformPaySupported call with an existingPaymentMethodRequired field set to true will still return true even though the device has no cards.
const { isPlatformPaySupported } = usePlatformPay();
...
await isPlatformPaySupported({
        googlePay: {
          testEnv: Config.STRIPE_ENV === 'TEST',
          existingPaymentMethodRequired: true,
        }
})

Expected behavior

  • Remove all cards from a Google Pay Wallet on a device.
  • isPlatformPaySupported should return false in this case

We are unable to narrow down exactly when this happens, as it does sometimes seem to work.

Smartphone (please complete the following information):

  • Device: One Plus Nord 5G
  • OS: Android 13
  • Version 0.30.0

jwoodmansey avatar Sep 28 '23 13:09 jwoodmansey

Which version of Stripe are you running?

namanReact avatar Oct 09 '23 15:10 namanReact

Which version of Stripe are you running?

"@stripe/stripe-react-native": "^0.30.0"

We have since spoken to stripe support and they have concluded it is an issue with the values Google are returning.

jwoodmansey avatar Oct 11 '23 11:10 jwoodmansey

@jwoodmansey did you also delete all cards from pay.google.com?

dmengelt avatar Oct 19 '23 09:10 dmengelt