-
Notifications
You must be signed in to change notification settings - Fork 421
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
Moved raw_request functions from stripe module to StripeClient class #1390
base: beta
Are you sure you want to change the base?
Conversation
…nit__.py to StripeClient in _stripe_client.py updated tests and README
…lize method in lieu of values passed into client constructor
…nt-only' into jar/rawrequest-client-only
stripe/_stripe_client.py
Outdated
|
||
from stripe._raw_request import raw_request as _raw_request # noqa | ||
from stripe._raw_request import raw_request_async as _raw_request_async # noqa | ||
from stripe._raw_request import deserialize as _deserialize # noqa |
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.
The above 3 methods use the global api requestor. I believe one of the key differentiators of the StripeClient model is that there is a dedicated api requestor per StripeClient that gets used instead of the global one - that is how we get to set different api-key/account per StripeClient.
Therefore, I think we need a bigger refactor.
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.
I think this is done. I removed _raw_request.py and merged those methods directly into StripeClient so I could use its _requestor member, and updated the tests to match.
… to use its _requestor updated test_raw_request to use stripe_client fixture updated test_integration to use MOCK_API_KEY when creating StripeClient objects comments
…Y to match other tests
Context:
We are changing our SDKs to move "raw request" functions into the
StripeClient
class.