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: 6 additions & 13 deletions Adyen/services/legalEntityManagement/business_lines_api.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,38 +17,31 @@
"""
Create a business line
"""
endpoint = self.baseUrl + "/businessLines"
endpoint = self.baseUrl + f"/businessLines"

Check warning on line 20 in Adyen/services/legalEntityManagement/business_lines_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=AZ0K04hn63pryTICbQTi&open=AZ0K04hn63pryTICbQTi&pullRequest=456
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 f-string f"/businessLines" is unnecessary as it doesn't contain any expressions. A more idiomatic way to construct the URL would be to use a single f-string for the entire expression.

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

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 delete_business_line(self, id, idempotency_key=None, **kwargs):
"""
Delete a business line
"""
endpoint = self.baseUrl + f"/businessLines/{id}"
method = "DELETE"
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_business_line(self, id, idempotency_key=None, **kwargs):
"""
Get a business line
"""
endpoint = self.baseUrl + f"/businessLines/{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 update_business_line(self, request, id, idempotency_key=None, **kwargs):
"""
Update a business line
"""
endpoint = self.baseUrl + f"/businessLines/{id}"
method = "PATCH"
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)

19 changes: 6 additions & 13 deletions Adyen/services/legalEntityManagement/documents_api.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,36 +19,29 @@
"""
endpoint = self.baseUrl + f"/documents/{id}"
method = "DELETE"
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_document(self, id, idempotency_key=None, **kwargs):
"""
Get a document
"""
endpoint = self.baseUrl + f"/documents/{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 update_document(self, request, id, idempotency_key=None, **kwargs):
"""
Update a document
"""
endpoint = self.baseUrl + f"/documents/{id}"
method = "PATCH"
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 upload_document_for_verification_checks(self, request, idempotency_key=None, **kwargs):
"""
Upload a document for verification checks
"""
endpoint = self.baseUrl + "/documents"
endpoint = self.baseUrl + f"/documents"

Check warning on line 44 in Adyen/services/legalEntityManagement/documents_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=AZ0K04iX63pryTICbQTk&open=AZ0K04iX63pryTICbQTk&pullRequest=456
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 f-string f"/documents" is unnecessary as it doesn't contain any expressions. A more idiomatic way to construct the URL would be to use a single f-string for the entire expression.

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

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)

15 changes: 5 additions & 10 deletions Adyen/services/legalEntityManagement/hosted_onboarding_api.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,26 +19,21 @@
"""
endpoint = self.baseUrl + f"/legalEntities/{id}/onboardingLinks"
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_onboarding_link_theme(self, id, idempotency_key=None, **kwargs):
"""
Get an onboarding link theme
"""
endpoint = self.baseUrl + f"/themes/{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 list_hosted_onboarding_page_themes(self, idempotency_key=None, **kwargs):
"""
Get a list of hosted onboarding page themes
"""
endpoint = self.baseUrl + "/themes"
endpoint = self.baseUrl + f"/themes"

Check warning on line 36 in Adyen/services/legalEntityManagement/hosted_onboarding_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=AZ0K04hP63pryTICbQTh&open=AZ0K04hP63pryTICbQTh&pullRequest=456
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 f-string f"/themes" is unnecessary as it doesn't contain any expressions. A more idiomatic way to construct the URL would be to use a single f-string for the entire expression.

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

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)

31 changes: 9 additions & 22 deletions Adyen/services/legalEntityManagement/legal_entities_api.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,66 +19,53 @@
"""
endpoint = self.baseUrl + f"/legalEntities/{id}/checkVerificationErrors"
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)

def confirm_data_review(self, id, idempotency_key=None, **kwargs):
"""
Confirm data review
"""
endpoint = self.baseUrl + f"/legalEntities/{id}/confirmDataReview"
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)

def create_legal_entity(self, request, idempotency_key=None, **kwargs):
"""
Create a legal entity
"""
endpoint = self.baseUrl + "/legalEntities"
endpoint = self.baseUrl + f"/legalEntities"

Check warning on line 36 in Adyen/services/legalEntityManagement/legal_entities_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=AZ0K04gM63pryTICbQTg&open=AZ0K04gM63pryTICbQTg&pullRequest=456
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 f-string f"/legalEntities" is unnecessary as it doesn't contain any expressions. A more idiomatic way to construct the URL would be to use a single f-string for the entire expression.

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

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_business_lines_under_legal_entity(self, id, idempotency_key=None, **kwargs):
"""
Get all business lines under a legal entity
"""
endpoint = self.baseUrl + f"/legalEntities/{id}/businessLines"
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_legal_entity(self, id, idempotency_key=None, **kwargs):
"""
Get a legal entity
"""
endpoint = self.baseUrl + f"/legalEntities/{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_periodic_review(self, id, idempotency_key=None, **kwargs):
"""
Request periodic data review.
"""
endpoint = self.baseUrl + f"/legalEntities/{id}/requestPeriodicReview"
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)

def update_legal_entity(self, request, id, idempotency_key=None, **kwargs):
"""
Update a legal entity
"""
endpoint = self.baseUrl + f"/legalEntities/{id}"
method = "PATCH"
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)

21 changes: 6 additions & 15 deletions Adyen/services/legalEntityManagement/pci_questionnaires_api.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,46 +19,37 @@ def calculate_pci_status_of_legal_entity(self, request, id, idempotency_key=None
"""
endpoint = self.baseUrl + f"/legalEntities/{id}/pciQuestionnaires/signingRequired"
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 generate_pci_questionnaire(self, request, id, idempotency_key=None, **kwargs):
"""
Generate PCI questionnaire
"""
endpoint = self.baseUrl + f"/legalEntities/{id}/pciQuestionnaires/generatePciTemplates"
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_pci_questionnaire(self, id, pciid, idempotency_key=None, **kwargs):
"""
Get PCI questionnaire
"""
endpoint = self.baseUrl + f"/legalEntities/{id}/pciQuestionnaires/{pciid}"
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_pci_questionnaire_details(self, id, idempotency_key=None, **kwargs):
"""
Get PCI questionnaire details
"""
endpoint = self.baseUrl + f"/legalEntities/{id}/pciQuestionnaires"
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 sign_pci_questionnaire(self, request, id, idempotency_key=None, **kwargs):
"""
Sign PCI questionnaire
"""
endpoint = self.baseUrl + f"/legalEntities/{id}/pciQuestionnaires/signPciTemplates"
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)

