feat: Verify paddle webhooks
This commit is contained in:
14
packages/backend/src/controllers/paddle/webhooks.ee.ts
Normal file
14
packages/backend/src/controllers/paddle/webhooks.ee.ts
Normal file
@@ -0,0 +1,14 @@
|
||||
import { Response } from 'express';
|
||||
import { IRequest } from '@automatisch/types';
|
||||
import Billing from '../../helpers/billing/index.ee';
|
||||
|
||||
export default async (request: IRequest, response: Response) => {
|
||||
const isVerified = Billing.paddleClient.verifyWebhookData(request.body);
|
||||
|
||||
if (!isVerified) {
|
||||
return response.sendStatus(401);
|
||||
}
|
||||
|
||||
// TODO: Handle Paddle webhooks
|
||||
return response.sendStatus(200);
|
||||
};
|
Reference in New Issue
Block a user