Skip to main content

SubscriptionEndReason

\Benecaster\Bridge\SubscriptionEndReason

Class Premium

Why a membership ended, as a bridge reports it to the callback registered through BridgeInterface::on_subscription_cancelled(). Plain string constants, not an enum, on purpose — third-party bridges call the callback, and a string is the contract they can meet without importing anything. A bridge that passes no reason (every bridge before 2026-09-18, and any third-party one written since) means CANCELLED.

EXPIRED is a lapse: the membership ran out and was not renewed (a fixed-term plan reaching its end, or renewals that failed until the plugin gave up). CANCELLED is a decision — the member or an admin ended it. The two matter differently to a win-back campaign, which is why benecaster_subscription_expired exists alongside benecaster_subscription_cancelled.

Methods

Method Visibility Since Description
normalize( mixed $reason ): string Anything unrecognised reads as CANCELLED, the pre-2026-09-18 meaning.

Constants

Name Value Description
CANCELLED 'cancelled' A decision — the member or an admin ended the membership.
EXPIRED 'expired' A lapse — the membership ran out and was not renewed.

Notes

Final class, not instantiable — constructor is private.