Skip to content
Merged
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
3 changes: 3 additions & 0 deletions Adyen/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@
AdyenStoredValueApi,
AdyenBalancePlatformApi,
AdyenDisputesApi,
AdyenSessionAuthenticationApi
)

from .httpclient import HTTPClient
Expand All @@ -47,6 +48,7 @@ def __init__(self, **kwargs):
self.storedValue = AdyenStoredValueApi(client=self.client)
self.balancePlatform = AdyenBalancePlatformApi(client=self.client)
self.disputes = AdyenDisputesApi(client=self.client)
self.sessionAuthentication = AdyenSessionAuthenticationApi(client=self.client)


_base_adyen_obj = Adyen()
Expand All @@ -63,3 +65,4 @@ def __init__(self, **kwargs):
storedValue = _base_adyen_obj.storedValue
balancePlatform = _base_adyen_obj.balancePlatform
disputes = _base_adyen_obj.disputes
sessionAuthentication = _base_adyen_obj.sessionAuthentication
10 changes: 8 additions & 2 deletions Adyen/client.py
Original file line number Diff line number Diff line change
Expand Up @@ -94,6 +94,7 @@ def __init__(
api_stored_value_version=None,
api_balance_platform_version=None,
api_disputes_version=None,
api_session_authentication_version=None,

):
self.username = username
Expand Down Expand Up @@ -127,6 +128,7 @@ def __init__(
self.api_stored_value_version = api_stored_value_version
self.api_balance_platform_version = api_balance_platform_version
self.api_disputes_version = api_disputes_version
self.api_session_authentication_version = api_session_authentication_version

def _determine_api_url(self, platform, endpoint):
if platform == "test":
Expand All @@ -152,6 +154,8 @@ def _determine_api_url(self, platform, endpoint):
else:
endpoint = endpoint.replace("https://checkout-test.adyen.com/",
"https://" + self.live_endpoint_prefix + "-checkout-live.adyenpayments.com/checkout/")
elif "authe/api" in endpoint:
endpoint = endpoint.replace("https://test.adyen.com", "https://authe-live.adyen.com")

endpoint = endpoint.replace("-test", "-live")

Expand Down Expand Up @@ -281,7 +285,8 @@ def _set_url_version(self, service, endpoint):
"transfers": self.api_transfers_version,
"storedValue": self.api_stored_value_version,
"balancePlatform": self.api_balance_platform_version,
"disputes": self.api_disputes_version
"disputes": self.api_disputes_version,
"sessionAuthentication": self.api_session_authentication_version
}

new_version = f"v{version_lookup[service]}"
Expand Down Expand Up @@ -337,7 +342,8 @@ def call_adyen_api(
self.api_transfers_version,
self.api_stored_value_version,
self.api_balance_platform_version,
self.api_disputes_version]
self.api_disputes_version,
self.api_session_authentication_version]
if any(versions):
endpoint = self._set_url_version(service, endpoint)

Expand Down
1 change: 1 addition & 0 deletions Adyen/services/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,3 +12,4 @@
from .storedValue import AdyenStoredValueApi
from .balancePlatform import AdyenBalancePlatformApi
from .disputes import AdyenDisputesApi
from .sessionAuthentication import AdyenSessionAuthenticationApi
14 changes: 14 additions & 0 deletions Adyen/services/balanceControl/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
from ..base import AdyenServiceBase
from .balance_control_api import BalanceControlApi


class AdyenBalanceControlApi(AdyenServiceBase):
"""NOTE: This class is auto generated by OpenAPI Generator
Ref: https://openapi-generator.tech
Do not edit the class manually.
"""

def __init__(self, client=None):
super(AdyenBalanceControlApi, self).__init__(client=client)
self.balance_control_api = BalanceControlApi(client=client)
Original file line number Diff line number Diff line change
@@ -1,15 +1,15 @@
from .base import AdyenServiceBase
from ..base import AdyenServiceBase


class AdyenBalanceControlApi(AdyenServiceBase):
class BalanceControlApi(AdyenServiceBase):
"""NOTE: This class is auto generated by OpenAPI Generator
Ref: https://openapi-generator.tech
Do not edit the class manually.
"""

