Subscription trial state is never set if no initial order was created

Created on 7 August 2024, 8 months ago

Problem/Motivation

There is only one place in the code where the trial state of the Subscription is set - that is via the onPlace transition event. When Subscription is created not via checkout but directly from the admin interface (or programmatically) then the trial state is never set on the respective subscription. Having common flow for all trial-enabled subscriptions is desirable and this issue is about ensuring the trial state is always set, wether subscription is created via checkout or in another way.

Steps to reproduce

- Manually create Subscription via /admin/commerce/subscriptions/add
- Enter the trial date and start date.
- Run cron. Observe the Subscription is Pending until the Start date passes. At that point activation job is added to the advancedqueue and when processed Subscription changes its state to Active.

Proposed resolution

Enqueue pending subscriptions also when the trial date passes, either via an activation job or a separate one.

Remaining tasks

User interface changes

API changes

Data model changes

🐛 Bug report
Status

Active

Version

1.0

Component

Code

Created by

🇳🇴Norway zaporylie

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

Comments & Activities

Production build 0.71.5 2024