License subscription does not cancel when a trial subscription is cancelled

Created on 2 June 2025, 3 months ago

Problem/Motivation

When a subscription for a licence is cancelled, if the subscription is within its free trial period, then the licence does not get cancelled. This is serious, as it means that the license then remains active for an indefinite period.

Steps to reproduce

Create a subscription to a licence, with a free trial period. Within the free trial period, cancel the subscription.

Proposed resolution

commerce_licence/src/Plugin/Commerce/SubscriptionType/LicenceSubscription.php implements the onSubscriptionCancel() method - which does the correct thing when a subscription *without* a free trial is cancelled. It also needs an implementation of the onSubscriptionTrialCancel() method, which is called when a subscription *with* a free trial is cancelled. i.e.

  public function onSubscriptionTrialCancel(SubscriptionInterface $subscription) {
    $this->onSubscriptionCancel($subscription);
  }

Remaining tasks

Add the above code into LicenceSubscription.php

User interface changes

none

API changes

none

Data model changes

none

🐛 Bug report
Status

Active

Version

3.0

Component

Code

Created by

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

Comments & Activities

Production build 0.71.5 2024