mirror of
https://github.com/bigcapitalhq/bigcapital.git
synced 2026-02-10 18:01:59 +00:00
feat: Clean up payment links endpoints
This commit is contained in:
@@ -27,10 +27,6 @@ export class StripeIntegrationController extends BaseController {
|
||||
this.validationResult,
|
||||
asyncMiddleware(this.createAccountLink.bind(this))
|
||||
);
|
||||
router.post(
|
||||
'/:linkId/create_checkout_session',
|
||||
this.createCheckoutSession.bind(this)
|
||||
);
|
||||
return router;
|
||||
}
|
||||
|
||||
@@ -75,33 +71,6 @@ export class StripeIntegrationController extends BaseController {
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Creates a Stripe checkout session for the given payment link id.
|
||||
* @param {Request} req
|
||||
* @param {Response} res
|
||||
* @param {NextFunction} next
|
||||
* @returns {Promise<Response|void>}
|
||||
*/
|
||||
public async createCheckoutSession(
|
||||
req: Request<{ linkId: number }>,
|
||||
res: Response,
|
||||
next: NextFunction
|
||||
) {
|
||||
const { linkId } = req.params;
|
||||
const { tenantId } = req;
|
||||
|
||||
try {
|
||||
const session =
|
||||
await this.stripePaymentApp.createSaleInvoiceCheckoutSession(
|
||||
tenantId,
|
||||
linkId
|
||||
);
|
||||
return res.status(200).send(session);
|
||||
} catch (error) {
|
||||
next(error);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Creates a new Stripe account.
|
||||
* @param {Request} req - The Express request object.
|
||||
|
||||
Reference in New Issue
Block a user