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
51 changes: 18 additions & 33 deletions Adyen/services/payments/modifications_api.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,80 +17,65 @@
"""
Change the authorised amount
"""
endpoint = self.baseUrl + "/adjustAuthorisation"
endpoint = self.baseUrl + f"/adjustAuthorisation"

Check warning on line 20 in Adyen/services/payments/modifications_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=AZ0K0yta63pryTICbPl0&open=AZ0K0yta63pryTICbPl0&pullRequest=453
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 string literal without any embedded expressions is unnecessary. For cleaner and more idiomatic code, the entire URL should be constructed within a single f-string.

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

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(self, request, idempotency_key=None, **kwargs):
"""
Cancel an authorisation
"""
endpoint = self.baseUrl + "/cancel"
endpoint = self.baseUrl + f"/cancel"

Check warning on line 28 in Adyen/services/payments/modifications_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=AZ0K0yta63pryTICbPl1&open=AZ0K0yta63pryTICbPl1&pullRequest=453
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 string literal without any embedded expressions is unnecessary. For cleaner and more idiomatic code, the entire URL should be constructed within a single f-string.

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

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_or_refund(self, request, idempotency_key=None, **kwargs):
"""
Cancel or refund a payment
"""
endpoint = self.baseUrl + "/cancelOrRefund"
endpoint = self.baseUrl + f"/cancelOrRefund"

Check warning on line 36 in Adyen/services/payments/modifications_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=AZ0K0yta63pryTICbPl2&open=AZ0K0yta63pryTICbPl2&pullRequest=453
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 string literal without any embedded expressions is unnecessary. For cleaner and more idiomatic code, the entire URL should be constructed within a single f-string.

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

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 capture(self, request, idempotency_key=None, **kwargs):
"""
Capture an authorisation
"""
endpoint = self.baseUrl + "/capture"
endpoint = self.baseUrl + f"/capture"

Check warning on line 44 in Adyen/services/payments/modifications_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=AZ0K0yta63pryTICbPl3&open=AZ0K0yta63pryTICbPl3&pullRequest=453
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 string literal without any embedded expressions is unnecessary. For cleaner and more idiomatic code, the entire URL should be constructed within a single f-string.

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

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 donate(self, request, idempotency_key=None, **kwargs):
"""
Create a donation

Deprecated
Deprecated
"""
endpoint = self.baseUrl + "/donate"
endpoint = self.baseUrl + f"/donate"

Check warning on line 54 in Adyen/services/payments/modifications_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=AZ0K0yta63pryTICbPl4&open=AZ0K0yta63pryTICbPl4&pullRequest=453
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 string literal without any embedded expressions is unnecessary. For cleaner and more idiomatic code, the entire URL should be constructed within a single f-string.

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

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 refund(self, request, idempotency_key=None, **kwargs):
"""
Refund a captured payment
"""
endpoint = self.baseUrl + "/refund"
endpoint = self.baseUrl + f"/refund"

Check warning on line 62 in Adyen/services/payments/modifications_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=AZ0K0yta63pryTICbPl5&open=AZ0K0yta63pryTICbPl5&pullRequest=453
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 string literal without any embedded expressions is unnecessary. For cleaner and more idiomatic code, the entire URL should be constructed within a single f-string.

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

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 technical_cancel(self, request, idempotency_key=None, **kwargs):
"""
Cancel an authorisation using your reference
"""
endpoint = self.baseUrl + "/technicalCancel"
endpoint = self.baseUrl + f"/technicalCancel"

Check warning on line 70 in Adyen/services/payments/modifications_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=AZ0K0yta63pryTICbPl6&open=AZ0K0yta63pryTICbPl6&pullRequest=453
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 string literal without any embedded expressions is unnecessary. For cleaner and more idiomatic code, the entire URL should be constructed within a single f-string.

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

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 void_pending_refund(self, request, idempotency_key=None, **kwargs):
"""
Cancel an in-person refund
"""
endpoint = self.baseUrl + "/voidPendingRefund"
endpoint = self.baseUrl + f"/voidPendingRefund"

Check warning on line 78 in Adyen/services/payments/modifications_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=AZ0K0yta63pryTICbPl7&open=AZ0K0yta63pryTICbPl7&pullRequest=453
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 string literal without any embedded expressions is unnecessary. For cleaner and more idiomatic code, the entire URL should be constructed within a single f-string.

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

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)

31 changes: 11 additions & 20 deletions Adyen/services/payments/payments_api.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,48 +17,39 @@
"""
Create an authorisation
"""
endpoint = self.baseUrl + "/authorise"
endpoint = self.baseUrl + f"/authorise"

Check warning on line 20 in Adyen/services/payments/payments_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=AZ0K0ysm63pryTICbPlv&open=AZ0K0ysm63pryTICbPlv&pullRequest=453
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 string literal without any embedded expressions is unnecessary. For cleaner and more idiomatic code, the entire URL should be constructed within a single f-string.

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

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 authorise3d(self, request, idempotency_key=None, **kwargs):
"""
Complete a 3DS authorisation
"""
endpoint = self.baseUrl + "/authorise3d"
endpoint = self.baseUrl + f"/authorise3d"

Check warning on line 28 in Adyen/services/payments/payments_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=AZ0K0ysm63pryTICbPlw&open=AZ0K0ysm63pryTICbPlw&pullRequest=453
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 string literal without any embedded expressions is unnecessary. For cleaner and more idiomatic code, the entire URL should be constructed within a single f-string.

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

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 authorise3ds2(self, request, idempotency_key=None, **kwargs):
"""
Complete a 3DS2 authorisation
"""
endpoint = self.baseUrl + "/authorise3ds2"
endpoint = self.baseUrl + f"/authorise3ds2"

Check warning on line 36 in Adyen/services/payments/payments_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=AZ0K0ysm63pryTICbPlx&open=AZ0K0ysm63pryTICbPlx&pullRequest=453
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 string literal without any embedded expressions is unnecessary. For cleaner and more idiomatic code, the entire URL should be constructed within a single f-string.

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

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_authentication_result(self, request, idempotency_key=None, **kwargs):
"""
Get the 3DS authentication result
"""
endpoint = self.baseUrl + "/getAuthenticationResult"
endpoint = self.baseUrl + f"/getAuthenticationResult"

Check warning on line 44 in Adyen/services/payments/payments_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=AZ0K0ysm63pryTICbPly&open=AZ0K0ysm63pryTICbPly&pullRequest=453
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 string literal without any embedded expressions is unnecessary. For cleaner and more idiomatic code, the entire URL should be constructed within a single f-string.

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

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 retrieve3ds2_result(self, request, idempotency_key=None, **kwargs):
"""
Get the 3DS2 authentication result
"""
endpoint = self.baseUrl + "/retrieve3ds2Result"
endpoint = self.baseUrl + f"/retrieve3ds2Result"

Check warning on line 52 in Adyen/services/payments/payments_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=AZ0K0ysm63pryTICbPlz&open=AZ0K0ysm63pryTICbPlz&pullRequest=453
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 string literal without any embedded expressions is unnecessary. For cleaner and more idiomatic code, the entire URL should be constructed within a single f-string.

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

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