-
Notifications
You must be signed in to change notification settings - Fork 30
Webhook Handling for chargebee-node #100
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: master
Are you sure you want to change the base?
Conversation
✅ Snyk checks have passed. No issues have been found so far.
💻 Catch issues earlier using the plugins for VS Code, JetBrains IDEs, Visual Studio, and Eclipse. |
| Subscription: import('chargebee').Subscription; | ||
|
|
||
| Customer: import('chargebee').Customer; | ||
|
|
||
| UsageReminderInfo: import('chargebee').UsageReminderInfo; | ||
| } |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can't we just do a top level import * as Chargebee from 'chargebee' and then refer the objects using chargebee.Customer? Will reduce the verbosity of having imports everywhere.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We can't use import * as Chargebee from 'chargebee' here because content.ts lives inside the chargebee package itself, and the tsconfig uses moduleResolution: "node" which doesn't support self-referencing imports.
| }); | ||
|
|
||
| // Catch processing errors (invalid JSON, validator failure, etc.) | ||
| handler.on('error', (err) => { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Errors here will be swallowed silently. We should pass the request and response objects here as well so it can be handled appropriately?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, that's right, I have included it now.
What
Adds
chargebee.webhooksnamespace for handling Chargebee webhook events with TypeScript support.Features
on()/once()/off()patternscreateHandler()factory for isolated handlersUsage
Basic (Global Handler)
Isolated Handlers (Multi-route / Multi-tenant)
Error Handling