-
Notifications
You must be signed in to change notification settings - Fork 390
Add StripeContext object
#2057
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
Add StripeContext object
#2057
Conversation
mbroshi-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.
Overall feedback is that I'd keep a single representation of StripeContext that does the right thing when it comes to serialization/deserialization rather than switching between object and string representations internally.
|
ok, should be all set! |
mbroshi-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.
Looks great! Thanks for incorporating the feedback!
Why?
As the
stripe-contextheader is evolving, we want to give better tools for creating and managing contexts. This PR adds a new class,StripeContext. It can be used anywhere the context option is supplied and gets serialized to a string when making requests. It's also found on theEventNotification.contextproperty.What?
StripeContextclassChangelog
StripeContextclass. Previously, you could set the stripe context only as a string viaStripeClientBuilder .setStripeContext(). The same method can now take an instance of theStripeContextclass as wellEventNotification(formerly known asThinEvent)'scontextproperty fromstringtoStripeContext