Skip to content
158 changes: 0 additions & 158 deletions Adyen/services/checkout.py

This file was deleted.

34 changes: 34 additions & 0 deletions Adyen/services/checkout/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
"""
Adyen Checkout API

Adyen Checkout API provides a simple and flexible way to initiate and authorise online payments. You can use the same integration for payments made with cards (including 3D Secure), mobile wallets, and local payment methods (for example, iDEAL and Sofort). This API reference provides information on available endpoints and how to interact with them. To learn more about the API, visit [online payments documentation](https://docs.adyen.com/online-payments). ## Authentication Each request to Checkout API must be signed with an API key. For this, [get your API key](https://docs.adyen.com/development-resources/api-credentials#generate-api-key) from your Customer Area, and set this key to the `X-API-Key` header value, for example: ``` curl -H \"Content-Type: application/json\" \\ -H \"X-API-Key: YOUR_API_KEY\" \\ ... ``` ## Versioning Checkout 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://checkout-test.adyen.com/v69/payments ``` ## Going live To access the live endpoints, you need an API key from your live Customer Area. The live endpoint URLs contain a prefix which is unique to your company account, for example: ``` https://{PREFIX}-checkout-live.adyenpayments.com/checkout/v69/payments ``` Get your `{PREFIX}` from your live Customer Area under **Developers** > **API URLs** > **Prefix**. When preparing to do live transactions with Checkout API, follow the [go-live checklist](https://docs.adyen.com/online-payments/go-live-checklist) to make sure you've got all the required configuration in place. ## Release notes Have a look at the [release notes](https://docs.adyen.com/online-payments/release-notes?integration_type=api&version=69) to find out what changed in this version! # noqa: E501

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

from ..base import AdyenServiceBase
from .classic_checkout_sdk_api import ClassicCheckoutSDKApi
from .modifications_api import ModificationsApi
from .orders_api import OrdersApi
from .payment_links_api import PaymentLinksApi
from .payments_api import PaymentsApi
from .utility_api import UtilityApi


class AdyenCheckoutApi(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(AdyenCheckoutApi, self).__init__(client=client)
self.classic_checkout_sdk_api = ClassicCheckoutSDKApi(client=client)
self.modifications_api = ModificationsApi(client=client)
self.orders_api = OrdersApi(client=client)
self.payment_links_api = PaymentLinksApi(client=client)
self.payments_api = PaymentsApi(client=client)
self.utility_api = UtilityApi(client=client)
32 changes: 32 additions & 0 deletions Adyen/services/checkout/classic_checkout_sdk_api.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
from ..base import AdyenServiceBase


class ClassicCheckoutSDKApi(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(ClassicCheckoutSDKApi, self).__init__(client=client)
self.service = "checkout"

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)

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)

68 changes: 68 additions & 0 deletions Adyen/services/checkout/modifications_api.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,68 @@
from ..base import AdyenServiceBase


class ModificationsApi(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(ModificationsApi, self).__init__(client=client)
self.service = "checkout"

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)

def update_authorised_amount(self, request, paymentPspReference, idempotency_key=None, **kwargs):
"""
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)

def cancel_authorised_payment_by_psp_reference(self, request, paymentPspReference, idempotency_key=None, **kwargs):
"""
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)

def capture_authorised_payment(self, request, paymentPspReference, idempotency_key=None, **kwargs):
"""
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)

def refund_captured_payment(self, request, paymentPspReference, idempotency_key=None, **kwargs):
"""
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)

def refund_or_cancel_payment(self, request, paymentPspReference, idempotency_key=None, **kwargs):
"""
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)

41 changes: 41 additions & 0 deletions Adyen/services/checkout/orders_api.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
from ..base import AdyenServiceBase


class OrdersApi(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(OrdersApi, self).__init__(client=client)
self.service = "checkout"

def create_order(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)

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)

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)

41 changes: 41 additions & 0 deletions Adyen/services/checkout/payment_links_api.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
from ..base import AdyenServiceBase


class PaymentLinksApi(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(PaymentLinksApi, self).__init__(client=client)
self.service = "checkout"

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)

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):
"""
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)

Loading