Original file line number Diff line number Diff line change
Expand Up @@ -13,26 +13,19 @@ def __init__(self, client=None):
self.service = "legalEntityManagement"
self.baseUrl = "https://kyc-test.adyen.com/lem/v4"

def check_status_of_consent_for_electronic_delivery_of_tax_forms(
self, id, idempotency_key=None, **kwargs
):
def check_status_of_consent_for_electronic_delivery_of_tax_forms(self, id, idempotency_key=None, **kwargs):
"""
Check the status of consent for electronic delivery of tax forms
"""
endpoint = self.baseUrl + f"/legalEntities/{id}/checkTaxElectronicDeliveryConsent"
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)

def set_consent_status_for_electronic_delivery_of_tax_forms(
self, request, id, idempotency_key=None, **kwargs
):
def set_consent_status_for_electronic_delivery_of_tax_forms(self, request, id, idempotency_key=None, **kwargs):
"""
Set the consent status for electronic delivery of tax forms
"""
endpoint = self.baseUrl + f"/legalEntities/{id}/setTaxElectronicDeliveryConsent"
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)

34 changes: 9 additions & 25 deletions Adyen/services/legalEntityManagement/terms_of_service_api.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,59 +13,43 @@ def __init__(self, client=None):
self.service = "legalEntityManagement"
self.baseUrl = "https://kyc-test.adyen.com/lem/v4"

def accept_terms_of_service(
self, request, id, termsofservicedocumentid, idempotency_key=None, **kwargs
):
def accept_terms_of_service(self, request, id, termsofservicedocumentid, idempotency_key=None, **kwargs):
"""
Accept Terms of Service
"""
endpoint = self.baseUrl + f"/legalEntities/{id}/termsOfService/{termsofservicedocumentid}"
method = "PATCH"
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_accepted_terms_of_service_document(
self, id, termsofserviceacceptancereference, idempotency_key=None, **kwargs
):
def get_accepted_terms_of_service_document(self, id, termsofserviceacceptancereference, idempotency_key=None, **kwargs):
"""
Get accepted Terms of Service document
"""
endpoint = (
self.baseUrl
+ f"/legalEntities/{id}/acceptedTermsOfServiceDocument/{termsofserviceacceptancereference}"
)
endpoint = self.baseUrl + f"/legalEntities/{id}/acceptedTermsOfServiceDocument/{termsofserviceacceptancereference}"
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_terms_of_service_document(self, request, id, idempotency_key=None, **kwargs):
"""
Get Terms of Service document
"""
endpoint = self.baseUrl + f"/legalEntities/{id}/termsOfService"
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_terms_of_service_information_for_legal_entity(self, id, idempotency_key=None, **kwargs):
"""
Get Terms of Service information for a legal entity
"""
endpoint = self.baseUrl + f"/legalEntities/{id}/termsOfServiceAcceptanceInfos"
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_terms_of_service_status(self, id, idempotency_key=None, **kwargs):
"""
Get Terms of Service status
"""
endpoint = self.baseUrl + f"/legalEntities/{id}/termsOfServiceStatus"
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)

Original file line number Diff line number Diff line change
Expand Up @@ -17,38 +17,31 @@
"""
Create a transfer instrument
"""
endpoint = self.baseUrl + "/transferInstruments"
endpoint = self.baseUrl + f"/transferInstruments"

Check warning on line 20 in Adyen/services/legalEntityManagement/transfer_instruments_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=AZ0K04iA63pryTICbQTj&open=AZ0K04iA63pryTICbQTj&pullRequest=456
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 f-string f"/transferInstruments" is unnecessary as it doesn't contain any expressions. A more idiomatic way to construct the URL would be to use a single f-string for the entire expression.

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

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 delete_transfer_instrument(self, id, idempotency_key=None, **kwargs):
"""
Delete a transfer instrument
"""
endpoint = self.baseUrl + f"/transferInstruments/{id}"
method = "DELETE"
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_instrument(self, id, idempotency_key=None, **kwargs):
"""
Get a transfer instrument
"""
endpoint = self.baseUrl + f"/transferInstruments/{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 update_transfer_instrument(self, request, id, idempotency_key=None, **kwargs):
"""
Update a transfer instrument
"""
endpoint = self.baseUrl + f"/transferInstruments/{id}"
method = "PATCH"
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