From 83cebfdbfde01839df0a3d5e47bf0c273a9dc565 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Kevin=20Gr=C3=BCneberg?= Date: Sat, 31 May 2025 11:44:57 +0800 Subject: [PATCH] feat: support additional invoice events - Adds support for three new events - Removes support for invoices.upcoming given that never worked (see #114) --- README.md | 5 ++++- src/routes/webhooks.ts | 4 +++- 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index 81528aee3..6c416c585 100644 --- a/README.md +++ b/README.md @@ -70,8 +70,11 @@ This server synchronizes your Stripe account to a Postgres database. It can be a - [x] `invoice.payment_failed` 🟢 - [x] `invoice.payment_succeeded` 🟢 - [x] `invoice.sent` 🟢 -- [x] `invoice.upcoming` 🟢 +- [x] `invoice.upcoming` 🔴 - Event has no id and cannot be processed - [x] `invoice.updated` 🟢 +- [x] `invoice.overdue` 🟢 +- [x] `invoice.overpaid` 🟢 +- [x] `invoice.will_be_due` 🟢 - [x] `invoice.voided` 🟢 - [ ] `issuing_authorization.request` - [ ] `issuing_card.created` diff --git a/src/routes/webhooks.ts b/src/routes/webhooks.ts index 0e7375edc..f426779d1 100644 --- a/src/routes/webhooks.ts +++ b/src/routes/webhooks.ts @@ -82,7 +82,9 @@ export default async function routes(fastify: FastifyInstance) { case 'invoice.payment_action_required': case 'invoice.payment_failed': case 'invoice.payment_succeeded': - case 'invoice.upcoming': + case 'invoice.overdue': + case 'invoice.overpaid': + case 'invoice.will_be_due': case 'invoice.sent': case 'invoice.voided': case 'invoice.marked_uncollectible':