-
Notifications
You must be signed in to change notification settings - Fork 10
Feat: Switchio registration module #2936
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
Conversation
Coverage reportClick to see where and how coverage changed
This report was generated by python-coverage-comment-action |
c6e45d5
to
0d47234
Compare
assuming you have the correct values for the referenced env variables, this code will successfully connect to the Switchio registration API. this is the code used during research / prototyping.
replace the API-related global variables with function parameters
d87fd1d
to
1c4b36f
Compare
headers=self._get_headers(method="POST", request_path=registration_path, request_body=request_body), | ||
cert=cert, | ||
verify=self.ca_certificate, | ||
timeout=timeout, |
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 have settings.REQUESTS_TIMEOUT
for this purpose.
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.
Ah, I think this is eventually intended to move out into its own package, right? 👍
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.
Right, this is meant to be used by Benefits code which would be responsible for passing in settings.REQUEST_TIMEOUT
.
response.raise_for_status() | ||
|
||
registration_id = response.json()["regId"] | ||
gateway_url = response.json()["gtwUrl"] |
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.
Nit: feels a little strange to parse the response to JSON twice. Maybe not.
have the `request_registration` function return an instance of the class
add function parameter for this value
values are expected to be set in your .env file
this required some small refactors to Client methods.
1c4b36f
to
8720aff
Compare
add type hints to code to help clarify input types.
remove an unnecessary method parameter from Client method. it can use the instance variable directly.
Closing this PR to keep it as documentation of prior research work. Will open a new PR with less granular commits |
Superseded by #2946 |
Closes #2903