feat: Verify paddle webhooks

This commit is contained in:
Faruk AYDIN
2023-03-21 22:02:11 +03:00
parent 4202f963c3
commit e1d26325f3
9 changed files with 201 additions and 8 deletions

View 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);
};