def __init__(self, client=None):
super(AdyenBalanceControlApi, self).__init__(client=client)
super(BalanceControlApi, self).__init__(client=client)
self.service = "balanceControl"
self.baseUrl = "https://pal-test.adyen.com/pal/servlet/BalanceControl/v1"

Expand Down
4 changes: 4 additions & 0 deletions Adyen/services/balancePlatform/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,8 @@
from .payment_instruments_api import PaymentInstrumentsApi
from .platform_api import PlatformApi
from .transaction_rules_api import TransactionRulesApi
from .transfer_limits_balance_account_level_api import TransferLimitsBalanceAccountLevelApi
from .transfer_limits_balance_platform_level_api import TransferLimitsBalancePlatformLevelApi
from .transfer_routes_api import TransferRoutesApi


Expand Down Expand Up @@ -41,4 +43,6 @@ def __init__(self, client=None):
self.payment_instruments_api = PaymentInstrumentsApi(client=client)
self.platform_api = PlatformApi(client=client)
self.transaction_rules_api = TransactionRulesApi(client=client)
self.transfer_limits_balance_account_level_api = TransferLimitsBalanceAccountLevelApi(client=client)
self.transfer_limits_balance_platform_level_api = TransferLimitsBalancePlatformLevelApi(client=client)
self.transfer_routes_api = TransferRoutesApi(client=client)
4 changes: 2 additions & 2 deletions Adyen/services/balancePlatform/authorized_card_users_api.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ def __init__(self, client=None):
self.service = "balancePlatform"
self.baseUrl = "https://balanceplatform-api-test.adyen.com/bcl/v2"

