Failed orders can still have automatic charge attempts

Created on 9 February 2021, almost 4 years ago
Updated 14 July 2024, 4 months ago

Problem/Motivation

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.

Proposed resolution

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'.

Remaining tasks

User interface changes

API changes

Data model changes

πŸ› Bug report
Status

Active

Version

1.0

Component

Code

Created by

πŸ‡¬πŸ‡§United Kingdom jonathanshaw Stroud, UK

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Merge Requests

Comments & Activities

Not all content is available!

It's likely this issue predates Contrib.social: some issue and comment data are missing.

Production build 0.71.5 2024