flutter_stripe
flutter_stripe copied to clipboard
web: Google Pay wallsheet not launched on Android PWA when calling stripe.createPlatformPayPaymentMethod()
Describe the bug
Google Pay wallsheet didn't launch when calling stripe.createPlatformPayPaymentMethod()
on Android PWA (using Chrome). On iOS PWA, it works as expected and Apple Pay wallsheet was launched.
To Reproduce Steps to reproduce the behavior:
- Tap Google Pay button
Expected behavior It should launch the Google Pay wallsheet as expected.
Smartphone / tablet
- Device:
Sony Xperia
- OS:
Android 14
- Package version:
flutter_stripe: ^10.1.1
flutter_stripe_web: ^5.1.0
- Flutter version:
Flutter 3.19.2 • channel stable
Additional context Even on normal Chrome browser still it didn't launch, however, the Google Pay button on top of this stripe docs page works as expected on the same Chrome browser which means Google Pay is setup correctly in the device.
Sample Code
final options = PlatformPayWebPaymentRequestCreateOptions(
country: 'JP',
currency: 'jpy',
total: PlatformPayWebPaymentItem(amount: 1000, label: "Total Amount"),
disableWallets: [PlatformPayWebWalletType.link],
);
// Widget
if (isPlatformPaySupported)
CustomPlatformPayButton(
onPressed: handlePayment,
)
Future<void> handlePayment() async {
await stripe.createPlatformPayPaymentMethod(
params: PlatformPayPaymentMethodParamsWeb(
options: options,
),
);
}