Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions src/app/api/core/types/webhook.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,5 +5,6 @@ export enum WebhookEvents {
PRICE_CREATED = 'price.created',
INVOICE_PAID = 'invoice.paid',
INVOICE_VOIDED = 'invoice.voided',
INVOICE_UPDATED = 'invoice.updated',
PAYMENT_SUCCEEDED = 'payment.succeeded',
}
4 changes: 4 additions & 0 deletions src/app/api/quickbooks/webhook/webhook.service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -88,6 +88,10 @@ export class WebhookService extends BaseService {
case WebhookEvents.INVOICE_VOIDED:
return await this.handleInvoiceVoided(payload, qbTokenInfo)

case WebhookEvents.INVOICE_UPDATED:
await sleep(7000) // invoice.updated event is triggered even when invoice created
return await this.handleInvoiceCreated(payload, qbTokenInfo)

case WebhookEvents.PAYMENT_SUCCEEDED:
return await this.handlePaymentSucceeded(payload, qbTokenInfo)

Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
CREATE UNIQUE INDEX "uq_qb_customers_client_company_id_active_idx" ON "qb_customers" USING btree ("client_company_id") WHERE "qb_customers"."deleted_at" is null;
Loading
Loading