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
13 changes: 5 additions & 8 deletions Adyen/services/binlookup/bin_lookup_api.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,18 +17,15 @@
"""
Check if 3D Secure is available
"""
endpoint = self.baseUrl + "/get3dsAvailability"
endpoint = self.baseUrl + f"/get3dsAvailability"

Check warning on line 20 in Adyen/services/binlookup/bin_lookup_api.py

View check run for this annotation

SonarQubeCloud / SonarCloud Code Analysis

Add replacement fields or use a normal string instead of an f-string.

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

Choose a reason for hiding this comment

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

medium

The use of an f-string on a static string f"/get3dsAvailability" is unnecessary as it provides no formatting. For improved readability and to make the string formatting intention clear, it's better to format the entire URL endpoint using an f-string.

Suggested change
endpoint = self.baseUrl + f"/get3dsAvailability"
endpoint = f"{self.baseUrl}/get3dsAvailability"

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 over 120 characters long, which makes it difficult to read and violates common Python style guides (like PEP 8). The previous multi-line version was more readable. It's recommended to break up long lines.

Suggested change
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_cost_estimate(self, request, idempotency_key=None, **kwargs):
"""
Get a fees cost estimate
"""
endpoint = self.baseUrl + "/getCostEstimate"
endpoint = self.baseUrl + f"/getCostEstimate"

Check warning on line 28 in Adyen/services/binlookup/bin_lookup_api.py

View check run for this annotation

SonarQubeCloud / SonarCloud Code Analysis

Add replacement fields or use a normal string instead of an f-string.

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

Choose a reason for hiding this comment

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

medium

The use of an f-string on a static string f"/getCostEstimate" is unnecessary as it provides no formatting. For improved readability and to make the string formatting intention clear, it's better to format the entire URL endpoint using an f-string.

Suggested change
endpoint = self.baseUrl + f"/getCostEstimate"
endpoint = f"{self.baseUrl}/getCostEstimate"

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 over 120 characters long, which makes it difficult to read and violates common Python style guides (like PEP 8). The previous multi-line version was more readable. It's recommended to break up long lines.

Suggested change
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
)


Loading