mirror of
https://github.com/bigcapitalhq/bigcapital.git
synced 2026-02-15 20:30:33 +00:00
feat(server): Plaid webhooks
This commit is contained in:
@@ -16,6 +16,7 @@ export class PlaidBankingController extends BaseController {
|
||||
|
||||
router.post('/link-token', this.linkToken.bind(this));
|
||||
router.post('/exchange-token', this.exchangeToken.bind(this));
|
||||
router.post('/webhooks', this.webhooks.bind(this));
|
||||
|
||||
return router;
|
||||
}
|
||||
@@ -50,4 +51,21 @@ export class PlaidBankingController extends BaseController {
|
||||
});
|
||||
return res.status(200).send({});
|
||||
}
|
||||
|
||||
public async webhooks(req: Request, res: Response) {
|
||||
const { tenantId } = req;
|
||||
const {
|
||||
webhook_type: webhookType,
|
||||
webhook_code: webhookCode,
|
||||
item_id: plaidItemId,
|
||||
} = req.body;
|
||||
|
||||
await this.plaidApp.webhooks(
|
||||
tenantId,
|
||||
webhookType,
|
||||
plaidItemId,
|
||||
webhookCode
|
||||
);
|
||||
return res.status(200).send({ code: 200, message: 'ok' });
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user