Problem/Motivation
The connector supports fixed-price (licensed) subscriptions only. A common SaaS pattern is a subscription that combines a fixed monthly fee with a usage-based (metered) component, for example a base plan plus a per-gigabyte storage charge. Stripe models this as one subscription with two items: a licensed price and a metered price.
Today that shape breaks the module's assumptions:
syncRemoteSubscriptionToLocal()assumes a single plan per subscription, so a two-item subscription synchronizes ambiguously at best.- Plan synchronization does not distinguish metered prices from licensed ones, and metered prices must not be offered as standalone subscribe targets (they have no fixed amount, and checkout line items for them must omit
quantity).
Checkout itself is already extensible: an event subscriber for StripeCreateSubscribeSessionEvent can inject the metered line item into the session parameters today, without patching the module. The gap is synchronization, representation, and display.
Proposed resolution
Builds on two other issues: #3615737: Migrate from the legacy Plans API to the Prices API in this queue (metered prices are Prices-API objects), and #3615735: Add a rating step for usage-based charges, delivered per connector scheduling mode in the Subscription Manager queue (local representation of multi-component subscriptions).
- Plan synchronization recognizes
recurring.usage_type = meteredon a price, stores the distinction on the local plan entity, and excludes metered plans from standalone subscribe flows. - Webhook synchronization maps all subscription items to local components (per the Subscription Manager issue): role assignment keys off the licensed component; the metered component is recorded alongside it.
- Optionally, checkout convenience: a plan-level setting linking a licensed plan to a metered companion price, so the module adds the metered line item itself and site builders do not need a custom event subscriber.
- Subscription display data includes the metered component ("Storage: metered, billed monthly on usage").
Remaining tasks
- Land the two prerequisite issues.
- Implement synchronization + display as above.
- Test-mode verification of the full lifecycle: checkout with two line items, webhook creation, plan change, cancellation.
- Tests.
User interface changes
Metered plans are labelled in the synchronized plan listing and excluded from subscribe links; subscription display gains the metered component line. Optional companion-price setting on the plan form.
API changes
None beyond what the prerequisite issues introduce.
Data model changes
Local plan entities gain a usage-type flag (licensed/metered). The subscription-side model comes from the Subscription Manager issue.
Comments
Comment #2
colan