woocommerce / woocommerce-gateway-stripe

The official Stripe Payment Gateway for WooCommerce
https://wordpress.org/plugins/woocommerce-gateway-stripe/
231 stars 202 forks source link

The Google Pay option in the UPE Element doesn't work due to the delay after the user gesture #2707

Open a-danae opened 1 year ago

a-danae commented 1 year ago

Describe the bug

The Google Pay UPE element (and likely Apple Pay too) fails to process the payment.

After investigation, this is happening due to the delay between the user gesture and the triggering of the wallet's modal.

To Reproduce Solve a higher-level issue:

Replication steps:

Expected behavior The payment must be processed successfully when selecting Google Pay.

Screenshots

https://github.com/woocommerce/woocommerce-gateway-stripe/assets/41606954/e52ec777-5c94-4785-8e68-502066ec40bd

Additional context This happens because the wallet’s payment modal must be triggered soon after a user gesture, and we need to run some API requests before the modal is triggered. In some cases, these requests delay displaying the modal longer than what’s allowed by the delegation’s threshold, thus triggering this error.

We’d need to reduce that delay to solve this problem. This likely means moving the API requests before the modal is triggered since we can’t control the time until the API responds. This would deserve a spike because it may or may not be feasible.

You can comment out this request for testing to make the button work in the block checkout. It's worth noting that this is just for testing and isn't an actual solution. There are other scenarios where this problem cannot be solved by commenting out a request.

wpniall commented 10 months ago

Reported in 7213708-zen

WillBrubaker commented 9 months ago

in 7353108-zen, the user has alerted us that:

when using this button a coupon does not work properly

Can testing with a coupon be added to the testing instructions when a fix for this is made?

MattRaynerDBS commented 1 week ago

It's coming up to a year since this issue has been opened, any idea on when or if this will be fixed?