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
4 changes: 2 additions & 2 deletions Adyen/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
AdyenPayoutsApi,
AdyenManagementApi,
AdyenCheckoutApi,
AdyenTerminal,
AdyenTerminalApi,
AdyenLegalEntityManagementApi,
AdyenDataProtectionApi,
AdyenTransfersApi,
Expand All @@ -39,7 +39,7 @@ def __init__(self, **kwargs):
self.payout = AdyenPayoutsApi(client=self.client)
self.recurring = AdyenRecurringApi(client=self.client)
self.checkout = AdyenCheckoutApi(client=self.client)
self.terminal = AdyenTerminal(client=self.client)
self.terminal = AdyenTerminalApi(client=self.client)
self.management = AdyenManagementApi(client=self.client)
self.legalEntityManagement = AdyenLegalEntityManagementApi(client=self.client)
self.dataProtection = AdyenDataProtectionApi(client=self.client)
Expand Down
18 changes: 9 additions & 9 deletions Adyen/client.py
Original file line number Diff line number Diff line change
Expand Up @@ -228,7 +228,7 @@ def _determine_base_url_and_version(self, platform, service):

def _determine_api_url(self, platform, service, endpoint):
api_version, base_url = self._determine_base_url_and_version(platform, service)
return '/'.join([base_url, api_version, endpoint])
return base_url + '/' + api_version + endpoint

