Currently it may happen that the onReturn() and onNotify() requests are overlapping in such a manner that an order gets placed twice. Fortunately this module is not as often concerned as other offsite payment gateways, but sometimes it happens. It's basically a Commerce core problem, reported in several issues, eg #3043180: The changes made to the order on the onNotify method are not applied on the onReturn method
In the long run, this has to be solved within Commerce by an appropriate order locking mechanism. In the meantime, we should find a proper solution for ourselves. I've implemented one for commerce_opp that can be adjusted for this module too: #3172880: Use locks in onReturn() and in webhooks controller to fight overlapping payment update problem
| Comment | File | Size | Author |
|---|---|---|---|
| #5 | 3177314-5.patch | 16.37 KB | agoradesign |
Comments
Comment #2
agoradesign commentedPlease note that this patch is completely untested yet! Try in a test environment first!
Comment #3
agoradesign commentedre-roll #2 against latest dev (patch from #2 is still the one to use with alpha2)
Comment #4
agoradesign commentedpatches from #2 and #3 are both lacking the $this->orderLock = $order_lock; call inside constructor. This version works
Comment #5
agoradesign commentedComment #7
agoradesign commented