Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
34 changes: 9 additions & 25 deletions Adyen/services/paymentsApp/payments_app_api.py
Original file line number Diff line number Diff line change
Expand Up @@ -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

View check run for this annotation

SonarQubeCloud / SonarCloud Code Analysis

Rename this parameter "merchantId" to match the regular expression ^[_a-z][a-z0-9_]*$.

See more on https://sonarcloud.io/project/issues?id=Adyen_adyen-python-api-library&issues=AZ0K0uv4WfhKdAtO6XWb&open=AZ0K0uv4WfhKdAtO6XWb&pullRequest=450
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

medium

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.

    def generate_payments_app_boarding_token_for_merchant(
        self, request, merchantId, idempotency_key=None, **kwargs
    ):
References
  1. PEP 8, the style guide for Python code, recommends limiting all lines to a maximum of 79 characters. While some tools like black default to 88 characters, this line is significantly longer, which hurts readability. (link)

"""
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)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

medium

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
  1. PEP 8, the style guide for Python code, recommends limiting all lines to a maximum of 79 characters. While some tools like black default to 88 characters, this line is significantly longer, which hurts readability. (link)


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

View check run for this annotation

SonarQubeCloud / SonarCloud Code Analysis

Rename this parameter "merchantId" to match the regular expression ^[_a-z][a-z0-9_]*$.

See more on https://sonarcloud.io/project/issues?id=Adyen_adyen-python-api-library&issues=AZ0K0uv4WfhKdAtO6XWc&open=AZ0K0uv4WfhKdAtO6XWc&pullRequest=450

Check warning on line 24 in Adyen/services/paymentsApp/payments_app_api.py

View check run for this annotation

SonarQubeCloud / SonarCloud Code Analysis

Rename this parameter "storeId" to match the regular expression ^[_a-z][a-z0-9_]*$.

See more on https://sonarcloud.io/project/issues?id=Adyen_adyen-python-api-library&issues=AZ0K0uv4WfhKdAtO6XWd&open=AZ0K0uv4WfhKdAtO6XWd&pullRequest=450
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

medium

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
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
):
References
  1. PEP 8, the style guide for Python code, recommends limiting all lines to a maximum of 79 characters. While some tools like black default to 88 characters, this line is significantly longer, which hurts readability. (link)

"""
Create a boarding token - store level
"""
endpoint = (
self.baseUrl
+ f"/merchants/{merchantId}/stores/{storeId}/generatePaymentsAppBoardingToken"
)
endpoint = self.baseUrl + f"/merchants/{merchantId}/stores/{storeId}/generatePaymentsAppBoardingToken"
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

medium

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
endpoint = self.baseUrl + f"/merchants/{merchantId}/stores/{storeId}/generatePaymentsAppBoardingToken"
endpoint = (
self.baseUrl
+ f"/merchants/{merchantId}/stores/{storeId}/generatePaymentsAppBoardingToken"
)
References
  1. PEP 8, the style guide for Python code, recommends limiting all lines to a maximum of 79 characters. While some tools like black default to 88 characters, this line is significantly longer, which hurts readability. (link)

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)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

medium

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
  1. PEP 8, the style guide for Python code, recommends limiting all lines to a maximum of 79 characters. While some tools like black default to 88 characters, this line is significantly longer, which hurts readability. (link)


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)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

medium

This line is 99 characters long, exceeding common Python line length limits (e.g., 88 for black or 79 for PEP 8). For improved readability, please wrap the arguments to new lines.

        return self.client.call_adyen_api(
            None, self.service, method, endpoint, idempotency_key, **kwargs
        )
References
  1. PEP 8, the style guide for Python code, recommends limiting all lines to a maximum of 79 characters. While some tools like black default to 88 characters, this line is still longer and would be more readable if wrapped. (link)


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)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

medium

This line is 99 characters long, exceeding common Python line length limits (e.g., 88 for black or 79 for PEP 8). For improved readability, please wrap the arguments to new lines.

        return self.client.call_adyen_api(
            None, self.service, method, endpoint, idempotency_key, **kwargs
        )
References
  1. PEP 8, the style guide for Python code, recommends limiting all lines to a maximum of 79 characters. While some tools like black default to 88 characters, this line is still longer and would be more readable if wrapped. (link)


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)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

medium

This line is 99 characters long, exceeding common Python line length limits (e.g., 88 for black or 79 for PEP 8). For improved readability, please wrap the arguments to new lines.

        return self.client.call_adyen_api(
            None, self.service, method, endpoint, idempotency_key, **kwargs
        )
References
  1. PEP 8, the style guide for Python code, recommends limiting all lines to a maximum of 79 characters. While some tools like black default to 88 characters, this line is still longer and would be more readable if wrapped. (link)


Loading