def _review_payout_username(self, **kwargs):
if 'username' in kwargs:
Expand Down Expand Up @@ -379,14 +379,14 @@ def call_adyen_api(
message = request_data

with_app_info = [
"authorise",
"authorise3d",
"authorise3ds2",
"payments",
"paymentSession",
"paymentLinks",
"paymentMethods/balance",
"sessions"
"/authorise",
"/authorise3d",
"/authorise3ds2",
"/payments",
"/paymentSession",
"/paymentLinks",
"/paymentMethods/balance",
"/sessions"
]

if endpoint in with_app_info and (method == 'POST' or method == 'PATCH'):
Expand Down
2 changes: 1 addition & 1 deletion Adyen/services/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
from .payments import AdyenPaymentsApi
from .payouts import AdyenPayoutsApi
from .recurring import AdyenRecurringApi
from .terminal import AdyenTerminal
from .terminal import AdyenTerminalApi
from .management import AdyenManagementApi
from .legalEntityManagement import AdyenLegalEntityManagementApi
from .dataProtection import AdyenDataProtectionApi
Expand Down
14 changes: 1 addition & 13 deletions Adyen/services/binLookup.py
Original file line number Diff line number Diff line change
@@ -1,13 +1,3 @@
"""
Adyen BinLookup API

The BIN Lookup API provides endpoints for retrieving information, such as cost estimates, and 3D Secure supported version based on a given BIN. ## Authentication You need an [API credential](https://docs.adyen.com/development-resources/api-credentials) to authenticate to the API. If using an API key, add an `X-API-Key` header with the API key as the value, for example: ``` curl -H \"Content-Type: application/json\" \\ -H \"X-API-Key: YOUR_API_KEY\" \\ ... ``` Alternatively, you can use the username and password to connect to the API using basic authentication, for example: ``` curl -U \"ws@Company.YOUR_COMPANY_ACCOUNT\":\"YOUR_BASIC_AUTHENTICATION_PASSWORD\" \\ -H \"Content-Type: application/json\" \\ ... ``` ## Versioning The BinLookup API supports [versioning](https://docs.adyen.com/development-resources/versioning) using a version suffix in the endpoint URL. This suffix has the following format: \"vXX\", where XX is the version number. For example: ``` https://pal-test.adyen.com/pal/servlet/BinLookup/v52/get3dsAvailability ```## Going live To authneticate to the live endpoints, you need an [API credential](https://docs.adyen.com/development-resources/api-credentials) from your live Customer Area. The live endpoint URLs contain a prefix which is unique to your company account: ``` https://{PREFIX}-pal-live.adyenpayments.com/pal/servlet/BinLookup/v52/get3dsAvailability ``` Get your `{PREFIX}` from your live Customer Area under **Developers** > **API URLs** > **Prefix**. # noqa: E501

The version of the OpenAPI document: 52
Contact: developer-experience@adyen.com
Generated by: https://openapi-generator.tech
"""

from .base import AdyenServiceBase


Expand All @@ -22,12 +12,11 @@ def __init__(self, client=None):
super(AdyenBinlookupApi, self).__init__(client=client)
self.service = "binlookup"

def get_3ds_availability(self, request, idempotency_key=None, **kwargs):
def get3ds_availability(self, request, idempotency_key=None, **kwargs):
"""
Check if 3D Secure is available
"""
endpoint = f"/get3dsAvailability"
endpoint = endpoint.replace('/', '', 1)
method = "POST"
return self.client.call_adyen_api(request, self.service, method, endpoint, idempotency_key, **kwargs)

Expand All @@ -36,7 +25,6 @@ def get_cost_estimate(self, request, idempotency_key=None, **kwargs):
Get a fees cost estimate
"""
endpoint = f"/getCostEstimate"
endpoint = endpoint.replace('/', '', 1)
method = "POST"
return self.client.call_adyen_api(request, self.service, method, endpoint, idempotency_key, **kwargs)

2 changes: 0 additions & 2 deletions Adyen/services/checkout/classic_checkout_sdk_api.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,6 @@ def payment_session(self, request, idempotency_key=None, **kwargs):
Create a payment session
"""
endpoint = f"/paymentSession"
endpoint = endpoint.replace('/', '', 1)
method = "POST"
return self.client.call_adyen_api(request, self.service, method, endpoint, idempotency_key, **kwargs)

Expand All @@ -26,7 +25,6 @@ def verify_payment_result(self, request, idempotency_key=None, **kwargs):
Verify a payment result
"""
endpoint = f"/payments/result"
endpoint = endpoint.replace('/', '', 1)
method = "POST"
return self.client.call_adyen_api(request, self.service, method, endpoint, idempotency_key, **kwargs)

6 changes: 0 additions & 6 deletions Adyen/services/checkout/modifications_api.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,6 @@ def cancel_authorised_payment(self, request, idempotency_key=None, **kwargs):
Cancel an authorised payment
"""
endpoint = f"/cancels"
endpoint = endpoint.replace('/', '', 1)
method = "POST"
return self.client.call_adyen_api(request, self.service, method, endpoint, idempotency_key, **kwargs)

Expand All @@ -26,7 +25,6 @@ def update_authorised_amount(self, request, paymentPspReference, idempotency_key
Update an authorised amount
"""
endpoint = f"/payments/{paymentPspReference}/amountUpdates"
endpoint = endpoint.replace('/', '', 1)
method = "POST"
return self.client.call_adyen_api(request, self.service, method, endpoint, idempotency_key, **kwargs)

Expand All @@ -35,7 +33,6 @@ def cancel_authorised_payment_by_psp_reference(self, request, paymentPspReferenc
Cancel an authorised payment
"""
endpoint = f"/payments/{paymentPspReference}/cancels"
endpoint = endpoint.replace('/', '', 1)
method = "POST"
return self.client.call_adyen_api(request, self.service, method, endpoint, idempotency_key, **kwargs)

Expand All @@ -44,7 +41,6 @@ def capture_authorised_payment(self, request, paymentPspReference, idempotency_k
Capture an authorised payment
"""
endpoint = f"/payments/{paymentPspReference}/captures"
endpoint = endpoint.replace('/', '', 1)
method = "POST"
return self.client.call_adyen_api(request, self.service, method, endpoint, idempotency_key, **kwargs)

Expand All @@ -53,7 +49,6 @@ def refund_captured_payment(self, request, paymentPspReference, idempotency_key=
Refund a captured payment
"""
endpoint = f"/payments/{paymentPspReference}/refunds"
endpoint = endpoint.replace('/', '', 1)
method = "POST"
return self.client.call_adyen_api(request, self.service, method, endpoint, idempotency_key, **kwargs)

Expand All @@ -62,7 +57,6 @@ def refund_or_cancel_payment(self, request, paymentPspReference, idempotency_key
Refund or cancel a payment
"""
endpoint = f"/payments/{paymentPspReference}/reversals"
endpoint = endpoint.replace('/', '', 1)
method = "POST"
return self.client.call_adyen_api(request, self.service, method, endpoint, idempotency_key, **kwargs)

5 changes: 1 addition & 4 deletions Adyen/services/checkout/orders_api.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,12 +12,11 @@ def __init__(self, client=None):
super(OrdersApi, self).__init__(client=client)
self.service = "checkout"

def create_order(self, request, idempotency_key=None, **kwargs):
def orders(self, request, idempotency_key=None, **kwargs):
"""
Create an order
"""
endpoint = f"/orders"
endpoint = endpoint.replace('/', '', 1)
method = "POST"
return self.client.call_adyen_api(request, self.service, method, endpoint, idempotency_key, **kwargs)

Expand All @@ -26,7 +25,6 @@ def cancel_order(self, request, idempotency_key=None, **kwargs):
Cancel an order
"""
endpoint = f"/orders/cancel"
endpoint = endpoint.replace('/', '', 1)
method = "POST"
return self.client.call_adyen_api(request, self.service, method, endpoint, idempotency_key, **kwargs)

Expand All @@ -35,7 +33,6 @@ def get_balance_of_gift_card(self, request, idempotency_key=None, **kwargs):
Get the balance of a gift card
"""
endpoint = f"/paymentMethods/balance"
endpoint = endpoint.replace('/', '', 1)
method = "POST"
return self.client.call_adyen_api(request, self.service, method, endpoint, idempotency_key, **kwargs)

5 changes: 1 addition & 4 deletions Adyen/services/checkout/payment_links_api.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,6 @@ def get_payment_link(self, linkId, idempotency_key=None, **kwargs):
Get a payment link
"""
endpoint = f"/paymentLinks/{linkId}"
endpoint = endpoint.replace('/', '', 1)
method = "GET"
return self.client.call_adyen_api(None, self.service, method, endpoint, idempotency_key, **kwargs)

Expand All @@ -26,16 +25,14 @@ def update_payment_link(self, request, linkId, idempotency_key=None, **kwargs):
Update the status of a payment link
"""
endpoint = f"/paymentLinks/{linkId}"
endpoint = endpoint.replace('/', '', 1)
method = "PATCH"
return self.client.call_adyen_api(request, self.service, method, endpoint, idempotency_key, **kwargs)

def create_payment_link(self, request, idempotency_key=None, **kwargs):
def payment_links(self, request, idempotency_key=None, **kwargs):
"""
Create a payment link
"""
endpoint = f"/paymentLinks"
endpoint = endpoint.replace('/', '', 1)
method = "POST"
return self.client.call_adyen_api(request, self.service, method, endpoint, idempotency_key, **kwargs)

8 changes: 1 addition & 7 deletions Adyen/services/checkout/payments_api.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,12 +12,11 @@ def __init__(self, client=None):
super(PaymentsApi, self).__init__(client=client)
self.service = "checkout"

def list_brands_on_card(self, request, idempotency_key=None, **kwargs):
def card_details(self, request, idempotency_key=None, **kwargs):
"""
Get the list of brands on the card
"""
endpoint = f"/cardDetails"
endpoint = endpoint.replace('/', '', 1)
method = "POST"
return self.client.call_adyen_api(request, self.service, method, endpoint, idempotency_key, **kwargs)

Expand All @@ -26,7 +25,6 @@ def donations(self, request, idempotency_key=None, **kwargs):
Start a transaction for donations
"""
endpoint = f"/donations"
endpoint = endpoint.replace('/', '', 1)
method = "POST"
return self.client.call_adyen_api(request, self.service, method, endpoint, idempotency_key, **kwargs)

Expand All @@ -35,7 +33,6 @@ def payment_methods(self, request, idempotency_key=None, **kwargs):
Get a list of available payment methods
"""
endpoint = f"/paymentMethods"
endpoint = endpoint.replace('/', '', 1)
method = "POST"
return self.client.call_adyen_api(request, self.service, method, endpoint, idempotency_key, **kwargs)

Expand All @@ -44,7 +41,6 @@ def payments(self, request, idempotency_key=None, **kwargs):
Start a transaction
"""
endpoint = f"/payments"
endpoint = endpoint.replace('/', '', 1)
method = "POST"
return self.client.call_adyen_api(request, self.service, method, endpoint, idempotency_key, **kwargs)

Expand All @@ -53,7 +49,6 @@ def payments_details(self, request, idempotency_key=None, **kwargs):
Submit details for a payment
"""
endpoint = f"/payments/details"
endpoint = endpoint.replace('/', '', 1)
method = "POST"
return self.client.call_adyen_api(request, self.service, method, endpoint, idempotency_key, **kwargs)

Expand All @@ -62,7 +57,6 @@ def sessions(self, request, idempotency_key=None, **kwargs):
Create a payment session
"""
endpoint = f"/sessions"
endpoint = endpoint.replace('/', '', 1)
method = "POST"
return self.client.call_adyen_api(request, self.service, method, endpoint, idempotency_key, **kwargs)

2 changes: 0 additions & 2 deletions Adyen/services/checkout/recurring_api.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,6 @@ def delete_token_for_stored_payment_details(self, recurringId, idempotency_key=N
Delete a token for stored payment details
"""
endpoint = f"/storedPaymentMethods/{recurringId}"
endpoint = endpoint.replace('/', '', 1)
method = "DELETE"
return self.client.call_adyen_api(None, self.service, method, endpoint, idempotency_key, **kwargs)

Expand All @@ -26,7 +25,6 @@ def get_tokens_for_stored_payment_details(self, idempotency_key=None, **kwargs):
Get tokens for stored payment details
"""
endpoint = f"/storedPaymentMethods"
endpoint = endpoint.replace('/', '', 1)
method = "GET"
return self.client.call_adyen_api(None, self.service, method, endpoint, idempotency_key, **kwargs)

4 changes: 1 addition & 3 deletions Adyen/services/checkout/utility_api.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,16 +17,14 @@ def get_apple_pay_session(self, request, idempotency_key=None, **kwargs):
Get an Apple Pay session
"""
endpoint = f"/applePay/sessions"
endpoint = endpoint.replace('/', '', 1)
method = "POST"
return self.client.call_adyen_api(request, self.service, method, endpoint, idempotency_key, **kwargs)

def create_originkey_values_for_domains(self, request, idempotency_key=None, **kwargs):
def origin_keys(self, request, idempotency_key=None, **kwargs):
"""
Create originKey values for domains
"""
endpoint = f"/originKeys"
endpoint = endpoint.replace('/', '', 1)
method = "POST"
return self.client.call_adyen_api(request, self.service, method, endpoint, idempotency_key, **kwargs)

3 changes: 1 addition & 2 deletions Adyen/services/dataProtection.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,12 +12,11 @@ def __init__(self, client=None):
super(AdyenDataProtectionApi, self).__init__(client=client)
self.service = "dataProtection"

def submit_subject_erasure_request(self, request, idempotency_key=None, **kwargs):
def request_subject_erasure(self, request, idempotency_key=None, **kwargs):
"""
Submit a Subject Erasure Request.
"""
endpoint = f"/requestSubjectErasure"
endpoint = endpoint.replace('/', '', 1)
method = "POST"
return self.client.call_adyen_api(request, self.service, method, endpoint, idempotency_key, **kwargs)

10 changes: 0 additions & 10 deletions Adyen/services/legalEntityManagement/__init__.py
Original file line number Diff line number Diff line change
@@ -1,13 +1,3 @@
"""
Legal Entity Management API

The Legal Entity Management API enables you to manage legal entities that contain information required for verification. ## Authentication To connect to the Legal Entity Management API, you must use the basic authentication credentials of your web service user. If you don't have one, contact the [Adyen Support Team](https://www.adyen.help/hc/en-us/requests/new). Use the web service user credentials to authenticate your request, for example: ``` curl -U \"ws12345@Scope.BalancePlatform_YourBalancePlatform\":\"YourWsPassword\" \\ -H \"Content-Type: application/json\" \\ ... ``` Note that when going live, you need to generate new web service user credentials to access the [live endpoints](https://docs.adyen.com/development-resources/live-endpoints). ## Versioning The Legal Entity Management API supports versioning of its endpoints through a version suffix in the endpoint URL. This suffix has the following format: \"vXX\", where XX is the version number. For example: ``` https://kyc-test.adyen.com/lem/v2/legalEntities ``` ## Going live When going live, your Adyen contact will provide your API credential for the live environment. You can then use the username and password to send requests to `https://kyc-live.adyen.com/lem/v2`. # noqa: E501

The version of the OpenAPI document: 2
Contact: developer-experience@adyen.com
Generated by: https://openapi-generator.tech
"""

from ..base import AdyenServiceBase
from .business_lines_api import BusinessLinesApi
from .documents_api import DocumentsApi
Expand Down
25 changes: 8 additions & 17 deletions Adyen/services/legalEntityManagement/business_lines_api.py
Original file line number Diff line number Diff line change
@@ -1,13 +1,3 @@
"""
Legal Entity Management API

The Legal Entity Management API enables you to manage legal entities that contain information required for verification. ## Authentication To connect to the Legal Entity Management API, you must use the basic authentication credentials of your web service user. If you don't have one, contact the [Adyen Support Team](https://www.adyen.help/hc/en-us/requests/new). Use the web service user credentials to authenticate your request, for example: ``` curl -U \"ws12345@Scope.BalancePlatform_YourBalancePlatform\":\"YourWsPassword\" \\ -H \"Content-Type: application/json\" \\ ... ``` Note that when going live, you need to generate new web service user credentials to access the [live endpoints](https://docs.adyen.com/development-resources/live-endpoints). ## Versioning The Legal Entity Management API supports versioning of its endpoints through a version suffix in the endpoint URL. This suffix has the following format: \"vXX\", where XX is the version number. For example: ``` https://kyc-test.adyen.com/lem/v2/legalEntities ``` ## Going live When going live, your Adyen contact will provide your API credential for the live environment. You can then use the username and password to send requests to `https://kyc-live.adyen.com/lem/v2`. # noqa: E501

The version of the OpenAPI document: 2
Contact: developer-experience@adyen.com
Generated by: https://openapi-generator.tech
"""

from ..base import AdyenServiceBase


Expand All @@ -22,12 +12,19 @@ def __init__(self, client=None):
super(BusinessLinesApi, self).__init__(client=client)
self.service = "legalEntityManagement"

def delete_business_line(self, id, idempotency_key=None, **kwargs):
"""
Delete a business line
"""
endpoint = f"/businessLines/{id}"
method = "DELETE"
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 = f"/businessLines/{id}"
endpoint = endpoint.replace('/', '', 1)
method = "GET"
return self.client.call_adyen_api(None, self.service, method, endpoint, idempotency_key, **kwargs)

Expand All @@ -36,7 +33,6 @@ def update_business_line(self, request, id, idempotency_key=None, **kwargs):
Update a business line
"""
endpoint = f"/businessLines/{id}"
endpoint = endpoint.replace('/', '', 1)
method = "PATCH"
return self.client.call_adyen_api(request, self.service, method, endpoint, idempotency_key, **kwargs)

Expand All @@ -45,11 +41,6 @@ def create_business_line(self, request, idempotency_key=None, **kwargs):
Create a business line
"""
endpoint = f"/businessLines"
endpoint = endpoint.replace('/', '', 1)
method = "POST"
return self.client.call_adyen_api(request, self.service, method, endpoint, idempotency_key, **kwargs)





Loading