Skip to content

Commit c9dac92

Browse files
authored
feat: add support for additional subscription/invoice events (#95)
1 parent 2d1fd12 commit c9dac92

File tree

2 files changed

+8
-0
lines changed

2 files changed

+8
-0
lines changed

README.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -53,14 +53,18 @@ This server synchronizes your Stripe account to a Postgres database. It can be a
5353
- [x] `customer.subscription.pending_update_applied` 🟢
5454
- [x] `customer.subscription.pending_update_expired` 🟢
5555
- [x] `customer.subscription.resumed` 🟢
56+
- [x] `customer.subscription.trial_will_end` 🟢
5657
- [x] `customer.subscription.updated` 🟢
5758
- [x] `customer.updated` 🟢
5859
- [x] `invoice.created` 🟢
5960
- [x] `invoice.deleted` 🟢
6061
- [x] `invoice.finalized` 🟢
62+
- [x] `invoice.finalization_failed` 🟢
6163
- [x] `invoice.paid` 🟢
64+
- [x] `invoice.payment_action_required` 🟢
6265
- [x] `invoice.payment_failed` 🟢
6366
- [x] `invoice.payment_succeeded` 🟢
67+
- [x] `invoice.upcoming` 🟢
6468
- [x] `invoice.updated` 🟢
6569
- [ ] `issuing_authorization.request`
6670
- [ ] `issuing_card.created`

src/routes/webhooks.ts

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -55,6 +55,7 @@ export default async function routes(fastify: FastifyInstance) {
5555
case 'customer.subscription.paused':
5656
case 'customer.subscription.pending_update_applied':
5757
case 'customer.subscription.pending_update_expired':
58+
case 'customer.subscription.trial_will_end':
5859
case 'customer.subscription.resumed':
5960
case 'customer.subscription.updated': {
6061
const subscription = event.data.object as Stripe.Subscription
@@ -64,9 +65,12 @@ export default async function routes(fastify: FastifyInstance) {
6465
case 'invoice.created':
6566
case 'invoice.deleted':
6667
case 'invoice.finalized':
68+
case 'invoice.finalization_failed':
6769
case 'invoice.paid':
70+
case 'invoice.payment_action_required':
6871
case 'invoice.payment_failed':
6972
case 'invoice.payment_succeeded':
73+
case 'invoice.upcoming':
7074
case 'invoice.updated': {
7175
const invoice = event.data.object as Stripe.Invoice
7276
await upsertInvoices([invoice])

0 commit comments

Comments
 (0)