V4.3 Duplicate orders issue, orders are paid by Paypal express

This topic was automatically closed 365 days after the last reply. New replies are no longer allowed.
3 года назад
Hi,
I found an issue related to checkout. For example, if customers open two tabs of same checkout page, and click confirm order in both tabs (btw, orders are paid by PayPal express plugin) almost at the same time, Nopcommerce will create two orders which are duplicated, and both two orders would be marked as Paid in Nopcommerce, but actually based on the response message received from Paypal, first order will receive both success and error responses, the second order does not have any Paypal message.

The success message is understandable, and the error message shows
..."Errors":[{"ShortMessage":"Duplicate Request","LongMessage":"A successful transaction has already been completed for this token.","ErrorCode":"11607"...

I know the possibility of this case maybe very small, but it has happened several times on our store. I dont know how the customer caused this problem, but in the way I described above, I can reproduce this issue.

My question is how to prevent this issue? Is this a case would be improved in the feature?

Thanks.
3 года назад
I have this same occasional error.  

If you look at PayPalExpressCheckoutPlaceOrderService it checks for duplicates against _orderSettings.MinimumOrderPlacementInterval.

Now MinimumOrderPlacementInterval defaults to 30 seconds during installation but try setting it down to 1 which theoretically should prevent most duplicates.  Obviously do extensive testing to ensure this doesn't block single orders for some reason.  It shouldn't, but I'm not sure what interval may be too aggressive.

My duplicates are anywhere from 0.5 - 4 seconds apart but we're limited to an int so you can't go below 1 second.  

I do see that both orders share the same CaptureTransactionId, so perhaps it's worth searching previous orders for that property as well.

The "confirm" button should disable itself after clicking, so like you I am unsure how customers are able to submit duplicates other than as you describe, which is bizarre.
This topic was automatically closed 365 days after the last reply. New replies are no longer allowed.