Commerce: Order paid in full but not marked as complete

Created on 15 Apr 2020  路  5Comments  路  Source: craftcms/commerce

We are tracking a bug that causes the order to be marked as paid, but since the the order is not marked as complete the payment status shows up as 'partial'.

We are unable to reproduce. Please share which gateway you are using, and the steps you have tried to reproduce here so we can track centrally.

need more info 馃挸 payments investigating 馃洅 checkout

Most helpful comment

Thanks @sarahschuetz, we have exactly what you suggest coming in our new commerce docs that @mattstein is working on. Thanks for the feedback.

All 5 comments

Hey @lukeholder,

sounds like the issue we are having at the moment (#1714).
At the moment our best guess is, that it is related to a timeout issue.

We were doing a rather heavy tasks in the Order::EVENT_BEFORE_COMPLETE_ORDER event. Sometimes this resulted in a server timeout in which case the order was never completed.

We use the Order::EVENT_AFTER_COMPLETE_ORDER event now and also push the heavy task to the queue.
So far the results are looking good. However we are not done yet and still have to do more excessive testing.

Thanks for your input.

This was our suspicion, most developers hitting this are using an event listener that is timing out or crashing during the order completion process.

@lukeholder when we encountered this issue, we had a hard time understanding the correspondence of carts and orders and the corresponding payment status. First we thought that there was a problem with the payment, because our payment status was "patial". Our first guess was that the orders weren't completed because of the incomplete payment when it was actually the other way round.

It would be a great help to have some kind of flow chart of the whole order and payment process, explaining when data is sent to the payment gateways, when orders are completed, when payment statuses are changed, at which point the events are dispatched and so on. Maybe you could add such a chart to the documentation. It would be greatly appreciated and surely help a lot of people :)

Best wishes, Sarah

Thanks @sarahschuetz, we have exactly what you suggest coming in our new commerce docs that @mattstein is working on. Thanks for the feedback.

Most people experiencing this are using a load balanced DB environment, Craft 3.5.11.1 added a fix for this:

https://github.com/craftcms/cms/commit/b5dd59a44a870827e91eb91dd740202e3928adcb

If we get no more reports, we will close this ticket.

Was this page helpful?
0 / 5 - 0 ratings