Do not delete all order items from the current order when cancelling a subscription

Created on 3 May 2023, about 1 year ago

Problem/Motivation

After subscription cancellation, I'd like to do something based on the order that was cancelled, in its most recent state. That's the current (draft) order.

But when cancelling a subscription, RecurringOrderManager::applyCharges() removes all order items from that order. It does so because there are now no charges to apply to the order, and it removes the "unused" order items.

Valuable followup data is being lost here.

Steps to reproduce

Cancel a subscription, check the current order (now canceled). There are no order items and no order amount.

Proposed resolution

Any solution might need to be configurable behaviour, some implementations may expect the order to be empty after subscription cancel?

As a workaround, I'll likely store the order items at subscription pre-cancel and restore them as soon as possible after that.

πŸ› Bug report
Status

Active

Version

1.0

Component

Code

Created by

πŸ‡³πŸ‡ΏNew Zealand John Pitcairn

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

Comments & Activities

Production build 0.69.0 2024