Stripe Billing activation, renewal accounting, and cancellation for the shared subscription intent.
Implements the constrained fixed-price profile from
draft-stripe-subscription-00: one Customer, one recurring Price, one
quantity-one Subscription, and synchronously paid invoices mapped onto
locally persisted canonical periods.
Summary
Functions
Schedule cancellation at the end of the last durably paid billing period.
Return the public Stripe subscription challenge fields.
Process a Stripe subscription event after its webhook signature has been verified.
Validate and durably record a paid Stripe renewal invoice.
Validate Stripe subscription configuration at Plug initialization.
Activate a Stripe subscription and verify its synchronously paid first invoice.
Stop Stripe collection for an unpaid invoice after its canonical period closes.
Functions
@spec cancel(String.t(), map()) :: {:ok, MPP.Subscription.Record.t()} | {:error, MPP.Errors.t()}
Schedule cancellation at the end of the last durably paid billing period.
@spec challenge_method_details(MPP.Intents.Subscription.t()) :: map()
Return the public Stripe subscription challenge fields.
@spec process_event(map(), map()) :: {:ok, MPP.Subscription.Record.t()} | {:error, MPP.Errors.t()}
Process a Stripe subscription event after its webhook signature has been verified.
@spec process_invoice(String.t(), String.t(), map()) :: {:ok, MPP.Receipt.t()} | {:error, MPP.Errors.t()}
Validate and durably record a paid Stripe renewal invoice.
@spec validate_config!(map()) :: :ok
Validate Stripe subscription configuration at Plug initialization.
@spec verify(map(), MPP.Intents.Subscription.t()) :: {:ok, MPP.Receipt.t()} | {:error, MPP.Errors.t()}
Activate a Stripe subscription and verify its synchronously paid first invoice.
@spec void_stale_invoice(String.t(), String.t(), DateTime.t(), map()) :: {:ok, MPP.Subscription.Record.t()} | {:error, MPP.Errors.t()}
Stop Stripe collection for an unpaid invoice after its canonical period closes.