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
12 changes: 5 additions & 7 deletions Adyen/services/management/__init__.py
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
from ..base import AdyenServiceBase
from .api_credentials_company_level_api import APICredentialsCompanyLevelApi
from .api_credentials_merchant_level_api import APICredentialsMerchantLevelApi
from .api_key_company_level_api import APIKeyCompanyLevelApi
from .api_key_merchant_level_api import APIKeyMerchantLevelApi
from .account_company_level_api import AccountCompanyLevelApi
from .account_merchant_level_api import AccountMerchantLevelApi
from .account_store_level_api import AccountStoreLevelApi
from .allowed_origins_company_level_api import AllowedOriginsCompanyLevelApi
from .allowed_origins_merchant_level_api import AllowedOriginsMerchantLevelApi
from .android_files_company_level_api import AndroidFilesCompanyLevelApi
from .api_credentials_company_level_api import APICredentialsCompanyLevelApi
from .api_credentials_merchant_level_api import APICredentialsMerchantLevelApi
from .api_key_company_level_api import APIKeyCompanyLevelApi
from .api_key_merchant_level_api import APIKeyMerchantLevelApi
from .client_key_company_level_api import ClientKeyCompanyLevelApi
from .client_key_merchant_level_api import ClientKeyMerchantLevelApi
from .my_api_credential_api import MyAPICredentialApi
Expand Down Expand Up @@ -54,9 +54,7 @@ def __init__(self, client=None):
self.my_api_credential_api = MyAPICredentialApi(client=client)
self.payment_methods_merchant_level_api = PaymentMethodsMerchantLevelApi(client=client)
self.payout_settings_merchant_level_api = PayoutSettingsMerchantLevelApi(client=client)
self.split_configuration_merchant_level_api = SplitConfigurationMerchantLevelApi(
client=client
)
self.split_configuration_merchant_level_api = SplitConfigurationMerchantLevelApi(client=client)
self.terminal_actions_company_level_api = TerminalActionsCompanyLevelApi(client=client)
self.terminal_actions_terminal_level_api = TerminalActionsTerminalLevelApi(client=client)
self.terminal_orders_company_level_api = TerminalOrdersCompanyLevelApi(client=client)
Expand Down
15 changes: 5 additions & 10 deletions Adyen/services/management/account_company_level_api.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,26 +19,21 @@
"""
endpoint = self.baseUrl + f"/companies/{companyId}"
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_company_accounts(self, idempotency_key=None, **kwargs):
"""
Get a list of company accounts
"""
endpoint = self.baseUrl + "/companies"
endpoint = self.baseUrl + f"/companies"

Check warning on line 28 in Adyen/services/management/account_company_level_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=AZ0K03y763pryTICbQOl&open=AZ0K03y763pryTICbQOl&pullRequest=458
Copy link
Contributor

Choose a reason for hiding this comment

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

medium

Using an f-string for a static string like "/companies" is redundant. While not incorrect, a plain string is sufficient and slightly more efficient as it avoids unnecessary f-string processing.

Suggested change
endpoint = self.baseUrl + f"/companies"
endpoint = self.baseUrl + "/companies"

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_merchant_accounts(self, companyId, idempotency_key=None, **kwargs):
"""
Get a list of merchant accounts
"""
endpoint = self.baseUrl + f"/companies/{companyId}/merchants"
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)

21 changes: 7 additions & 14 deletions Adyen/services/management/account_merchant_level_api.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,38 +17,31 @@
"""
Create a merchant account
"""
endpoint = self.baseUrl + "/merchants"
endpoint = self.baseUrl + f"/merchants"

Check warning on line 20 in Adyen/services/management/account_merchant_level_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=AZ0K03xe63pryTICbQOd&open=AZ0K03xe63pryTICbQOd&pullRequest=458
Copy link
Contributor

Choose a reason for hiding this comment

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

medium

Using an f-string for a static string like "/merchants" is redundant. While not incorrect, a plain string is sufficient and slightly more efficient as it avoids unnecessary f-string processing.

Suggested change
endpoint = self.baseUrl + f"/merchants"
endpoint = self.baseUrl + "/merchants"

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_merchant_account(self, merchantId, idempotency_key=None, **kwargs):
"""
Get a merchant account
"""
endpoint = self.baseUrl + f"/merchants/{merchantId}"
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_merchant_accounts(self, idempotency_key=None, **kwargs):
"""
Get a list of merchant accounts
"""
endpoint = self.baseUrl + "/merchants"
endpoint = self.baseUrl + f"/merchants"
Copy link
Contributor

Choose a reason for hiding this comment

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

medium

Using an f-string for a static string like "/merchants" is redundant. While not incorrect, a plain string is sufficient and slightly more efficient as it avoids unnecessary f-string processing.

Suggested change
endpoint = self.baseUrl + f"/merchants"
endpoint = self.baseUrl + "/merchants"

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_to_activate_merchant_account(self, merchantId, idempotency_key=None, **kwargs):
"""
Request to activate a merchant account
"""
endpoint = self.baseUrl + f"/merchants/{merchantId}/activate"
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)

37 changes: 11 additions & 26 deletions Adyen/services/management/account_store_level_api.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,78 +17,63 @@
"""
Create a store
"""
endpoint = self.baseUrl + "/stores"
endpoint = self.baseUrl + f"/stores"

Check warning on line 20 in Adyen/services/management/account_store_level_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=AZ0K03zp63pryTICbQOm&open=AZ0K03zp63pryTICbQOm&pullRequest=458
Copy link
Contributor

Choose a reason for hiding this comment

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

medium

Using an f-string for a static string like "/stores" is redundant. While not incorrect, a plain string is sufficient and slightly more efficient as it avoids unnecessary f-string processing.

Suggested change
endpoint = self.baseUrl + f"/stores"
endpoint = self.baseUrl + "/stores"

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 create_store_by_merchant_id(self, request, merchantId, idempotency_key=None, **kwargs):
"""
Create a store
"""
endpoint = self.baseUrl + f"/merchants/{merchantId}/stores"
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_store(self, merchantId, storeId, idempotency_key=None, **kwargs):
"""
Get a store
"""
endpoint = self.baseUrl + f"/merchants/{merchantId}/stores/{storeId}"
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_store_by_id(self, storeId, idempotency_key=None, **kwargs):
"""
Get a store
"""
endpoint = self.baseUrl + f"/stores/{storeId}"
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_stores(self, idempotency_key=None, **kwargs):
"""
Get a list of stores
"""
endpoint = self.baseUrl + "/stores"
endpoint = self.baseUrl + f"/stores"

Check warning on line 52 in Adyen/services/management/account_store_level_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=AZ0K03zp63pryTICbQOn&open=AZ0K03zp63pryTICbQOn&pullRequest=458
Copy link
Contributor

Choose a reason for hiding this comment

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

medium

Using an f-string for a static string like "/stores" is redundant. While not incorrect, a plain string is sufficient and slightly more efficient as it avoids unnecessary f-string processing.

Suggested change
endpoint = self.baseUrl + f"/stores"
endpoint = self.baseUrl + "/stores"

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_stores_by_merchant_id(self, merchantId, idempotency_key=None, **kwargs):
"""
Get a list of stores
"""
endpoint = self.baseUrl + f"/merchants/{merchantId}/stores"
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_store(self, request, merchantId, storeId, idempotency_key=None, **kwargs):
"""
Update a store
"""
endpoint = self.baseUrl + f"/merchants/{merchantId}/stores/{storeId}"
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 update_store_by_id(self, request, storeId, idempotency_key=None, **kwargs):
"""
Update a store
"""
endpoint = self.baseUrl + f"/stores/{storeId}"
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)

47 changes: 12 additions & 35 deletions Adyen/services/management/allowed_origins_company_level_api.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,58 +13,35 @@
self.service = "management"
self.baseUrl = "https://management-test.adyen.com/v3"

def create_allowed_origin(
self, request, companyId, apiCredentialId, idempotency_key=None, **kwargs
):
def create_allowed_origin(self, request, companyId, apiCredentialId, idempotency_key=None, **kwargs):
"""
Create an allowed origin
"""
endpoint = (
self.baseUrl + f"/companies/{companyId}/apiCredentials/{apiCredentialId}/allowedOrigins"
)
endpoint = self.baseUrl + f"/companies/{companyId}/apiCredentials/{apiCredentialId}/allowedOrigins"
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_allowed_origin(
self, companyId, apiCredentialId, originId, idempotency_key=None, **kwargs
):
def delete_allowed_origin(self, companyId, apiCredentialId, originId, idempotency_key=None, **kwargs):

Check warning on line 24 in Adyen/services/management/allowed_origins_company_level_api.py

View check run for this annotation

SonarQubeCloud / SonarCloud Code Analysis

Rename this parameter "apiCredentialId" to match the regular expression ^[_a-z][a-z0-9_]*$.

See more on https://sonarcloud.io/project/issues?id=Adyen_adyen-python-api-library&issues=AZ0K03uV63pryTICbQOQ&open=AZ0K03uV63pryTICbQOQ&pullRequest=458

Check warning on line 24 in Adyen/services/management/allowed_origins_company_level_api.py

View check run for this annotation

SonarQubeCloud / SonarCloud Code Analysis

Rename this parameter "companyId" to match the regular expression ^[_a-z][a-z0-9_]*$.

See more on https://sonarcloud.io/project/issues?id=Adyen_adyen-python-api-library&issues=AZ0K03uV63pryTICbQOR&open=AZ0K03uV63pryTICbQOR&pullRequest=458

Check warning on line 24 in Adyen/services/management/allowed_origins_company_level_api.py

View check run for this annotation

SonarQubeCloud / SonarCloud Code Analysis

Rename this parameter "originId" to match the regular expression ^[_a-z][a-z0-9_]*$.

See more on https://sonarcloud.io/project/issues?id=Adyen_adyen-python-api-library&issues=AZ0K03uV63pryTICbQOS&open=AZ0K03uV63pryTICbQOS&pullRequest=458
"""
Delete an allowed origin
"""
endpoint = (
self.baseUrl
+ f"/companies/{companyId}/apiCredentials/{apiCredentialId}/allowedOrigins/{originId}"
)
endpoint = self.baseUrl + f"/companies/{companyId}/apiCredentials/{apiCredentialId}/allowedOrigins/{originId}"
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_allowed_origin(
self, companyId, apiCredentialId, originId, idempotency_key=None, **kwargs
):
def get_allowed_origin(self, companyId, apiCredentialId, originId, idempotency_key=None, **kwargs):

Check warning on line 32 in Adyen/services/management/allowed_origins_company_level_api.py

View check run for this annotation

SonarQubeCloud / SonarCloud Code Analysis

Rename this parameter "companyId" to match the regular expression ^[_a-z][a-z0-9_]*$.

See more on https://sonarcloud.io/project/issues?id=Adyen_adyen-python-api-library&issues=AZ0K03uV63pryTICbQOU&open=AZ0K03uV63pryTICbQOU&pullRequest=458

Check warning on line 32 in Adyen/services/management/allowed_origins_company_level_api.py

View check run for this annotation

SonarQubeCloud / SonarCloud Code Analysis

Rename this parameter "apiCredentialId" to match the regular expression ^[_a-z][a-z0-9_]*$.

See more on https://sonarcloud.io/project/issues?id=Adyen_adyen-python-api-library&issues=AZ0K03uV63pryTICbQOT&open=AZ0K03uV63pryTICbQOT&pullRequest=458

Check warning on line 32 in Adyen/services/management/allowed_origins_company_level_api.py

View check run for this annotation

SonarQubeCloud / SonarCloud Code Analysis

Rename this parameter "originId" to match the regular expression ^[_a-z][a-z0-9_]*$.

See more on https://sonarcloud.io/project/issues?id=Adyen_adyen-python-api-library&issues=AZ0K03uV63pryTICbQOV&open=AZ0K03uV63pryTICbQOV&pullRequest=458
"""
Get an allowed origin
"""
endpoint = (
self.baseUrl
+ f"/companies/{companyId}/apiCredentials/{apiCredentialId}/allowedOrigins/{originId}"
)
endpoint = self.baseUrl + f"/companies/{companyId}/apiCredentials/{apiCredentialId}/allowedOrigins/{originId}"
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_allowed_origins(self, companyId, apiCredentialId, idempotency_key=None, **kwargs):
"""
Get a list of allowed origins
"""
endpoint = (
self.baseUrl + f"/companies/{companyId}/apiCredentials/{apiCredentialId}/allowedOrigins"
)
endpoint = self.baseUrl + f"/companies/{companyId}/apiCredentials/{apiCredentialId}/allowedOrigins"
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)

49 changes: 12 additions & 37 deletions Adyen/services/management/allowed_origins_merchant_level_api.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,60 +13,35 @@
self.service = "management"
self.baseUrl = "https://management-test.adyen.com/v3"

def create_allowed_origin(
self, request, merchantId, apiCredentialId, idempotency_key=None, **kwargs
):
def create_allowed_origin(self, request, merchantId, apiCredentialId, idempotency_key=None, **kwargs):

Check warning on line 16 in Adyen/services/management/allowed_origins_merchant_level_api.py

View check run for this annotation

SonarQubeCloud / SonarCloud Code Analysis

Rename this parameter "merchantId" to match the regular expression ^[_a-z][a-z0-9_]*$.

See more on https://sonarcloud.io/project/issues?id=Adyen_adyen-python-api-library&issues=AZ0K03st63pryTICbQOE&open=AZ0K03st63pryTICbQOE&pullRequest=458

Check warning on line 16 in Adyen/services/management/allowed_origins_merchant_level_api.py

View check run for this annotation

SonarQubeCloud / SonarCloud Code Analysis

Rename this parameter "apiCredentialId" to match the regular expression ^[_a-z][a-z0-9_]*$.

See more on https://sonarcloud.io/project/issues?id=Adyen_adyen-python-api-library&issues=AZ0K03st63pryTICbQOD&open=AZ0K03st63pryTICbQOD&pullRequest=458
"""
Create an allowed origin
"""
endpoint = (
self.baseUrl
+ f"/merchants/{merchantId}/apiCredentials/{apiCredentialId}/allowedOrigins"
)
endpoint = self.baseUrl + f"/merchants/{merchantId}/apiCredentials/{apiCredentialId}/allowedOrigins"
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_allowed_origin(
self, merchantId, apiCredentialId, originId, idempotency_key=None, **kwargs
):
def delete_allowed_origin(self, merchantId, apiCredentialId, originId, idempotency_key=None, **kwargs):

Check warning on line 24 in Adyen/services/management/allowed_origins_merchant_level_api.py

View check run for this annotation

SonarQubeCloud / SonarCloud Code Analysis

Rename this parameter "apiCredentialId" to match the regular expression ^[_a-z][a-z0-9_]*$.

See more on https://sonarcloud.io/project/issues?id=Adyen_adyen-python-api-library&issues=AZ0K03st63pryTICbQOF&open=AZ0K03st63pryTICbQOF&pullRequest=458

Check warning on line 24 in Adyen/services/management/allowed_origins_merchant_level_api.py

View check run for this annotation

SonarQubeCloud / SonarCloud Code Analysis

Rename this parameter "merchantId" to match the regular expression ^[_a-z][a-z0-9_]*$.

See more on https://sonarcloud.io/project/issues?id=Adyen_adyen-python-api-library&issues=AZ0K03st63pryTICbQOG&open=AZ0K03st63pryTICbQOG&pullRequest=458

Check warning on line 24 in Adyen/services/management/allowed_origins_merchant_level_api.py

View check run for this annotation

SonarQubeCloud / SonarCloud Code Analysis

Rename this parameter "originId" to match the regular expression ^[_a-z][a-z0-9_]*$.

See more on https://sonarcloud.io/project/issues?id=Adyen_adyen-python-api-library&issues=AZ0K03st63pryTICbQOH&open=AZ0K03st63pryTICbQOH&pullRequest=458
"""
Delete an allowed origin
"""
endpoint = (
self.baseUrl
+ f"/merchants/{merchantId}/apiCredentials/{apiCredentialId}/allowedOrigins/{originId}"
)
endpoint = self.baseUrl + f"/merchants/{merchantId}/apiCredentials/{apiCredentialId}/allowedOrigins/{originId}"
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_allowed_origin(
self, merchantId, apiCredentialId, originId, idempotency_key=None, **kwargs
):
def get_allowed_origin(self, merchantId, apiCredentialId, originId, idempotency_key=None, **kwargs):
"""
Get an allowed origin
"""
endpoint = (
self.baseUrl
+ f"/merchants/{merchantId}/apiCredentials/{apiCredentialId}/allowedOrigins/{originId}"
)
endpoint = self.baseUrl + f"/merchants/{merchantId}/apiCredentials/{apiCredentialId}/allowedOrigins/{originId}"
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_allowed_origins(self, merchantId, apiCredentialId, idempotency_key=None, **kwargs):
"""
Get a list of allowed origins
"""
endpoint = (
self.baseUrl
+ f"/merchants/{merchantId}/apiCredentials/{apiCredentialId}/allowedOrigins"
)
endpoint = self.baseUrl + f"/merchants/{merchantId}/apiCredentials/{apiCredentialId}/allowedOrigins"
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)

Loading
Loading