-
Notifications
You must be signed in to change notification settings - Fork 47
[paymentsapp] Code generation: update services and models #450
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 | ||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|
|
|
@@ -13,59 +13,43 @@ | |||||||||||
| self.service = "paymentsApp" | ||||||||||||
| self.baseUrl = "https://management-live.adyen.com/v1" | ||||||||||||
|
|
||||||||||||
| def generate_payments_app_boarding_token_for_merchant( | ||||||||||||
| self, request, merchantId, idempotency_key=None, **kwargs | ||||||||||||
| ): | ||||||||||||
| def generate_payments_app_boarding_token_for_merchant(self, request, merchantId, idempotency_key=None, **kwargs): | ||||||||||||
|
Check warning on line 16 in Adyen/services/paymentsApp/payments_app_api.py
|
||||||||||||
| """ | ||||||||||||
| Create a boarding token - merchant level | ||||||||||||
| """ | ||||||||||||
| endpoint = self.baseUrl + f"/merchants/{merchantId}/generatePaymentsAppBoardingToken" | ||||||||||||
| 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) | ||||||||||||
|
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. This line is 110 characters long, exceeding standard Python line length limits and making it harder to read. Please wrap the arguments onto new lines for better readability. return self.client.call_adyen_api(
request, self.service, method, endpoint, idempotency_key, **kwargs
)References
|
||||||||||||
|
|
||||||||||||
| def generate_payments_app_boarding_token_for_store( | ||||||||||||
| self, request, merchantId, storeId, idempotency_key=None, **kwargs | ||||||||||||
| ): | ||||||||||||
| def generate_payments_app_boarding_token_for_store(self, request, merchantId, storeId, idempotency_key=None, **kwargs): | ||||||||||||
|
Check warning on line 24 in Adyen/services/paymentsApp/payments_app_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. At 120 characters, this function signature is excessively long and violates standard Python style guides for line length. The previous multi-line definition was much more readable.
Suggested change
References
|
||||||||||||
| """ | ||||||||||||
| Create a boarding token - store level | ||||||||||||
| """ | ||||||||||||
| endpoint = ( | ||||||||||||
| self.baseUrl | ||||||||||||
| + f"/merchants/{merchantId}/stores/{storeId}/generatePaymentsAppBoardingToken" | ||||||||||||
| ) | ||||||||||||
| endpoint = self.baseUrl + f"/merchants/{merchantId}/stores/{storeId}/generatePaymentsAppBoardingToken" | ||||||||||||
|
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. This line is 109 characters long, which is difficult to read. The previous approach of breaking the string concatenation across multiple lines was better for maintainability.
Suggested change
References
|
||||||||||||
| 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) | ||||||||||||
|
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. This line is 110 characters long, exceeding standard Python line length limits. Please wrap the arguments for better readability. return self.client.call_adyen_api(
request, self.service, method, endpoint, idempotency_key, **kwargs
)References
|
||||||||||||
|
|
||||||||||||
| def list_payments_app_for_merchant(self, merchantId, idempotency_key=None, **kwargs): | ||||||||||||
| """ | ||||||||||||
| Get a list of Payments Apps - merchant level | ||||||||||||
| """ | ||||||||||||
| endpoint = self.baseUrl + f"/merchants/{merchantId}/paymentsApps" | ||||||||||||
| 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) | ||||||||||||
|
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. This line is 99 characters long, exceeding common Python line length limits (e.g., 88 for return self.client.call_adyen_api(
None, self.service, method, endpoint, idempotency_key, **kwargs
)References
|
||||||||||||
|
|
||||||||||||
| def list_payments_app_for_store(self, merchantId, storeId, idempotency_key=None, **kwargs): | ||||||||||||
| """ | ||||||||||||
| Get a list of Payments Apps - store level | ||||||||||||
| """ | ||||||||||||
| endpoint = self.baseUrl + f"/merchants/{merchantId}/stores/{storeId}/paymentsApps" | ||||||||||||
| 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) | ||||||||||||
|
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. This line is 99 characters long, exceeding common Python line length limits (e.g., 88 for return self.client.call_adyen_api(
None, self.service, method, endpoint, idempotency_key, **kwargs
)References
|
||||||||||||
|
|
||||||||||||
| def revoke_payments_app(self, merchantId, installationId, idempotency_key=None, **kwargs): | ||||||||||||
| """ | ||||||||||||
| Revoke Payments App instance authentication | ||||||||||||
| """ | ||||||||||||
| endpoint = self.baseUrl + f"/merchants/{merchantId}/paymentsApps/{installationId}/revoke" | ||||||||||||
| method = "POST" | ||||||||||||
| 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) | ||||||||||||
|
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. This line is 99 characters long, exceeding common Python line length limits (e.g., 88 for return self.client.call_adyen_api(
None, self.service, method, endpoint, idempotency_key, **kwargs
)References
|
||||||||||||
|
|
||||||||||||
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.
This function signature is over 115 characters long, which significantly exceeds standard Python line length limits. This harms readability. The previous multi-line format was preferable. It is recommended to configure the code generator to adhere to a standard line length.
References
blackdefault to 88 characters, this line is significantly longer, which hurts readability. (link)