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).
/rest/ro_uk/V1/carts/mine/payment-information (this endpoint creates the order) receives a HTTP 200 response. Subsequent hits return HTTP 400./rest/ro_uk/V1/carts/mine/payment-information (the endpoint that creates an order), which is responded to with HTTP 200./rest/ro_uk/V1/carts/mine/payment-information returns HTTP 200, the rest return HTTP 400/rest/ro_uk/V1/carts/mine/payment-information, which all receive a HTTP 200 response code.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.
Is it not enough to just disable "Pay" button after it is clicked for the first time? Is it possible, for example, to fulfill multiple orders by performing only one payment?
@orlangur That's the fix I'm hoping to implement, but I'm imagining it'll require overriding placeOrderClick in /app/code/Magento/Braintree/view/frontend/web/js/view/payment/method-renderer/hosted-fields.js. I'm not sure if there's a less intrusive way I can fix this for my project? I'd rather avoid overwriting core Payment related code where possible.
I don't think its possible to fulfil multiple orders with a single payment. The sequence of operations is:
/rest/ro_uk/V1/carts/mine/payment-information, which creates the orderStep 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)
Hi, @RJacksonm1, thanks for reporting. I've created an internal ticket (MAGETWO-72351).
Hi @RJacksonm1 and @joni-jones
@RJacksonm1 I feel your pain, as we had some of such issues to our clients.
Please find my PR and commit. I hope the description will give you a decent explanation on why it is happening and how it got addressed.
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.
Regards,
Maxim
@RJacksonm1, thank you for your report.
We were not able to reproduce this issue by following the steps you provided. If you'd like to update it, please reopen the issue.
We tested the issue on 2.1.9
Closed by mistake. Internal ticket for 2.1.x - MAGETWO-72534.
@RJacksonm1, thank you for your report.
We've created internal ticket(s) MAGETWO-72351 to track progress on the issue.
The issue MAGETWO-72351 already fixed and delivered to 2.2.1 release which will be available soon. Closing the issue
Most helpful comment
The issue MAGETWO-72351 already fixed and delivered to 2.2.1 release which will be available soon. Closing the issue