Finish removing Stripe from codebase

This commit is contained in:
Tuan Dang
2023-06-22 16:38:02 +07:00
parent f3e84dc6eb
commit 28943f3b6f
25 changed files with 52 additions and 290 deletions
-2
View File
@@ -1,4 +1,3 @@
import * as stripeController from "./stripeController";
import * as secretController from "./secretController";
import * as secretSnapshotController from "./secretSnapshotController";
import * as organizationsController from "./organizationsController";
@@ -8,7 +7,6 @@ import * as membershipController from "./membershipController";
import * as cloudProductsController from "./cloudProductsController";
export {
stripeController,
secretController,
secretSnapshotController,
organizationsController,
@@ -52,7 +52,7 @@ export const getOrganizationPmtMethods = async (req: Request, res: Response) =>
}
/**
* Return a Stripe session URL to add payment method for organization
* Return URL to add payment method for organization
*/
export const addOrganizationPmtMethod = async (req: Request, res: Response) => {
const {
@@ -1,31 +0,0 @@
import { Request, Response } from "express";
import Stripe from "stripe";
import { getStripeSecretKey, getStripeWebhookSecret } from "../../../config";
/**
* Handle service provisioning/un-provisioning via Stripe
* @param req
* @param res
* @returns
*/
export const handleWebhook = async (req: Request, res: Response) => {
const stripe = new Stripe(await getStripeSecretKey(), {
apiVersion: "2022-08-01",
});
// check request for valid stripe signature
const sig = req.headers["stripe-signature"] as string;
const event = stripe.webhooks.constructEvent(
req.body,
sig,
await getStripeWebhookSecret()
);
switch (event.type) {
case "":
break;
default:
}
return res.json({ received: true });
};
-7
View File
@@ -1,7 +0,0 @@
import express from "express";
const router = express.Router();
import { stripeController } from "../../controllers/v1";
router.post("/webhook", stripeController.handleWebhook);
export default router;
+1 -1
View File
@@ -83,7 +83,7 @@ class EELicenseService {
if (!organization) throw OrganizationNotFoundError();
let url = `${await getLicenseServerUrl()}/api/license-server/v1/customers/${organization.customerId}/cloud-plan`;
if (workspaceId) {
url += `?workspaceId=${workspaceId}`;
}