Update StripeClient to optionally take app_info in parameter#1524
Closed
JacekD98 wants to merge 3 commits intostripe:masterfrom
Closed
Update StripeClient to optionally take app_info in parameter#1524JacekD98 wants to merge 3 commits intostripe:masterfrom
JacekD98 wants to merge 3 commits intostripe:masterfrom
Conversation
1ac40c4 to
00b4f86
Compare
This app_info will take precedence over the globally defined Stripe.app_info
8e34396 to
fe90b67
Compare
Author
|
@helenye-stripe could you give this a review please? 🙇 |
Contributor
|
Hi @JacekD98 ! So sorry, we're discussing this change internally and will get back to you soon. |
Member
|
@JacekD98 Thanks for the contributions and sorry again for the delay! Folks from our respective employers have communicated about how to best handle the underlying problem that |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
#1524
Why?
It can be annoying to be dynamically setting the app info based on the execution context for every http request, as you need to take care to reset it to what it was before. Before, you need to do something along the lines of:
and then wrap your requests, in the case of an app info changing dynamically.
What?
Allow a StripeClient initializer to take in an optional app_info param, that will override the global app_info for that instance of the client. This allows you to decide the app info in a certain execution context in a way that is isolated from any other contexts and doesn't have to take care to reset the app info to what it may have been before.
See Also