waaseyaa / billing
Stripe billing for Waaseyaa — subscriptions, checkout, portal, plan tiers
Requires
- php: >=8.5
- stripe/stripe-php: ^16.0
- waaseyaa/foundation: ^0.1.0-alpha.266
Requires (Dev)
- phpunit/phpunit: ^10.5
This package is auto-updated.
Last update: 2026-07-15 18:29:30 UTC
README
Layer 3 — Services
Stripe billing for Waaseyaa: subscriptions, checkout, customer portal, plan tiers.
BillingManager is the single entry point for plan tier resolution, checkout session creation, and customer-portal URLs. StripeClientInterface plus FakeStripeClient make the integration testable without hitting Stripe; WebhookHandler maps verified Stripe webhook events into structured arrays.
WebhookHandler accepts an optional atomic event-claim closure. Production consumers must back this seam with durable storage keyed by Stripe event.id: return true only for the first delivery and false for duplicates. When the seam is configured, a supported event without an id fails closed. Every handled result exposes event_id; invoice results carry currency beside Stripe's integer minor-unit amount so downstream code never interprets an amount without its currency.
Key classes: BillingManager, BillingServiceProvider, CheckoutSession, PlanTier, StripeClientInterface, WebhookHandler.
Scope
This package is v0.1 scaffolding. The public surface (BillingManager, StripeClientInterface, WebhookHandler, PlanTier, CheckoutSession, SubscriptionData, FakeStripeClient, BillingServiceProvider) is marked @api to preserve it from dead-code removal while the integration remains partially wired.
Out of scope for v0.1
Full Stripe billing integration — including a durable webhook event-claim store, signature-verifying Stripe adapter, subscription lifecycle management, and payment failure handling — is deferred to post-v0.1. The scaffold exists to:
- Reserve the
waaseyaa/billingpackage namespace. - Define the
StripeClientInterfacecontract so downstream code can type-hint against it. - Provide
FakeStripeClientfor testing billing-adjacent logic without hitting Stripe.
Roadmap
Billing activation is planned for the v0.2 cycle alongside the Minoo distribution layer. See the empty-package-decisions-analytics-billing-aischema-01KSEFV4 mission (WP02) and the alpha-to-beta plan for deferral rationale.