flutter_stripe icon indicating copy to clipboard operation
flutter_stripe copied to clipboard

web: Google Pay wallsheet not launched on Android PWA when calling stripe.createPlatformPayPaymentMethod()

Open dioseltorre opened this issue 10 months ago • 0 comments

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:

  1. 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,
    ),
  );
}

dioseltorre avatar Apr 18 '24 09:04 dioseltorre