- π―π΄Jordan Abdelrahman khlefat
This is a temporary solution to stop closing a failed order, until we agree on a permanent solution.
- πΉπ·Turkey emircan erkul Turkey
emircan erkul β made their first commit to this issueβs fork.
In #3174169: Canceled orders can still have charge attempts β we made it so that queued jobs for canceled orders do not try to close the order; and even if RecurringOrderManager::closeOrder() is called on a canceled order, it will not seek payment.
We did not address 'failed' orders. Normally an order becomes 'failed' because the queue job exhausts payment retries.
However, an order can also become 'failed' if an administrator manually marks it as failed in the UI. In this case, I suspect that most administrators would NOT expect further charge attempts to be made against the order they have marked as failed.
We could have the queued job not try to close a failed order. But that would prevent retrying a failed order job using the advanced_queue UI (without first changing the state from failed back to to need_payment, for which there is currently no transition and therefore no button on the order).
The only solution I can see is to add a "retry payment" transition for failed -> needs_payment, and a queue a new job if that transition is made (because there may or may no be an existing job with retries still pending, we can't know).
It looks like we should NOT reject failed orders in closeOrder(). Programatically attempting to close an order that has failed is not crazy, and the 'mark_paid transition explicitly allows transitions from 'failed' to 'completed'.
Active
1.0
Code
Not all content is available!
It's likely this issue predates Contrib.social: some issue and comment data are missing.
This is a temporary solution to stop closing a failed order, until we agree on a permanent solution.
emircan erkul β made their first commit to this issueβs fork.