Duplicate transactions seen when customers pay with apple pay via stripe
-
Hello, we have noticed that we are receiving duplicate orders for some of those where customers are paying with apple pay/stripe.
Is anyone able to help with this please?
The page I need help with: [log in to see the link]
-
Hello, @chilliwax
Sorry to hear that.
This thread is already closed, I understand you started the thread. Since some time has passed, I recommend starting a new thread:
https://www.ads-software.com/support/plugin/woocommerce-gateway-stripe/#new-topic-0.
When creating your new thread, please enable the debug mode, and provide us with the error logs generated when you navigate to WooCommerce > System Status > Logs, this will provide us more information to check better.
We’ll be glad to help.
@ihereira closing a thread that’s clearly still an issue, does not help the thread starter, or the community to resolve the underlying issue. It just helps your stats, but this is a short-sighted approach, because in reality, it simply creates more tasks for you to deal with, and you lose connection with the actual issue, therefore thinking it’s not really a bug. Do you expect everyone who follows this thread, to magically jump to the new one or another related one? Please refrain from posting unhelpful comments and let us try to debug the actual issue.
@chilliwax we too have been having the same issue for a while, and are unable to identify the cause of it. Once you weed out human error, it appears the vast majority, if not all of the orders are Apple Pay ones. One thing we’ve noticed, is the IP of those is always different. We use CloudFlare and so far, we’ve been using the php to expose the customer IP, but we’ll now switch to the nginx solution instead because it doesn’t appear to work properly. Do you use CloudFlare and/or a LoadBalancer?
The vast majority of the duplicate orders (all that aren’t user errors) are paid using Apple Pay and we noticed that Apple Pay errors do not show up on checkout on many themes including Storefront. Here is our bug report about it https://github.com/woocommerce/woocommerce-gateway-stripe/issues/2658
We therefore have a theory (needs proving) that customers are trying to pay using Apple Pay, then an error is coming up (for example https://github.com/woocommerce/woocommerce-gateway-stripe/issues/2618) but the customer never sees it and thinks nothing happened. Then they try again either using Apple Pay or a different gateway (PayPal/Card).
Validation errors like the one with the billing state, will not process the order, but other errors might, so we’ve updated our theme to have the errors showing, and we’ll monitor the situation to see if we get any more leads about those duplicate orders.
To avoid confusion, the issue is not resolved for us or the thread starter.
Hi George, i think we may use a load balancer but not 100% certain. I actually experienced this more by chance/luck than anything else. So what happened was i paid using apple pay on our website, and i saw a “payment failed” message. So i paid again…this time it was successful…on the backend both transactions had gone through. So something is happening where a payment failure message is being displayed to customers even though the payment did actually go through….thus causing the customer to inadvertently order a 2nd time.
Hi @chilliwax we spent a lot of time debugging this and after some valuable feedback from customers, we realised that while they system UI is open and you pick the address, payment method etc, the checkout behind it, is still visible and editable, at least on our theme which is based on Storefront.
The customers reported seeing a spinner on the system UI for a long time (10-20 seconds) while Stripe is processing their payment, got impatient and closed the browser thinking the payment had failed. They then tried a different payment method, not realising their initial order had gone through.
One solution was to introduce throttling and stop people from placing identical orders within X minutes, but there are scenarios where people want to do this so this wasn’t a great solution.
We opted for a different approach, where we introduce a spinner while the Apple Pay modal is open, which would stop people from interacting with the chekout. We used the following code
// block the ui while wc stripe ajax actions are running // unblock when the ajax actions are done function checkout_wc_stripe_loading_block() { jQuery( document ).on('ajaxSend', function(event, request, settings) { if ( !settings.url.includes('wc_stripe') ) { return; } jQuery('form.woocommerce-checkout').block({ message: null, overlayCSS: { background: '#fff', opacity: 0.6 } }); }); jQuery( document ).on('ajaxComplete', function(event, request, settings) { if ( !settings.url.includes('wc_stripe') ) { return; } jQuery('form.woocommerce-checkout').unblock(); }); }
Since releasing, we’ve not had any more duplicates, but this is coincidental, because we’ve also seen duplicates where the customer got a “payment failed” error. Those were just a handful, but made it even harder to weed out the true cause.
It sounds like your issue is caused by “payment failed” which is a generic message. Unfortunately, the plugin doesn’t display the true error to the customer which makes it even harder to debug.
We’ll continue to monitor the orders for duplicates caused by “payment failed” and will report back when i have more info.
Hi @subscriptiongroup thank you for spending a lot of time debugging this issue. I have raised this up with the development team as well and will update this thread with feedback.
Hi @chilliwax and @subscriptiongroup,
We have been able to reproduce the error using the steps in your open GitHub issue. A bug label has been added to it and our developers will look into it.
Thank you for bringing this to our notice and for opening the issue. ??
Unfortunately we are still seeing duplicate payments every now and then when a customer pays with apple pay via stripe….Has anyone managed to figure out what causes this? It doesn’t happen on all transactions but just every now and then.
@chilliwax have you seen this issue https://github.com/woocommerce/woocommerce/issues/14541 ? Hardcoding the change while waiting to get merged, seems to have greatly reduced the duplicate orders for us.
- This reply was modified 1 year ago by George.
Hi there @chilliwax ??
Unfortunately we are still seeing duplicate payments every now and then when a customer pays with apple pay via stripe….Has anyone managed to figure out what causes this? It doesn’t happen on all transactions but just every now and then.
Thank you for bringing this to our notice. I understand this happens intermittently.
To get an idea of how your site is configured now, could you please share a recent copy of your site’s System Status, as exemplified here? Once you’ve done that, paste it here in your response.
Looking forward to hearing from you!
@subscriptiongroup thanks for that – it’s crazy how this has been going on for so many years without a solution. It’s actually one of the key deciding factors behind why we have decided to go with shopify for a new brand we are working on.
Hi @chilliwax
If you still require assistance please open a new topic since this one has been closed already.
https://www.ads-software.com/support/plugin/woocommerce-gateway-stripe/#new-topic-0Include a link to this thread so we can see what is already been done. We’ll be happy to help you there!
Cheers.
- The topic ‘Duplicate transactions seen when customers pay with apple pay via stripe’ is closed to new replies.