Skip to content
Open
Show file tree
Hide file tree
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
19 changes: 7 additions & 12 deletions Adyen/services/payouts/initialization_api.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,28 +17,23 @@
"""
Store payout details
"""
endpoint = self.baseUrl + "/storeDetail"
endpoint = self.baseUrl + f"/storeDetail"

Check warning on line 20 in Adyen/services/payouts/initialization_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=AZ0K0yF763pryTICbPgy&open=AZ0K0yF763pryTICbPgy&pullRequest=448
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 for a static string /storeDetail is unnecessary, and concatenating it with self.baseUrl is not ideal. For better readability and to follow Python best practices, you can use a single f-string to construct the entire endpoint URL.

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

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 store_detail_and_submit_third_party(self, request, idempotency_key=None, **kwargs):
"""
Store details and submit a payout
"""
endpoint = self.baseUrl + "/storeDetailAndSubmitThirdParty"
endpoint = self.baseUrl + f"/storeDetailAndSubmitThirdParty"

Check warning on line 28 in Adyen/services/payouts/initialization_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=AZ0K0yF763pryTICbPgz&open=AZ0K0yF763pryTICbPgz&pullRequest=448
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 for a static string /storeDetailAndSubmitThirdParty is unnecessary, and concatenating it with self.baseUrl is not ideal. For better readability and to follow Python best practices, you can use a single f-string to construct the entire endpoint URL.

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

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 submit_third_party(self, request, idempotency_key=None, **kwargs):
"""
Submit a payout
"""
endpoint = self.baseUrl + "/submitThirdParty"
endpoint = self.baseUrl + f"/submitThirdParty"

Check warning on line 36 in Adyen/services/payouts/initialization_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=AZ0K0yF763pryTICbPg0&open=AZ0K0yF763pryTICbPg0&pullRequest=448
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 for a static string /submitThirdParty is unnecessary, and concatenating it with self.baseUrl is not ideal. For better readability and to follow Python best practices, you can use a single f-string to construct the entire endpoint URL.

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

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)

7 changes: 3 additions & 4 deletions Adyen/services/payouts/instant_payouts_api.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,7 @@
"""
Make an instant card payout
"""
endpoint = self.baseUrl + "/payout"
endpoint = self.baseUrl + f"/payout"

Check warning on line 20 in Adyen/services/payouts/instant_payouts_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=AZ0K0yFM63pryTICbPgx&open=AZ0K0yFM63pryTICbPgx&pullRequest=448
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 for a static string /payout is unnecessary, and concatenating it with self.baseUrl is not ideal. For better readability and to follow Python best practices, you can use a single f-string to construct the entire endpoint URL.

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

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)

13 changes: 5 additions & 8 deletions Adyen/services/payouts/reviewing_api.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,18 +17,15 @@
"""
Confirm a payout
"""
endpoint = self.baseUrl + "/confirmThirdParty"
endpoint = self.baseUrl + f"/confirmThirdParty"

Check warning on line 20 in Adyen/services/payouts/reviewing_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=AZ0K0yGV63pryTICbPg1&open=AZ0K0yGV63pryTICbPg1&pullRequest=448
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 for a static string /confirmThirdParty is unnecessary, and concatenating it with self.baseUrl is not ideal. For better readability and to follow Python best practices, you can use a single f-string to construct the entire endpoint URL.

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

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 decline_third_party(self, request, idempotency_key=None, **kwargs):
"""
Cancel a payout
"""
endpoint = self.baseUrl + "/declineThirdParty"
endpoint = self.baseUrl + f"/declineThirdParty"

Check warning on line 28 in Adyen/services/payouts/reviewing_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=AZ0K0yGV63pryTICbPg2&open=AZ0K0yGV63pryTICbPg2&pullRequest=448
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 for a static string /declineThirdParty is unnecessary, and concatenating it with self.baseUrl is not ideal. For better readability and to follow Python best practices, you can use a single f-string to construct the entire endpoint URL.

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

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)

Loading