Skip to content

Commit

Permalink
feat: handle remaining subscription events (#80)
Browse files Browse the repository at this point in the history
  • Loading branch information
kevcodez authored May 29, 2023
1 parent 0ba73d7 commit e5135ca
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 0 deletions.
4 changes: 4 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,10 @@ This server synchronizes your Stripe account to a Postgres database. It can be a
- [ ] `customer.source.updated`
- [x] `customer.subscription.created` 🟢
- [x] `customer.subscription.deleted` 🟢
- [x] `customer.subscription.paused` 🟢
- [x] `customer.subscription.pending_update_applied` 🟢
- [x] `customer.subscription.pending_update_expired` 🟢
- [x] `customer.subscription.resumed` 🟢
- [x] `customer.subscription.updated` 🟢
- [x] `customer.updated` 🟢
- [x] `invoice.created` 🟢
Expand Down
4 changes: 4 additions & 0 deletions src/routes/webhooks.ts
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,10 @@ export default async function routes(fastify: FastifyInstance) {
}
case 'customer.subscription.created':
case 'customer.subscription.deleted': // Soft delete using `status = canceled`
case 'customer.subscription.paused':
case 'customer.subscription.pending_update_applied':
case 'customer.subscription.pending_update_expired':
case 'customer.subscription.resumed':
case 'customer.subscription.updated': {
const subscription = event.data.object as Stripe.Subscription
await upsertSubscriptions([subscription])
Expand Down

0 comments on commit e5135ca

Please sign in to comment.