Accentio Payments
Summary
Accentio Payments is the billing and licensing engine of Accentio Studios. It keeps payments, subscriptions, licenses and invoices in one ledger, over Stripe, Mercado Pago, PayPal, NuPay and bank transfer, and tells each app who holds a license, by query or by webhook. It runs as one NestJS 11 process on Fastify and MongoDB, with a React staff panel built on Excelsior. It is in construction: the foundations, apps, catalog, holders and licenses are done, and staging and production deploys are written and wait for their first run.
Highlights
Provider port with four drivers4 provider drivers on 1 port, verified against simulators
Designed one provider port behind which Stripe, Mercado Pago, PayPal and NuPay drivers translate each provider's events into domain commands. Each provider runs simulated, sandbox, live or off, and startup fails when a provider has no driver.
Inbox, outbox and retries
Built the event pipeline: incoming provider webhooks land in an inbox after signature checks, and outgoing webhooks to the apps leave from an outbox, signed and retried on a schedule.
Idempotent writes and locked jobs
Made writes safe to retry with an Idempotency-Key interceptor, and ran background jobs (expirations, settlements, webhook retries) under locks so each job runs on one instance at a time.
Fee engine and invoices
Built a fee engine that prices each charge so its total covers provider fees and taxes, and invoices with their own payment link and a PDF printed from the same HTML as the editor's live preview.
Tests, docs and SDKAbout 10,700 test cases across 694 spec files; 152 HTTP routes in 41 controllers
Covered the engine with unit, integration, contract and visual tests, documented it in 240 Diátaxis documents with a reference generated from the code, and wrote a NestJS SDK for the apps.