From f1bb4dedbbb9b86d98301920c7bc8b93c3b61e60 Mon Sep 17 00:00:00 2001 From: stephanieefeakpokrire-droid Date: Sat, 26 Sep 2026 11:49:37 +0100 Subject: [PATCH] feat(api): mount subscriptions, payment-retry, and payment-methods routers MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Resolves #808 — wire Stripe subscription billing routes at /api/v1/subscriptions (already implemented in routes/subscriptions.ts + services/stripe.ts). Resolves #809 — invoice generation with PDF export was already mounted at /api/v1/invoice (GET /:id/pdf via buildInvoicePdf); documented alongside the related mounts so the four billing issues land together. Resolves #810 — wire payment retry (exponential backoff) at /api/v1/payment-retry (routes/retry.ts + services/retry/*). Resolves #811 — wire multiple payment methods per account at /api/v1/payment-methods (routes/payment-methods.ts). --- backend/src/index.ts | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/backend/src/index.ts b/backend/src/index.ts index f9147c7e..203caf3c 100644 --- a/backend/src/index.ts +++ b/backend/src/index.ts @@ -30,6 +30,15 @@ import { backupRouter } from './routes/backup.js'; import { pushRouter } from './routes/push.js'; import { ipAllowlistRouter } from './routes/ip-allowlist.js'; import { stripeRouter } from './routes/stripe.js'; +// Stripe subscription billing (plans, enroll, usage, dunning) — Issue #808. +// Implemented in routes/subscriptions.ts + services/stripe.ts but never mounted. +import subscriptionsRouter from './routes/subscriptions.js'; +// Payment retry with exponential backoff — Issue #810. +// Implemented in routes/retry.ts + services/retry/* but never mounted. +import { retryRouter } from './routes/retry.js'; +// Multiple payment methods per account (incl. micro-deposit verify) — Issue #811. +// Implemented in routes/payment-methods.ts but never mounted. +import { paymentMethodsRouter } from './routes/payment-methods.js'; import { ipAllowlistMiddleware, initIpAllowlist } from './middleware/ip-allowlist.js'; import { SecurityMiddleware, SecurityMonitor, securityHeadersMiddleware } from './middleware/security.js'; import { sanitizeInput, contentSecurityPolicy } from './middleware/sanitize.js'; @@ -321,6 +330,14 @@ apiV1Router.use('/cors', corsRouter); apiV1Router.use('/push', pushRouter); // Stripe card payments apiV1Router.use('/stripe', stripeRouter); +// Stripe subscription billing — Issue #808 +apiV1Router.use('/subscriptions', subscriptionsRouter); +// Invoice generation + PDF export is already mounted at /invoice (Issue #809: +// GET /api/v1/invoice/:id/pdf via buildInvoicePdf in services/invoice.ts). +// Payment retry engine (exponential backoff, circuit breaker, analytics) — Issue #810 +apiV1Router.use('/payment-retry', retryRouter); +// Multiple payment methods per account — Issue #811 +apiV1Router.use('/payment-methods', paymentMethodsRouter); // Automated tax reporting, export, and calendar — Issues #690–#693 apiV1Router.use('/tax-reporting', taxReportingRouter); // Cross-chain wallet abstraction & unified balance aggregation — Issue #711