-
Notifications
You must be signed in to change notification settings - Fork 468
add event handler class #1653
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: beta
Are you sure you want to change the base?
add event handler class #1653
Conversation
|
|
||
| # tie the client to the context of the event temporarily | ||
| # there's probably a better way to do this | ||
| original_context = self._client._requestor._options.stripe_context |
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 need to address concurrency here; the GIL may not save us because it releases on IO operations.
jar-stripe
left a comment
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.
other than the concurrency issue around setting stripe context, this looks good!
Why?
We've been designing a streamlined approach to handling incoming events that is easy to get right and hard to get wrong. This PR has the initial implementation of this new system.
The only other pending item is to add a method to allow handling a webhook without verifying the signature. This is good for testing and for Event Bridge, which doesn't use the signature-based verification. Otherwise, this is ready for review.
What?
EventHandlerclassStripeClientExample usage
See Also