stripe-react-native
stripe-react-native copied to clipboard
Google Pay Platform Pay existingPaymentMethodRequired is inconsistent
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
isPlatformPaySupportedcall with anexistingPaymentMethodRequiredfield 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.
isPlatformPaySupportedshould 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
Which version of Stripe are you running?
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 did you also delete all cards from pay.google.com?