This commit is contained in:
Alex Holliday committed 2025-12-02 00:20:09 +00:00
1 parent 01c0e9ef4d
commit 1b162578c2
22 files changed
+450 -72

No files matched your search

+12
View File
@@ -26,6 +26,18 @@ class BillingRoutes {
validateBody(subscribePlanSchema),
this.controller.subscribePlan
);
this.router.post(
"/cancel",
verifyToken,
addUserContext,
this.controller.cancelPlan
);
this.router.get(
"/confirm",
verifyToken,
addUserContext,
this.controller.confirmPlan
);
};
getRouter() {
+6 -3
View File
@@ -1,4 +1,4 @@
import { Router } from "express";
import { Router, raw } from "express";
import StripeController from "@/controllers/StripeController.js";
// Note: webhook route must be mounted with express.raw at app/init level.
@@ -12,7 +12,11 @@ class StripeRoutes {
}
initRoutes = () => {
this.router.post("/webhook", this.controller.webhook);
this.router.post(
"/webhook",
raw({ type: "application/json" }),
this.controller.webhook
);
};
getRouter() {
@@ -21,4 +25,3 @@ class StripeRoutes {
}
export default StripeRoutes;