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
17 changes: 6 additions & 11 deletions Adyen/services/transfers/capital_api.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,11 +20,9 @@
Deprecated since Transfers API v4
Use the `/grants` endpoint from the [Capital API](https://docs.adyen.com/api-explorer/capital/latest/get/grants) instead.
"""
endpoint = self.baseUrl + "/grants"
endpoint = self.baseUrl + f"/grants"

Check warning on line 23 in Adyen/services/transfers/capital_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=AZ0K01Pp63pryTICbP5_&open=AZ0K01Pp63pryTICbP5_&pullRequest=461
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 "/grants" is unnecessary. It's more idiomatic and readable to construct the full URL with a single f-string.

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

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)

def get_grant_reference_details(self, id, idempotency_key=None, **kwargs):
"""
Expand All @@ -35,9 +33,7 @@
"""
endpoint = self.baseUrl + f"/grants/{id}"
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)

def request_grant_payout(self, request, idempotency_key=None, **kwargs):
"""
Expand All @@ -46,8 +42,7 @@
Deprecated since Transfers API v4
Use the `/grants` endpoint from the [Capital API](https://docs.adyen.com/api-explorer/capital/latest/post/grants) instead.
"""
endpoint = self.baseUrl + "/grants"
endpoint = self.baseUrl + f"/grants"

Check warning on line 45 in Adyen/services/transfers/capital_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=AZ0K01Pp63pryTICbP6A&open=AZ0K01Pp63pryTICbP6A&pullRequest=461
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 "/grants" is unnecessary. It's more idiomatic and readable to construct the full URL with a single f-string.

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

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)

11 changes: 4 additions & 7 deletions Adyen/services/transfers/transactions_api.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,18 +17,15 @@
"""
Get all transactions
"""
endpoint = self.baseUrl + "/transactions"
endpoint = self.baseUrl + f"/transactions"

Check warning on line 20 in Adyen/services/transfers/transactions_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=AZ0K01QD63pryTICbP6B&open=AZ0K01QD63pryTICbP6B&pullRequest=461
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 "/transactions" is unnecessary. It's more idiomatic and readable to construct the full URL with a single f-string.

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

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)

def get_transaction(self, id, idempotency_key=None, **kwargs):
"""
Get a transaction
"""
endpoint = self.baseUrl + f"/transactions/{id}"
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)

33 changes: 11 additions & 22 deletions Adyen/services/transfers/transfers_api.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,58 +17,47 @@
"""
Approve initiated transfers
"""
endpoint = self.baseUrl + "/transfers/approve"
endpoint = self.baseUrl + f"/transfers/approve"

Check warning on line 20 in Adyen/services/transfers/transfers_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=AZ0K01O163pryTICbP57&open=AZ0K01O163pryTICbP57&pullRequest=461
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 "/transfers/approve" is unnecessary. It's more idiomatic and readable to construct the full URL with a single f-string.

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

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

Check warning on line 28 in Adyen/services/transfers/transfers_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=AZ0K01O163pryTICbP58&open=AZ0K01O163pryTICbP58&pullRequest=461
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 "/transfers/cancel" is unnecessary. It's more idiomatic and readable to construct the full URL with a single f-string.

Suggested change
endpoint = self.baseUrl + f"/transfers/cancel"
endpoint = f"{self.baseUrl}/transfers/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 get_all_transfers(self, idempotency_key=None, **kwargs):
"""
Get all transfers
"""
endpoint = self.baseUrl + "/transfers"
endpoint = self.baseUrl + f"/transfers"

Check warning on line 36 in Adyen/services/transfers/transfers_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=AZ0K01O163pryTICbP59&open=AZ0K01O163pryTICbP59&pullRequest=461
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 "/transfers" is unnecessary. It's more idiomatic and readable to construct the full URL with a single f-string.

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

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)

def get_transfer(self, id, idempotency_key=None, **kwargs):
"""
Get a transfer
"""
endpoint = self.baseUrl + f"/transfers/{id}"
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)

def return_transfer(self, request, transferId, idempotency_key=None, **kwargs):
"""
Return a transfer
"""
endpoint = self.baseUrl + f"/transfers/{transferId}/returns"
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 transfer_funds(self, request, idempotency_key=None, **kwargs):
"""
Transfer funds
"""
endpoint = self.baseUrl + "/transfers"
endpoint = self.baseUrl + f"/transfers"

Check warning on line 60 in Adyen/services/transfers/transfers_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=AZ0K01O163pryTICbP5-&open=AZ0K01O163pryTICbP5-&pullRequest=461
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 "/transfers" is unnecessary. It's more idiomatic and readable to construct the full URL with a single f-string.

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

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