def create_authorised_card_users(self, request, paymentInstrumentId, authorisedCardUsers, idempotency_key=None, **kwargs):
def create_authorised_card_users(self, request, paymentInstrumentId, idempotency_key=None, **kwargs):
"""
Create authorized users for a card.
"""
Expand All @@ -37,7 +37,7 @@ def get_all_authorised_card_users(self, paymentInstrumentId, idempotency_key=Non
method = "GET"
return self.client.call_adyen_api(None, self.service, method, endpoint, idempotency_key, **kwargs)

def update_authorised_card_users(self, request, paymentInstrumentId, authorisedCardUsers, idempotency_key=None, **kwargs):
def update_authorised_card_users(self, request, paymentInstrumentId, idempotency_key=None, **kwargs):
"""
Update the authorized users for a card.
"""
Expand Down
4 changes: 2 additions & 2 deletions Adyen/services/balancePlatform/balances_api.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ def __init__(self, client=None):
self.service = "balancePlatform"
self.baseUrl = "https://balanceplatform-api-test.adyen.com/bcl/v2"

def create_webhook_setting(self, request, balancePlatformId, webhookId, balanceWebhookSettingInfo, idempotency_key=None, **kwargs):
def create_webhook_setting(self, request, balancePlatformId, webhookId, idempotency_key=None, **kwargs):
"""
Create a balance webhook setting
"""
Expand Down Expand Up @@ -45,7 +45,7 @@ def get_webhook_setting(self, balancePlatformId, webhookId, settingId, idempoten
method = "GET"
return self.client.call_adyen_api(None, self.service, method, endpoint, idempotency_key, **kwargs)

def update_webhook_setting(self, request, balancePlatformId, webhookId, settingId, balanceWebhookSettingInfoUpdate, idempotency_key=None, **kwargs):
def update_webhook_setting(self, request, balancePlatformId, webhookId, settingId, idempotency_key=None, **kwargs):
"""
Update a balance webhook setting by id
"""
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,63 @@
from ..base import AdyenServiceBase


class TransferLimitsBalanceAccountLevelApi(AdyenServiceBase):
"""NOTE: This class is auto generated by OpenAPI Generator
Ref: https://openapi-generator.tech
Do not edit the class manually.
"""

def __init__(self, client=None):
super(TransferLimitsBalanceAccountLevelApi, self).__init__(client=client)
self.service = "balancePlatform"
self.baseUrl = "https://balanceplatform-api-test.adyen.com/bcl/v2"

def approve_pending_transfer_limits(self, request, id, idempotency_key=None, **kwargs):
"""
Approve pending transfer limits
"""
endpoint = self.baseUrl + f"/balanceAccounts/{id}/transferLimits/approve"
method = "POST"
return self.client.call_adyen_api(request, self.service, method, endpoint, idempotency_key, **kwargs)

def create_transfer_limit(self, request, id, idempotency_key=None, **kwargs):
"""
Create a transfer limit
"""
endpoint = self.baseUrl + f"/balanceAccounts/{id}/transferLimits"
method = "POST"
return self.client.call_adyen_api(request, self.service, method, endpoint, idempotency_key, **kwargs)

def delete_pending_transfer_limit(self, id, transferLimitId, idempotency_key=None, **kwargs):
"""
Delete a scheduled or pending transfer limit
"""
endpoint = self.baseUrl + f"/balanceAccounts/{id}/transferLimits/{transferLimitId}"
method = "DELETE"
return self.client.call_adyen_api(None, self.service, method, endpoint, idempotency_key, **kwargs)

def get_current_transfer_limits(self, id, idempotency_key=None, **kwargs):
"""
Get all current transfer limits
"""
endpoint = self.baseUrl + f"/balanceAccounts/{id}/transferLimits/current"
method = "GET"
return self.client.call_adyen_api(None, self.service, method, endpoint, idempotency_key, **kwargs)

def get_specific_transfer_limit(self, id, transferLimitId, idempotency_key=None, **kwargs):
"""
Get the details of a transfer limit
"""
endpoint = self.baseUrl + f"/balanceAccounts/{id}/transferLimits/{transferLimitId}"
method = "GET"
return self.client.call_adyen_api(None, self.service, method, endpoint, idempotency_key, **kwargs)

def get_transfer_limits(self, id, idempotency_key=None, **kwargs):
"""
Filter and view the transfer limits
"""
endpoint = self.baseUrl + f"/balanceAccounts/{id}/transferLimits"
method = "GET"
return self.client.call_adyen_api(None, self.service, method, endpoint, idempotency_key, **kwargs)

Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
from ..base import AdyenServiceBase


class TransferLimitsBalancePlatformLevelApi(AdyenServiceBase):
"""NOTE: This class is auto generated by OpenAPI Generator
Ref: https://openapi-generator.tech
Do not edit the class manually.
"""

def __init__(self, client=None):
super(TransferLimitsBalancePlatformLevelApi, self).__init__(client=client)
self.service = "balancePlatform"
self.baseUrl = "https://balanceplatform-api-test.adyen.com/bcl/v2"

def create_transfer_limit(self, request, id, idempotency_key=None, **kwargs):
"""
Create a transfer limit
"""
endpoint = self.baseUrl + f"/balancePlatforms/{id}/transferLimits"
method = "POST"
return self.client.call_adyen_api(request, self.service, method, endpoint, idempotency_key, **kwargs)

def delete_pending_transfer_limit(self, id, transferLimitId, idempotency_key=None, **kwargs):
"""
Delete a scheduled or pending transfer limit
"""
endpoint = self.baseUrl + f"/balancePlatforms/{id}/transferLimits/{transferLimitId}"
method = "DELETE"
return self.client.call_adyen_api(None, self.service, method, endpoint, idempotency_key, **kwargs)

def get_specific_transfer_limit(self, id, transferLimitId, idempotency_key=None, **kwargs):
"""
Get the details of a transfer limit
"""
endpoint = self.baseUrl + f"/balancePlatforms/{id}/transferLimits/{transferLimitId}"
method = "GET"
return self.client.call_adyen_api(None, self.service, method, endpoint, idempotency_key, **kwargs)

def get_transfer_limits(self, id, idempotency_key=None, **kwargs):
"""
Filter and view the transfer limits
"""
endpoint = self.baseUrl + f"/balancePlatforms/{id}/transferLimits"
method = "GET"
return self.client.call_adyen_api(None, self.service, method, endpoint, idempotency_key, **kwargs)

14 changes: 14 additions & 0 deletions Adyen/services/binlookup/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
from ..base import AdyenServiceBase
from .bin_lookup_api import BinLookupApi


class AdyenBinlookupApi(AdyenServiceBase):
"""NOTE: This class is auto generated by OpenAPI Generator
Ref: https://openapi-generator.tech
Do not edit the class manually.
"""

def __init__(self, client=None):
super(AdyenBinlookupApi, self).__init__(client=client)
self.bin_lookup_api = BinLookupApi(client=client)
Original file line number Diff line number Diff line change
@@ -1,15 +1,15 @@
from .base import AdyenServiceBase
from ..base import AdyenServiceBase


class AdyenBinlookupApi(AdyenServiceBase):
class BinLookupApi(AdyenServiceBase):
"""NOTE: This class is auto generated by OpenAPI Generator
Ref: https://openapi-generator.tech
Do not edit the class manually.
"""

def __init__(self, client=None):
super(AdyenBinlookupApi, self).__init__(client=client)
super(BinLookupApi, self).__init__(client=client)
self.service = "binlookup"
self.baseUrl = "https://pal-test.adyen.com/pal/servlet/BinLookup/v54"

Expand Down
2 changes: 1 addition & 1 deletion Adyen/services/checkout/donations_api.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ def donation_campaigns(self, request, idempotency_key=None, **kwargs):

def donations(self, request, idempotency_key=None, **kwargs):
"""
Start a transaction for donations
Make a donation
"""
endpoint = self.baseUrl + f"/donations"
method = "POST"
Expand Down
8 changes: 8 additions & 0 deletions Adyen/services/checkout/utility_api.py
Original file line number Diff line number Diff line change
Expand Up @@ -39,3 +39,11 @@ def updates_order_for_paypal_express_checkout(self, request, idempotency_key=Non
method = "POST"
return self.client.call_adyen_api(request, self.service, method, endpoint, idempotency_key, **kwargs)

def validate_shopper_id(self, request, idempotency_key=None, **kwargs):
"""
Validates shopper Id
"""
endpoint = self.baseUrl + f"/validateShopperId"
method = "POST"
return self.client.call_adyen_api(request, self.service, method, endpoint, idempotency_key, **kwargs)

14 changes: 14 additions & 0 deletions Adyen/services/dataProtection/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
from ..base import AdyenServiceBase
from .data_protection_api import DataProtectionApi


class AdyenDataProtectionApi(AdyenServiceBase):
"""NOTE: This class is auto generated by OpenAPI Generator
Ref: https://openapi-generator.tech
Do not edit the class manually.
"""

def __init__(self, client=None):
super(AdyenDataProtectionApi, self).__init__(client=client)
self.data_protection_api = DataProtectionApi(client=client)
Original file line number Diff line number Diff line change
@@ -1,15 +1,15 @@
from .base import AdyenServiceBase
from ..base import AdyenServiceBase


class AdyenDataProtectionApi(AdyenServiceBase):
class DataProtectionApi(AdyenServiceBase):
"""NOTE: This class is auto generated by OpenAPI Generator
Ref: https://openapi-generator.tech
Do not edit the class manually.
"""

def __init__(self, client=None):
super(AdyenDataProtectionApi, self).__init__(client=client)
super(DataProtectionApi, self).__init__(client=client)
self.service = "dataProtection"
self.baseUrl = "https://ca-test.adyen.com/ca/services/DataProtectionService/v1"

Expand Down
14 changes: 14 additions & 0 deletions Adyen/services/disputes/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
from ..base import AdyenServiceBase
from .disputes_api import DisputesApi


class AdyenDisputesApi(AdyenServiceBase):
"""NOTE: This class is auto generated by OpenAPI Generator
Ref: https://openapi-generator.tech
Do not edit the class manually.
"""

def __init__(self, client=None):
super(AdyenDisputesApi, self).__init__(client=client)
self.disputes_api = DisputesApi(client=client)
Original file line number Diff line number Diff line change
@@ -1,15 +1,15 @@
from .base import AdyenServiceBase
from ..base import AdyenServiceBase


class AdyenDisputesApi(AdyenServiceBase):
class DisputesApi(AdyenServiceBase):
"""NOTE: This class is auto generated by OpenAPI Generator
Ref: https://openapi-generator.tech
Do not edit the class manually.
"""

def __init__(self, client=None):
super(AdyenDisputesApi, self).__init__(client=client)
super(DisputesApi, self).__init__(client=client)
self.service = "disputes"
self.baseUrl = "https://ca-test.adyen.com/ca/services/DisputeService/v30"

Expand Down
Loading