Join GitHub today
GitHub is home to over 40 million developers working together to host and review code, manage projects, and build software together.Sign up
Race condition causing duplicate orders with double-clicks on Braintree "Pay" button #10767
Steps to reproduce
Depending on your infrastructure, this bug may be challenging to reproduce. It requires all of the "Pay" button clicks to be processed concurrently by Magento. You will not see the bug if Magento is processing requests sequentially (as the second request will reference a cart ID that no longer exists).
I'm currently working on setting up a dev environment where I can test this, rather than merely observing it on our production instances. I'll come back and add more details once I've got that working.
@orlangur That's the fix I'm hoping to implement, but I'm imagining it'll require overriding
I don't think its possible to fulfil multiple orders with a single payment. The sequence of operations is:
Step 3 is hit multiple times if the pay button is clicked multiple times, with different auth codes coming back from Braintree. If multiple orders were fulfilled, I'd expect this to result in multiple charges to the customer (which is still pretty undesirable)
@RJacksonm1 I feel your pain, as we had some of such issues to our clients.
We have been used the fix for more then a year ago across multiple clients starting from Magento 2.0 till the latest 2.1.8 and had no issues so far.
I think, that should definitely help to over come the issue you are facing.