from ..base import AdyenServiceBase


class PaymentsApi(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(PaymentsApi, self).__init__(client=client)
        self.service = "payments"
        self.baseUrl = "https://pal-test.adyen.com/pal/servlet/Payment/v68"

    def authorise(self, request, idempotency_key=None, **kwargs):
        """
        Create an authorisation
        """
        endpoint = self.baseUrl + f"/authorise"
        method = "POST"
        return self.client.call_adyen_api(request, self.service, method, endpoint, idempotency_key, **kwargs)

    def authorise3d(self, request, idempotency_key=None, **kwargs):
        """
        Complete a 3DS authorisation
        """
        endpoint = self.baseUrl + f"/authorise3d"
        method = "POST"
        return self.client.call_adyen_api(request, self.service, method, endpoint, idempotency_key, **kwargs)

    def authorise3ds2(self, request, idempotency_key=None, **kwargs):
        """
        Complete a 3DS2 authorisation
        """
        endpoint = self.baseUrl + f"/authorise3ds2"
        method = "POST"
        return self.client.call_adyen_api(request, self.service, method, endpoint, idempotency_key, **kwargs)

    def get_authentication_result(self, request, idempotency_key=None, **kwargs):
        """
        Get the 3DS authentication result
        """
        endpoint = self.baseUrl + f"/getAuthenticationResult"
        method = "POST"
        return self.client.call_adyen_api(request, self.service, method, endpoint, idempotency_key, **kwargs)

    def retrieve3ds2_result(self, request, idempotency_key=None, **kwargs):
        """
        Get the 3DS2 authentication result
        """
        endpoint = self.baseUrl + f"/retrieve3ds2Result"
        method = "POST"
        return self.client.call_adyen_api(request, self.service, method, endpoint, idempotency_key, **kwargs)

