-
Notifications
You must be signed in to change notification settings - Fork 47
[storedvalue] Code generation: update services and models #455
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
base: main
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -17,58 +17,47 @@ | |
| """ | ||
| Changes the status of the payment method. | ||
| """ | ||
| endpoint = self.baseUrl + "/changeStatus" | ||
| endpoint = self.baseUrl + f"/changeStatus" | ||
|
Check warning on line 20 in Adyen/services/storedValue/stored_value_api.py
|
||
| method = "POST" | ||
| return self.client.call_adyen_api( | ||
| request, self.service, method, endpoint, idempotency_key, **kwargs | ||
| ) | ||
| return self.client.call_adyen_api(request, self.service, method, endpoint, idempotency_key, **kwargs) | ||
|
|
||
| def check_balance(self, request, idempotency_key=None, **kwargs): | ||
| """ | ||
| Checks the balance. | ||
| """ | ||
| endpoint = self.baseUrl + "/checkBalance" | ||
| endpoint = self.baseUrl + f"/checkBalance" | ||
|
Check warning on line 28 in Adyen/services/storedValue/stored_value_api.py
|
||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. |
||
| method = "POST" | ||
| return self.client.call_adyen_api( | ||
| request, self.service, method, endpoint, idempotency_key, **kwargs | ||
| ) | ||
| return self.client.call_adyen_api(request, self.service, method, endpoint, idempotency_key, **kwargs) | ||
|
|
||
| def issue(self, request, idempotency_key=None, **kwargs): | ||
| """ | ||
| Issues a new card. | ||
| """ | ||
| endpoint = self.baseUrl + "/issue" | ||
| endpoint = self.baseUrl + f"/issue" | ||
|
Check warning on line 36 in Adyen/services/storedValue/stored_value_api.py
|
||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. |
||
| method = "POST" | ||
| return self.client.call_adyen_api( | ||
| request, self.service, method, endpoint, idempotency_key, **kwargs | ||
| ) | ||
| return self.client.call_adyen_api(request, self.service, method, endpoint, idempotency_key, **kwargs) | ||
|
|
||
| def load(self, request, idempotency_key=None, **kwargs): | ||
| """ | ||
| Loads the payment method. | ||
| """ | ||
| endpoint = self.baseUrl + "/load" | ||
| endpoint = self.baseUrl + f"/load" | ||
|
Check warning on line 44 in Adyen/services/storedValue/stored_value_api.py
|
||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. |
||
| method = "POST" | ||
| return self.client.call_adyen_api( | ||
| request, self.service, method, endpoint, idempotency_key, **kwargs | ||
| ) | ||
| return self.client.call_adyen_api(request, self.service, method, endpoint, idempotency_key, **kwargs) | ||
|
|
||
| def merge_balance(self, request, idempotency_key=None, **kwargs): | ||
| """ | ||
| Merge the balance of two cards. | ||
| """ | ||
| endpoint = self.baseUrl + "/mergeBalance" | ||
| endpoint = self.baseUrl + f"/mergeBalance" | ||
|
Check warning on line 52 in Adyen/services/storedValue/stored_value_api.py
|
||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. |
||
| method = "POST" | ||
| return self.client.call_adyen_api( | ||
| request, self.service, method, endpoint, idempotency_key, **kwargs | ||
| ) | ||
| return self.client.call_adyen_api(request, self.service, method, endpoint, idempotency_key, **kwargs) | ||
|
|
||
| def void_transaction(self, request, idempotency_key=None, **kwargs): | ||
| """ | ||
| Voids a transaction. | ||
| """ | ||
| endpoint = self.baseUrl + "/voidTransaction" | ||
| endpoint = self.baseUrl + f"/voidTransaction" | ||
|
Check warning on line 60 in Adyen/services/storedValue/stored_value_api.py
|
||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. |
||
| method = "POST" | ||
| return self.client.call_adyen_api( | ||
| request, self.service, method, endpoint, idempotency_key, **kwargs | ||
| ) | ||
| return self.client.call_adyen_api(request, self.service, method, endpoint, idempotency_key, **kwargs) | ||
|
|
||
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.
While using an f-string is a good idea for constructing URLs,
f"/changeStatus"is being used unnecessarily as it doesn't interpolate any variables. A more idiomatic and readable way to construct the endpoint URL would be to use an f-string for the entire expression. This would also align with the style seen in the test files (e.g.,f"{self.stored_value_url}/issue").