-
Notifications
You must be signed in to change notification settings - Fork 47
[transfers] Code generation: update services and models #461
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 |
|---|---|---|
|
|
@@ -20,11 +20,9 @@ | |
| Deprecated since Transfers API v4 | ||
| Use the `/grants` endpoint from the [Capital API](https://docs.adyen.com/api-explorer/capital/latest/get/grants) instead. | ||
| """ | ||
| endpoint = self.baseUrl + "/grants" | ||
| endpoint = self.baseUrl + f"/grants" | ||
|
Check warning on line 23 in Adyen/services/transfers/capital_api.py
|
||
| method = "GET" | ||
| return self.client.call_adyen_api( | ||
| None, self.service, method, endpoint, idempotency_key, **kwargs | ||
| ) | ||
| return self.client.call_adyen_api(None, self.service, method, endpoint, idempotency_key, **kwargs) | ||
|
|
||
| def get_grant_reference_details(self, id, idempotency_key=None, **kwargs): | ||
| """ | ||
|
|
@@ -35,9 +33,7 @@ | |
| """ | ||
| endpoint = self.baseUrl + f"/grants/{id}" | ||
| method = "GET" | ||
| return self.client.call_adyen_api( | ||
| None, self.service, method, endpoint, idempotency_key, **kwargs | ||
| ) | ||
| return self.client.call_adyen_api(None, self.service, method, endpoint, idempotency_key, **kwargs) | ||
|
|
||
| def request_grant_payout(self, request, idempotency_key=None, **kwargs): | ||
| """ | ||
|
|
@@ -46,8 +42,7 @@ | |
| Deprecated since Transfers API v4 | ||
| Use the `/grants` endpoint from the [Capital API](https://docs.adyen.com/api-explorer/capital/latest/post/grants) instead. | ||
| """ | ||
| endpoint = self.baseUrl + "/grants" | ||
| endpoint = self.baseUrl + f"/grants" | ||
|
Check warning on line 45 in Adyen/services/transfers/capital_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) | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -17,18 +17,15 @@ | |
| """ | ||
| Get all transactions | ||
| """ | ||
| endpoint = self.baseUrl + "/transactions" | ||
| endpoint = self.baseUrl + f"/transactions" | ||
|
Check warning on line 20 in Adyen/services/transfers/transactions_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 = "GET" | ||
| return self.client.call_adyen_api( | ||
| None, self.service, method, endpoint, idempotency_key, **kwargs | ||
| ) | ||
| return self.client.call_adyen_api(None, self.service, method, endpoint, idempotency_key, **kwargs) | ||
|
|
||
| def get_transaction(self, id, idempotency_key=None, **kwargs): | ||
| """ | ||
| Get a transaction | ||
| """ | ||
| endpoint = self.baseUrl + f"/transactions/{id}" | ||
| method = "GET" | ||
| return self.client.call_adyen_api( | ||
| None, self.service, method, endpoint, idempotency_key, **kwargs | ||
| ) | ||
| return self.client.call_adyen_api(None, self.service, method, endpoint, idempotency_key, **kwargs) | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -17,58 +17,47 @@ | |
| """ | ||
| Approve initiated transfers | ||
| """ | ||
| endpoint = self.baseUrl + "/transfers/approve" | ||
| endpoint = self.baseUrl + f"/transfers/approve" | ||
|
Check warning on line 20 in Adyen/services/transfers/transfers_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 cancel_initiated_transfers(self, request, idempotency_key=None, **kwargs): | ||
| """ | ||
| Cancel initiated transfers | ||
| """ | ||
| endpoint = self.baseUrl + "/transfers/cancel" | ||
| endpoint = self.baseUrl + f"/transfers/cancel" | ||
|
Check warning on line 28 in Adyen/services/transfers/transfers_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 get_all_transfers(self, idempotency_key=None, **kwargs): | ||
| """ | ||
| Get all transfers | ||
| """ | ||
| endpoint = self.baseUrl + "/transfers" | ||
| endpoint = self.baseUrl + f"/transfers" | ||
|
Check warning on line 36 in Adyen/services/transfers/transfers_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 = "GET" | ||
| return self.client.call_adyen_api( | ||
| None, self.service, method, endpoint, idempotency_key, **kwargs | ||
| ) | ||
| return self.client.call_adyen_api(None, self.service, method, endpoint, idempotency_key, **kwargs) | ||
|
|
||
| def get_transfer(self, id, idempotency_key=None, **kwargs): | ||
| """ | ||
| Get a transfer | ||
| """ | ||
| endpoint = self.baseUrl + f"/transfers/{id}" | ||
| method = "GET" | ||
| return self.client.call_adyen_api( | ||
| None, self.service, method, endpoint, idempotency_key, **kwargs | ||
| ) | ||
| return self.client.call_adyen_api(None, self.service, method, endpoint, idempotency_key, **kwargs) | ||
|
|
||
| def return_transfer(self, request, transferId, idempotency_key=None, **kwargs): | ||
| """ | ||
| Return a transfer | ||
| """ | ||
| endpoint = self.baseUrl + f"/transfers/{transferId}/returns" | ||
| 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 transfer_funds(self, request, idempotency_key=None, **kwargs): | ||
| """ | ||
| Transfer funds | ||
| """ | ||
| endpoint = self.baseUrl + "/transfers" | ||
| endpoint = self.baseUrl + f"/transfers" | ||
|
Check warning on line 60 in Adyen/services/transfers/transfers_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.
The use of an f-string for a static string
"/grants"is unnecessary. It's more idiomatic and readable to construct the full URL with a single f-string.