mirror of
https://github.com/bigcapitalhq/bigcapital.git
synced 2026-02-19 06:10:31 +00:00
feat(server): Plaid webhooks
This commit is contained in:
@@ -2,6 +2,7 @@ import { Inject, Service } from 'typedi';
|
||||
import { PlaidLinkTokenService } from './PlaidLinkToken';
|
||||
import { PlaidItemService } from './PlaidItem';
|
||||
import { PlaidItemDTO } from '@/interfaces';
|
||||
import { PlaidWebooks } from './PlaidWebhooks';
|
||||
|
||||
@Service()
|
||||
export class PlaidApplication {
|
||||
@@ -11,6 +12,9 @@ export class PlaidApplication {
|
||||
@Inject()
|
||||
private plaidItemService: PlaidItemService;
|
||||
|
||||
@Inject()
|
||||
private plaidWebhooks: PlaidWebooks;
|
||||
|
||||
/**
|
||||
* Retrieves the Plaid link token.
|
||||
* @param {number} tenantId
|
||||
@@ -30,4 +34,26 @@ export class PlaidApplication {
|
||||
public exchangeToken(tenantId: number, itemDTO: PlaidItemDTO): Promise<void> {
|
||||
return this.plaidItemService.item(tenantId, itemDTO);
|
||||
}
|
||||
|
||||
/**
|
||||
* Listens to Plaid webhooks
|
||||
* @param {number} tenantId
|
||||
* @param {string} webhookType
|
||||
* @param {string} plaidItemId
|
||||
* @param {string} webhookCode
|
||||
* @returns
|
||||
*/
|
||||
public webhooks(
|
||||
tenantId: number,
|
||||
webhookType: string,
|
||||
plaidItemId: string,
|
||||
webhookCode: string
|
||||
) {
|
||||
return this.plaidWebhooks.webhooks(
|
||||
tenantId,
|
||||
webhookType,
|
||||
plaidItemId,
|
||||
webhookCode
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user