framework
NestJS
Connect portable Playstack capabilities to dependency injection, guards, decorators, request context, workers, and lifecycle hooks.
Compose server-authored products, one-time checkout, finite stock, immutable orders, and physical fulfillment without turning one provider into the domain model.
available
Resolve immutable server-authored offers against an explicit payment provider and configured merchant instance.
available
Persist an order and optional stock reservation before creating hosted provider checkout with repeat-safe commands.
available
Project verified payment, refund, and dispute events while keeping browser redirects outside payment authority.
available
Create encrypted fulfillment requests and run manual or provider-backed delivery work independently of payment state.
framework
Connect portable Playstack capabilities to dependency injection, guards, decorators, request context, workers, and lifecycle hooks.
integration
Persist Playstack capabilities through explicit application-owned Prisma clients, transactions, and managed schema fragments.
integration
Create hosted subscription and one-time checkout, then reconcile verified Stripe events into separate billing and payment projections.
Catalog owns the terms offered for sale. Payments owns provider projections. Inventory owns stock promises. Commerce owns immutable order snapshots and coordinates their transaction boundaries. Fulfillment owns what happens to paid physical lines next.
const commerce = createCommerce({
persistence,
catalog,
payments,
inventory,
entitlements,
fulfillment,
events,
ids,
orderNumbers,
clock,
allowedRedirectOrigins: ['https://shop.example.com'],
})
const result = await commerce.createCheckout({
buyer: { accountId, userId, email },
items: [{ offerId: 'controller-stand-black', quantity: 1 }],
paymentProvider: { provider: 'stripe', instance: 'store' },
successUrl,
cancelUrl,
idempotencyKey,
})The browser submits offer identities and quantities, never authoritative prices. Order creation and stock reservation can share one application transaction. Hosted checkout starts only after that commit.
Success redirects improve the buyer experience but never confirm an order. Verified, queued webhook projections flow through @playstack/payments before @playstack/commerce advances payment state. Amount drift quarantines the order for reconciliation.
await payments.handleWebhook(verifiedPaymentEvent)
await commerce.applyPaymentProjection(paymentProjection)Provider and configured instance are both persisted identities, so one application can safely use multiple Stripe accounts or mix future providers.
@playstack/fulfillment encrypts address material behind an application codec. Its manual driver supports real staff workflows, while the Nest worker boundary can run through BullMQ, Inngest, or another queue. Subscriptions remain a separate Billing and entitlements path and can coexist with one-time purchases.