Add EventNotificationHandler#3250
Conversation
7a594d9 to
3e3987b
Compare
|
Not sure if the comment should go here or in your doc, but HandleUnhandledError seems like the wrong name in your example. That's just HandleUnhandledEventNotification, right? |
| /// </summary> | ||
| /// <param name="eventNotification">The event notification instance.</param> | ||
| /// <param name="client">The StripeClient instance.</param> | ||
| public StripeEventNotificationEventArgs(TEventNotification eventNotification, StripeClient client) |
There was a problem hiding this comment.
will this ever get constructed outside of our SDK code? If not, I would consider changing this constructor to be internal
There was a problem hiding this comment.
Wouldn't users need it for tests? Like, if they write their function and want to test it in isolation, that function takes these args and they'd nee to be able to construct it?
jar-stripe
left a comment
There was a problem hiding this comment.
Took a pass thru, it looks largely good (the names are pretty long and I left a comment in your naming doc), but I have concerns about StripeClient/ApiRequestor reuse when you swap in and out the StripeContext
|
Also, we should consider adding the example from the PR description as an actual example in the project, so folks can see how to use this from code they can easily find. |
|
|
|
ok @jar-stripe this is ready for re-review! My biggest open question is about supporting async - in Node, all of the callbacks return promises for easier integration with making stripe client calls. In python we haven't added support for async (yet) since i'm not positive how we'll do it. For dotnet, I know users can call async functions syncronously. So, is it worth having Also re: naming. Dotnet having a built-in event thing called a "handler" (that other languages call a "callback") muddles our naming a bit. Is it worth diverging from the other languages here for consistency? Basically, the fill-in-the-blank exercise we did for the other languages is:
Today, it's
But should dotnet be different? |
|
ignoring CLA check (??) and merging |
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