# This file was auto-generated by Fern from our API Definition.

import typing

from ..core.client_wrapper import AsyncClientWrapper, SyncClientWrapper
from ..core.request_options import RequestOptions
from ..types.account_id import AccountId
from ..types.ach_validation import AchValidation
from ..types.bill_data import BillData
from ..types.entrypointfield import Entrypointfield
from ..types.force_customer_creation import ForceCustomerCreation
from ..types.idempotency_key import IdempotencyKey
from ..types.ip_address import IpAddress
from ..types.order_id import OrderId
from ..types.orderdescription import Orderdescription
from ..types.payabli_api_response import PayabliApiResponse
from ..types.payabli_api_response_0 import PayabliApiResponse0
from ..types.payment_detail import PaymentDetail
from ..types.payment_detail_credit import PaymentDetailCredit
from ..types.payment_method import PaymentMethod
from ..types.payor_data_request import PayorDataRequest
from ..types.refund_detail import RefundDetail
from ..types.source import Source
from ..types.subdomain import Subdomain
from ..types.subscriptionid import Subscriptionid
from ..types.transaction_query_records_customer import TransactionQueryRecordsCustomer
from ..v_2_money_in_types.types.v_2_transaction_response_wrapper import V2TransactionResponseWrapper
from .raw_client import AsyncRawMoneyInClient, RawMoneyInClient
from .types.auth_response import AuthResponse
from .types.capture_payment_details import CapturePaymentDetails
from .types.capture_response import CaptureResponse
from .types.payabli_api_response_get_paid import PayabliApiResponseGetPaid
from .types.receipt_response import ReceiptResponse
from .types.refund_response import RefundResponse
from .types.refund_with_instructions_response import RefundWithInstructionsResponse
from .types.request_credit_payment_method import RequestCreditPaymentMethod
from .types.request_payment_validate_payment_method import RequestPaymentValidatePaymentMethod
from .types.reverse_response import ReverseResponse
from .types.validate_response import ValidateResponse
from .types.void_response import VoidResponse

# this is used as the default value for optional parameters
OMIT = typing.cast(typing.Any, ...)


class MoneyInClient:
    def __init__(self, *, client_wrapper: SyncClientWrapper):
        self._raw_client = RawMoneyInClient(client_wrapper=client_wrapper)

    @property
    def with_raw_response(self) -> RawMoneyInClient:
        """
        Retrieves a raw implementation of this client that returns raw responses.

        Returns
        -------
        RawMoneyInClient
        """
        return self._raw_client

    def authorize(
        self,
        *,
        payment_details: PaymentDetail,
        payment_method: PaymentMethod,
        force_customer_creation: typing.Optional[ForceCustomerCreation] = None,
        idempotency_key: typing.Optional[IdempotencyKey] = None,
        account_id: typing.Optional[AccountId] = OMIT,
        customer_data: typing.Optional[PayorDataRequest] = OMIT,
        entry_point: typing.Optional[Entrypointfield] = OMIT,
        invoice_data: typing.Optional[BillData] = OMIT,
        ipaddress: typing.Optional[IpAddress] = OMIT,
        order_description: typing.Optional[Orderdescription] = OMIT,
        order_id: typing.Optional[OrderId] = OMIT,
        source: typing.Optional[Source] = OMIT,
        subdomain: typing.Optional[Subdomain] = OMIT,
        subscription_id: typing.Optional[Subscriptionid] = OMIT,
        request_options: typing.Optional[RequestOptions] = None,
    ) -> AuthResponse:
        """
        Authorize a card transaction. This returns an authorization code and reserves funds for the merchant. Authorized transactions aren't flagged for settlement until [captured](/developers/api-reference/moneyin/capture-an-authorized-transaction).
        Only card transactions can be authorized. This endpoint can't be used for ACH transactions.
        <Tip>
          Consider migrating to the [v2 Authorize endpoint](/developers/api-reference/moneyinV2/authorize-a-transaction) to take advantage of unified response codes and improved response consistency.
        </Tip>

        Parameters
        ----------
        payment_details : PaymentDetail
            Object describing details of the payment. Required.

        payment_method : PaymentMethod
            Information about the payment method for the transaction. Required and recommended fields for each payment method type are described in each schema below.

        force_customer_creation : typing.Optional[ForceCustomerCreation]

        idempotency_key : typing.Optional[IdempotencyKey]

        account_id : typing.Optional[AccountId]

        customer_data : typing.Optional[PayorDataRequest]
            Object describing the Customer/Payor. Which fields are required depends on the paypoint's custom identifier settings.

        entry_point : typing.Optional[Entrypointfield]

        invoice_data : typing.Optional[BillData]
            Object describing an Invoice linked to the transaction.

        ipaddress : typing.Optional[IpAddress]

        order_description : typing.Optional[Orderdescription]

        order_id : typing.Optional[OrderId]

        source : typing.Optional[Source]

        subdomain : typing.Optional[Subdomain]

        subscription_id : typing.Optional[Subscriptionid]

        request_options : typing.Optional[RequestOptions]
            Request-specific configuration.

        Returns
        -------
        AuthResponse
            Ok

        Examples
        --------
        from payabli import PaymentDetail, PayMethodCredit, PayorDataRequest, payabli

        client = payabli(
            api_key="YOUR_API_KEY",
        )
        client.money_in.authorize(
            customer_data=PayorDataRequest(
                customer_id=4440,
            ),
            entry_point="f743aed24a",
            ipaddress="255.255.255.255",
            payment_details=PaymentDetail(
                service_fee=0.0,
                total_amount=100.0,
            ),
            payment_method=PayMethodCredit(
                cardcvv="999",
                cardexp="02/27",
                card_holder="John Cassian",
                cardnumber="4111111111111111",
                cardzip="12345",
                initiator="payor",
            ),
        )
        """
        _response = self._raw_client.authorize(
            payment_details=payment_details,
            payment_method=payment_method,
            force_customer_creation=force_customer_creation,
            idempotency_key=idempotency_key,
            account_id=account_id,
            customer_data=customer_data,
            entry_point=entry_point,
            invoice_data=invoice_data,
            ipaddress=ipaddress,
            order_description=order_description,
            order_id=order_id,
            source=source,
            subdomain=subdomain,
            subscription_id=subscription_id,
            request_options=request_options,
        )
        return _response.data

    def capture(
        self, trans_id: str, amount: float, *, request_options: typing.Optional[RequestOptions] = None
    ) -> CaptureResponse:
        """
        <Warning>
          This endpoint is deprecated and will be sunset on November 24, 2025. Migrate to [POST `/capture/{transId}`](/developers/api-reference/moneyin/capture-an-authorized-transaction)`.
        </Warning>

          Capture an [authorized
        transaction](/developers/api-reference/moneyin/authorize-a-transaction) to complete the transaction and move funds from the customer to merchant account.

        Parameters
        ----------
        trans_id : str
            ReferenceId for the transaction (PaymentId).

        amount : float
            Amount to be captured. The amount can't be greater the original total amount of the transaction. `0` captures the total amount authorized in the transaction. Partial captures aren't supported.

        request_options : typing.Optional[RequestOptions]
            Request-specific configuration.

        Returns
        -------
        CaptureResponse
            Ok

        Examples
        --------
        from payabli import payabli

        client = payabli(
            api_key="YOUR_API_KEY",
        )
        client.money_in.capture(
            trans_id="10-7d9cd67d-2d5d-4cd7-a1b7-72b8b201ec13",
            amount=0.0,
        )
        """
        _response = self._raw_client.capture(trans_id, amount, request_options=request_options)
        return _response.data

    def capture_auth(
        self,
        trans_id: str,
        *,
        payment_details: CapturePaymentDetails,
        request_options: typing.Optional[RequestOptions] = None,
    ) -> CaptureResponse:
        """
        Capture an [authorized transaction](/developers/api-reference/moneyin/authorize-a-transaction) to complete the transaction and move funds from the customer to merchant account.

        You can use this endpoint to capture both full and partial amounts of the original authorized transaction. See [Capture an authorized transaction](/developers/developer-guides/pay-in-auth-and-capture) for more information about this endpoint.

        <Tip>
        Consider migrating to the [v2 Capture endpoint](/developers/api-reference/moneyinV2/capture-an-authorized-transaction) to take advantage of unified response codes and improved response consistency.
        </Tip>

        Parameters
        ----------
        trans_id : str
            ReferenceId for the transaction (PaymentId).

        payment_details : CapturePaymentDetails

        request_options : typing.Optional[RequestOptions]
            Request-specific configuration.

        Returns
        -------
        CaptureResponse
            Ok

        Examples
        --------
        from payabli import payabli
        from payabli.money_in import CapturePaymentDetails

        client = payabli(
            api_key="YOUR_API_KEY",
        )
        client.money_in.capture_auth(
            trans_id="10-7d9cd67d-2d5d-4cd7-a1b7-72b8b201ec13",
            payment_details=CapturePaymentDetails(
                total_amount=105.0,
                service_fee=5.0,
            ),
        )
        """
        _response = self._raw_client.capture_auth(
            trans_id, payment_details=payment_details, request_options=request_options
        )
        return _response.data

    def credit(
        self,
        *,
        customer_data: PayorDataRequest,
        payment_details: PaymentDetailCredit,
        payment_method: RequestCreditPaymentMethod,
        force_customer_creation: typing.Optional[ForceCustomerCreation] = None,
        idempotency_key: typing.Optional[IdempotencyKey] = None,
        account_id: typing.Optional[AccountId] = OMIT,
        entrypoint: typing.Optional[Entrypointfield] = OMIT,
        order_description: typing.Optional[Orderdescription] = OMIT,
        order_id: typing.Optional[OrderId] = OMIT,
        source: typing.Optional[Source] = OMIT,
        subdomain: typing.Optional[Subdomain] = OMIT,
        request_options: typing.Optional[RequestOptions] = None,
    ) -> PayabliApiResponse0:
        """
        Make a temporary microdeposit in a customer account to verify the customer's ownership and access to the target account. Reverse the microdeposit with `reverseCredit`. Payabli doesn't automatically make microdeposits when you add a bank account, you must manually make the requests.

        This feature must be enabled by Payabli on a per-merchant basis. Contact support for help.

        Parameters
        ----------
        customer_data : PayorDataRequest
            Object describing the customer/payor.

        payment_details : PaymentDetailCredit

        payment_method : RequestCreditPaymentMethod
            Object describing the ACH payment method to use for transaction.

        force_customer_creation : typing.Optional[ForceCustomerCreation]

        idempotency_key : typing.Optional[IdempotencyKey]

        account_id : typing.Optional[AccountId]

        entrypoint : typing.Optional[Entrypointfield]

        order_description : typing.Optional[Orderdescription]

        order_id : typing.Optional[OrderId]

        source : typing.Optional[Source]

        subdomain : typing.Optional[Subdomain]

        request_options : typing.Optional[RequestOptions]
            Request-specific configuration.

        Returns
        -------
        PayabliApiResponse0
            Success. The `referenceId` returned in a successful response is the `transId` value you need to reverse the microdeposit.

            A "Missing Gateway Data" message can indicate that the entrypoint targeted in the request isn't set up for ACH payments.

        Examples
        --------
        from payabli import PaymentDetailCredit, PayorDataRequest, payabli
        from payabli.money_in import RequestCreditPaymentMethod

        client = payabli(
            api_key="YOUR_API_KEY",
        )
        client.money_in.credit(
            idempotency_key="6B29FC40-CA47-1067-B31D-00DD010662DA",
            customer_data=PayorDataRequest(
                billing_address_1="5127 Linkwood ave",
                customer_number="100",
            ),
            entrypoint="my-entrypoint",
            payment_details=PaymentDetailCredit(
                service_fee=0.0,
                total_amount=1.0,
            ),
            payment_method=RequestCreditPaymentMethod(
                ach_account="88354454",
                ach_account_type="Checking",
                ach_holder="John Smith",
                ach_routing="021000021",
            ),
        )
        """
        _response = self._raw_client.credit(
            customer_data=customer_data,
            payment_details=payment_details,
            payment_method=payment_method,
            force_customer_creation=force_customer_creation,
            idempotency_key=idempotency_key,
            account_id=account_id,
            entrypoint=entrypoint,
            order_description=order_description,
            order_id=order_id,
            source=source,
            subdomain=subdomain,
            request_options=request_options,
        )
        return _response.data

    def details(
        self, trans_id: str, *, request_options: typing.Optional[RequestOptions] = None
    ) -> TransactionQueryRecordsCustomer:
        """
        Retrieve a processed transaction's details.

        Parameters
        ----------
        trans_id : str
            ReferenceId for the transaction (PaymentId).

        request_options : typing.Optional[RequestOptions]
            Request-specific configuration.

        Returns
        -------
        TransactionQueryRecordsCustomer
            Success

        Examples
        --------
        from payabli import payabli

        client = payabli(
            api_key="YOUR_API_KEY",
        )
        client.money_in.details(
            trans_id="45-as456777hhhhhhhhhh77777777-324",
        )
        """
        _response = self._raw_client.details(trans_id, request_options=request_options)
        return _response.data

    def getpaid(
        self,
        *,
        payment_details: PaymentDetail,
        payment_method: PaymentMethod,
        ach_validation: typing.Optional[AchValidation] = None,
        force_customer_creation: typing.Optional[ForceCustomerCreation] = None,
        include_details: typing.Optional[bool] = None,
        idempotency_key: typing.Optional[IdempotencyKey] = None,
        validation_code: typing.Optional[str] = None,
        account_id: typing.Optional[AccountId] = OMIT,
        customer_data: typing.Optional[PayorDataRequest] = OMIT,
        entry_point: typing.Optional[Entrypointfield] = OMIT,
        invoice_data: typing.Optional[BillData] = OMIT,
        ipaddress: typing.Optional[IpAddress] = OMIT,
        order_description: typing.Optional[Orderdescription] = OMIT,
        order_id: typing.Optional[OrderId] = OMIT,
        source: typing.Optional[Source] = OMIT,
        subdomain: typing.Optional[Subdomain] = OMIT,
        subscription_id: typing.Optional[Subscriptionid] = OMIT,
        request_options: typing.Optional[RequestOptions] = None,
    ) -> PayabliApiResponseGetPaid:
        """
        Make a single transaction. This method authorizes and captures a payment in one step.

          <Tip>
          Consider migrating to the [v2 Make a transaction endpoint](/developers/api-reference/moneyinV2/make-a-transaction) to take advantage of unified response codes and improved response consistency.
          </Tip>

        Parameters
        ----------
        payment_details : PaymentDetail
            Object describing details of the payment. Required.

        payment_method : PaymentMethod
            Information about the payment method for the transaction. Required and recommended fields for each payment method type are described in each schema below.

        ach_validation : typing.Optional[AchValidation]

        force_customer_creation : typing.Optional[ForceCustomerCreation]

        include_details : typing.Optional[bool]
            When `true`, transactionDetails object is returned in the response. See a full example of the `transactionDetails` object in the [Transaction integration guide](/developers/developer-guides/money-in-transaction-add#includedetailstrue-response).

        idempotency_key : typing.Optional[IdempotencyKey]

        validation_code : typing.Optional[str]
            Value obtained from user when an API generated CAPTCHA is used in payment page

        account_id : typing.Optional[AccountId]

        customer_data : typing.Optional[PayorDataRequest]
            Object describing the Customer/Payor. Which fields are required depends on the paypoint's custom identifier settings.

        entry_point : typing.Optional[Entrypointfield]

        invoice_data : typing.Optional[BillData]
            Object describing an Invoice linked to the transaction.

        ipaddress : typing.Optional[IpAddress]

        order_description : typing.Optional[Orderdescription]

        order_id : typing.Optional[OrderId]

        source : typing.Optional[Source]

        subdomain : typing.Optional[Subdomain]

        subscription_id : typing.Optional[Subscriptionid]

        request_options : typing.Optional[RequestOptions]
            Request-specific configuration.

        Returns
        -------
        PayabliApiResponseGetPaid
            Ok

        Examples
        --------
        from payabli import PaymentDetail, PayMethodCredit, PayorDataRequest, payabli

        client = payabli(
            api_key="YOUR_API_KEY",
        )
        client.money_in.getpaid(
            customer_data=PayorDataRequest(
                customer_id=4440,
            ),
            entry_point="f743aed24a",
            ipaddress="255.255.255.255",
            payment_details=PaymentDetail(
                service_fee=0.0,
                total_amount=100.0,
            ),
            payment_method=PayMethodCredit(
                cardcvv="999",
                cardexp="02/27",
                card_holder="John Cassian",
                cardnumber="4111111111111111",
                cardzip="12345",
                initiator="payor",
            ),
        )
        """
        _response = self._raw_client.getpaid(
            payment_details=payment_details,
            payment_method=payment_method,
            ach_validation=ach_validation,
            force_customer_creation=force_customer_creation,
            include_details=include_details,
            idempotency_key=idempotency_key,
            validation_code=validation_code,
            account_id=account_id,
            customer_data=customer_data,
            entry_point=entry_point,
            invoice_data=invoice_data,
            ipaddress=ipaddress,
            order_description=order_description,
            order_id=order_id,
            source=source,
            subdomain=subdomain,
            subscription_id=subscription_id,
            request_options=request_options,
        )
        return _response.data

    def reverse(
        self, trans_id: str, amount: float, *, request_options: typing.Optional[RequestOptions] = None
    ) -> ReverseResponse:
        """
        A reversal either refunds or voids a transaction independent of the transaction's settlement status. Send a reversal request for a transaction, and Payabli automatically determines whether it's a refund or void. You don't need to know whether the transaction is settled or not.

        Parameters
        ----------
        trans_id : str
            ReferenceId for the transaction (PaymentId).

        amount : float

            Amount to reverse from original transaction, minus any service fees charged on the original transaction.

            The amount provided can't be greater than the original total amount of the transaction, minus service fees. For example, if a transaction was $90 plus a $10 service fee, you can reverse up to $90.

            An amount equal to zero will refunds the total amount authorized minus any service fee.

        request_options : typing.Optional[RequestOptions]
            Request-specific configuration.

        Returns
        -------
        ReverseResponse
            Ok

        Examples
        --------
        from payabli import payabli

        client = payabli(
            api_key="YOUR_API_KEY",
        )
        client.money_in.reverse(
            amount=0.0,
            trans_id="10-3ffa27df-b171-44e0-b251-e95fbfc7a723",
        )
        """
        _response = self._raw_client.reverse(trans_id, amount, request_options=request_options)
        return _response.data

    def refund(
        self, trans_id: str, amount: float, *, request_options: typing.Optional[RequestOptions] = None
    ) -> RefundResponse:
        """
        Refund a transaction that has settled and send money back to the account holder. If a transaction hasn't been settled, void it instead.

          <Tip>
          Consider migrating to the [v2 Refund endpoint](/developers/api-reference/moneyinV2/refund-a-settled-transaction) to take advantage of unified response codes and improved response consistency.
          </Tip>

        Parameters
        ----------
        trans_id : str
            ReferenceId for the transaction (PaymentId).

        amount : float

            Amount to refund from original transaction, minus any service fees charged on the original transaction.

            The amount provided can't be greater than the original total amount of the transaction, minus service fees. For example, if a transaction was \\$90 plus a \\$10 service fee, you can refund up to \\$90.

            An amount equal to zero will refund the total amount authorized minus any service fee.

        request_options : typing.Optional[RequestOptions]
            Request-specific configuration.

        Returns
        -------
        RefundResponse
            Ok

        Examples
        --------
        from payabli import payabli

        client = payabli(
            api_key="YOUR_API_KEY",
        )
        client.money_in.refund(
            amount=0.0,
            trans_id="10-3ffa27df-b171-44e0-b251-e95fbfc7a723",
        )
        """
        _response = self._raw_client.refund(trans_id, amount, request_options=request_options)
        return _response.data

    def refund_with_instructions(
        self,
        trans_id: str,
        *,
        idempotency_key: typing.Optional[IdempotencyKey] = None,
        amount: typing.Optional[float] = OMIT,
        ipaddress: typing.Optional[IpAddress] = OMIT,
        order_description: typing.Optional[Orderdescription] = OMIT,
        order_id: typing.Optional[OrderId] = OMIT,
        refund_details: typing.Optional[RefundDetail] = OMIT,
        source: typing.Optional[Source] = OMIT,
        request_options: typing.Optional[RequestOptions] = None,
    ) -> RefundWithInstructionsResponse:
        """
        Refunds a settled transaction with split instructions.

        Parameters
        ----------
        trans_id : str
            ReferenceId for the transaction (PaymentId).

        idempotency_key : typing.Optional[IdempotencyKey]

        amount : typing.Optional[float]

            Amount to refund from original transaction, minus any service fees charged on the original transaction.

            The amount provided can't be greater than the original total amount of the transaction, minus service fees. For example, if a transaction was $90 plus a $10 service fee, you can refund up to $90.

            An amount equal to zero will refund the total amount authorized minus any service fee.

        ipaddress : typing.Optional[IpAddress]

        order_description : typing.Optional[Orderdescription]

        order_id : typing.Optional[OrderId]

        refund_details : typing.Optional[RefundDetail]

        source : typing.Optional[Source]

        request_options : typing.Optional[RequestOptions]
            Request-specific configuration.

        Returns
        -------
        RefundWithInstructionsResponse
            Success

        Examples
        --------
        from payabli import RefundDetail, SplitFundingRefundContent, payabli

        client = payabli(
            api_key="YOUR_API_KEY",
        )
        client.money_in.refund_with_instructions(
            trans_id="10-3ffa27df-b171-44e0-b251-e95fbfc7a723",
            idempotency_key="8A29FC40-CA47-1067-B31D-00DD010662DB",
            source="api",
            order_description="Materials deposit",
            amount=100.0,
            refund_details=RefundDetail(
                split_refunding=[
                    SplitFundingRefundContent(
                        origination_entry_point="7f1a381696",
                        account_id="187-342",
                        description="Refunding undelivered materials",
                        amount=60.0,
                    ),
                    SplitFundingRefundContent(
                        origination_entry_point="7f1a381696",
                        account_id="187-343",
                        description="Refunding deposit for undelivered materials",
                        amount=40.0,
                    ),
                ],
            ),
        )
        """
        _response = self._raw_client.refund_with_instructions(
            trans_id,
            idempotency_key=idempotency_key,
            amount=amount,
            ipaddress=ipaddress,
            order_description=order_description,
            order_id=order_id,
            refund_details=refund_details,
            source=source,
            request_options=request_options,
        )
        return _response.data

    def reverse_credit(
        self, trans_id: str, *, request_options: typing.Optional[RequestOptions] = None
    ) -> PayabliApiResponse:
        """
        Reverse microdeposits that are used to verify customer account ownership and access. The `transId` value is returned in the success response for the original credit transaction made with `api/MoneyIn/makecredit`.

        Parameters
        ----------
        trans_id : str
            ReferenceId for the transaction (PaymentId).

        request_options : typing.Optional[RequestOptions]
            Request-specific configuration.

        Returns
        -------
        PayabliApiResponse
            Success

        Examples
        --------
        from payabli import payabli

        client = payabli(
            api_key="YOUR_API_KEY",
        )
        client.money_in.reverse_credit(
            trans_id="45-as456777hhhhhhhhhh77777777-324",
        )
        """
        _response = self._raw_client.reverse_credit(trans_id, request_options=request_options)
        return _response.data

    def send_receipt_2_trans(
        self,
        trans_id: str,
        *,
        email: typing.Optional[str] = None,
        request_options: typing.Optional[RequestOptions] = None,
    ) -> ReceiptResponse:
        """
        Send a payment receipt for a transaction.

        Parameters
        ----------
        trans_id : str
            ReferenceId for the transaction (PaymentId).

        email : typing.Optional[str]
            Email address where the payment receipt should be sent.

            If not provided, the email address on file for the user owner of the transaction is used.

        request_options : typing.Optional[RequestOptions]
            Request-specific configuration.

        Returns
        -------
        ReceiptResponse
            Success

        Examples
        --------
        from payabli import payabli

        client = payabli(
            api_key="YOUR_API_KEY",
        )
        client.money_in.send_receipt_2_trans(
            trans_id="45-as456777hhhhhhhhhh77777777-324",
            email="example@email.com",
        )
        """
        _response = self._raw_client.send_receipt_2_trans(trans_id, email=email, request_options=request_options)
        return _response.data

    def validate(
        self,
        *,
        entry_point: Entrypointfield,
        payment_method: RequestPaymentValidatePaymentMethod,
        idempotency_key: typing.Optional[IdempotencyKey] = None,
        account_id: typing.Optional[AccountId] = OMIT,
        order_description: typing.Optional[Orderdescription] = OMIT,
        order_id: typing.Optional[OrderId] = OMIT,
        request_options: typing.Optional[RequestOptions] = None,
    ) -> ValidateResponse:
        """
        Validates a card number without running a transaction or authorizing a charge.

        Parameters
        ----------
        entry_point : Entrypointfield

        payment_method : RequestPaymentValidatePaymentMethod
            Object describing payment method to use for transaction.

        idempotency_key : typing.Optional[IdempotencyKey]

        account_id : typing.Optional[AccountId]

        order_description : typing.Optional[Orderdescription]

        order_id : typing.Optional[OrderId]

        request_options : typing.Optional[RequestOptions]
            Request-specific configuration.

        Returns
        -------
        ValidateResponse
            Ok

        Examples
        --------
        from payabli import payabli
        from payabli.money_in import RequestPaymentValidatePaymentMethod

        client = payabli(
            api_key="YOUR_API_KEY",
        )
        client.money_in.validate(
            idempotency_key="6B29FC40-CA47-1067-B31D-00DD010662DA",
            entry_point="entry132",
            payment_method=RequestPaymentValidatePaymentMethod(
                method="card",
                cardnumber="4360000001000005",
                cardexp="12/29",
                cardzip="14602-8328",
                card_holder="Dianne Becker-Smith",
            ),
        )
        """
        _response = self._raw_client.validate(
            entry_point=entry_point,
            payment_method=payment_method,
            idempotency_key=idempotency_key,
            account_id=account_id,
            order_description=order_description,
            order_id=order_id,
            request_options=request_options,
        )
        return _response.data

    def void(self, trans_id: str, *, request_options: typing.Optional[RequestOptions] = None) -> VoidResponse:
        """
        Cancel a transaction that hasn't been settled yet. Voiding non-captured authorizations prevents future captures. If a transaction has been settled, refund it instead.

          <Tip>
          Consider migrating to the [v2 Void endpoint](/developers/api-reference/moneyinV2/void-a-transaction) to take advantage of unified response codes and improved response consistency.
          </Tip>

        Parameters
        ----------
        trans_id : str
            ReferenceId for the transaction (PaymentId).

        request_options : typing.Optional[RequestOptions]
            Request-specific configuration.

        Returns
        -------
        VoidResponse
            Ok

        Examples
        --------
        from payabli import payabli

        client = payabli(
            api_key="YOUR_API_KEY",
        )
        client.money_in.void(
            trans_id="10-3ffa27df-b171-44e0-b251-e95fbfc7a723",
        )
        """
        _response = self._raw_client.void(trans_id, request_options=request_options)
        return _response.data

    def getpaidv_2(
        self,
        *,
        payment_details: PaymentDetail,
        payment_method: PaymentMethod,
        ach_validation: typing.Optional[AchValidation] = None,
        force_customer_creation: typing.Optional[ForceCustomerCreation] = None,
        idempotency_key: typing.Optional[IdempotencyKey] = None,
        validation_code: typing.Optional[str] = None,
        account_id: typing.Optional[AccountId] = OMIT,
        customer_data: typing.Optional[PayorDataRequest] = OMIT,
        entry_point: typing.Optional[Entrypointfield] = OMIT,
        invoice_data: typing.Optional[BillData] = OMIT,
        ipaddress: typing.Optional[IpAddress] = OMIT,
        order_description: typing.Optional[Orderdescription] = OMIT,
        order_id: typing.Optional[OrderId] = OMIT,
        source: typing.Optional[Source] = OMIT,
        subdomain: typing.Optional[Subdomain] = OMIT,
        subscription_id: typing.Optional[Subscriptionid] = OMIT,
        request_options: typing.Optional[RequestOptions] = None,
    ) -> V2TransactionResponseWrapper:
        """
        Make a single transaction. This method authorizes and captures a payment in one step. This is the v2 version of the `api/MoneyIn/getpaid` endpoint, and returns the unified response format. See [Pay In unified response codes reference](/guides/pay-in-unified-response-codes-reference) for more information.

        Parameters
        ----------
        payment_details : PaymentDetail
            Object describing details of the payment. Required.

        payment_method : PaymentMethod
            Information about the payment method for the transaction. Required and recommended fields for each payment method type are described in each schema below.

        ach_validation : typing.Optional[AchValidation]

        force_customer_creation : typing.Optional[ForceCustomerCreation]

        idempotency_key : typing.Optional[IdempotencyKey]

        validation_code : typing.Optional[str]
            Value obtained from user when an API generated CAPTCHA is used in payment page

        account_id : typing.Optional[AccountId]

        customer_data : typing.Optional[PayorDataRequest]
            Object describing the Customer/Payor. Which fields are required depends on the paypoint's custom identifier settings.

        entry_point : typing.Optional[Entrypointfield]

        invoice_data : typing.Optional[BillData]
            Object describing an Invoice linked to the transaction.

        ipaddress : typing.Optional[IpAddress]

        order_description : typing.Optional[Orderdescription]

        order_id : typing.Optional[OrderId]

        source : typing.Optional[Source]

        subdomain : typing.Optional[Subdomain]

        subscription_id : typing.Optional[Subscriptionid]

        request_options : typing.Optional[RequestOptions]
            Request-specific configuration.

        Returns
        -------
        V2TransactionResponseWrapper
            Ok

        Examples
        --------
        from payabli import PaymentDetail, PayMethodCredit, PayorDataRequest, payabli

        client = payabli(
            api_key="YOUR_API_KEY",
        )
        client.money_in.getpaidv_2(
            customer_data=PayorDataRequest(
                customer_id=4440,
            ),
            entry_point="f743aed24a",
            ipaddress="255.255.255.255",
            payment_details=PaymentDetail(
                service_fee=0.0,
                total_amount=100.0,
            ),
            payment_method=PayMethodCredit(
                cardcvv="999",
                cardexp="02/27",
                card_holder="John Cassian",
                cardnumber="4111111111111111",
                cardzip="12345",
                initiator="payor",
            ),
        )
        """
        _response = self._raw_client.getpaidv_2(
            payment_details=payment_details,
            payment_method=payment_method,
            ach_validation=ach_validation,
            force_customer_creation=force_customer_creation,
            idempotency_key=idempotency_key,
            validation_code=validation_code,
            account_id=account_id,
            customer_data=customer_data,
            entry_point=entry_point,
            invoice_data=invoice_data,
            ipaddress=ipaddress,
            order_description=order_description,
            order_id=order_id,
            source=source,
            subdomain=subdomain,
            subscription_id=subscription_id,
            request_options=request_options,
        )
        return _response.data

    def authorizev_2(
        self,
        *,
        payment_details: PaymentDetail,
        payment_method: PaymentMethod,
        force_customer_creation: typing.Optional[ForceCustomerCreation] = None,
        idempotency_key: typing.Optional[IdempotencyKey] = None,
        account_id: typing.Optional[AccountId] = OMIT,
        customer_data: typing.Optional[PayorDataRequest] = OMIT,
        entry_point: typing.Optional[Entrypointfield] = OMIT,
        invoice_data: typing.Optional[BillData] = OMIT,
        ipaddress: typing.Optional[IpAddress] = OMIT,
        order_description: typing.Optional[Orderdescription] = OMIT,
        order_id: typing.Optional[OrderId] = OMIT,
        source: typing.Optional[Source] = OMIT,
        subdomain: typing.Optional[Subdomain] = OMIT,
        subscription_id: typing.Optional[Subscriptionid] = OMIT,
        request_options: typing.Optional[RequestOptions] = None,
    ) -> V2TransactionResponseWrapper:
        """
        Authorize a card transaction. This returns an authorization code and reserves funds for the merchant. Authorized transactions aren't flagged for settlement until captured. This is the v2 version of the `api/MoneyIn/authorize` endpoint, and returns the unified response format. See [Pay In unified response codes reference](/guides/pay-in-unified-response-codes-reference) for more information.

        **Note**: Only card transactions can be authorized. This endpoint can't be used for ACH transactions.

        Parameters
        ----------
        payment_details : PaymentDetail
            Object describing details of the payment. Required.

        payment_method : PaymentMethod
            Information about the payment method for the transaction. Required and recommended fields for each payment method type are described in each schema below.

        force_customer_creation : typing.Optional[ForceCustomerCreation]

        idempotency_key : typing.Optional[IdempotencyKey]

        account_id : typing.Optional[AccountId]

        customer_data : typing.Optional[PayorDataRequest]
            Object describing the Customer/Payor. Which fields are required depends on the paypoint's custom identifier settings.

        entry_point : typing.Optional[Entrypointfield]

        invoice_data : typing.Optional[BillData]
            Object describing an Invoice linked to the transaction.

        ipaddress : typing.Optional[IpAddress]

        order_description : typing.Optional[Orderdescription]

        order_id : typing.Optional[OrderId]

        source : typing.Optional[Source]

        subdomain : typing.Optional[Subdomain]

        subscription_id : typing.Optional[Subscriptionid]

        request_options : typing.Optional[RequestOptions]
            Request-specific configuration.

        Returns
        -------
        V2TransactionResponseWrapper
            Ok

        Examples
        --------
        from payabli import PaymentDetail, PayMethodCredit, PayorDataRequest, payabli

        client = payabli(
            api_key="YOUR_API_KEY",
        )
        client.money_in.authorizev_2(
            customer_data=PayorDataRequest(
                customer_id=4440,
            ),
            entry_point="f743aed24a",
            ipaddress="255.255.255.255",
            payment_details=PaymentDetail(
                service_fee=0.0,
                total_amount=100.0,
            ),
            payment_method=PayMethodCredit(
                cardcvv="999",
                cardexp="02/27",
                card_holder="John Cassian",
                cardnumber="4111111111111111",
                cardzip="12345",
                initiator="payor",
            ),
        )
        """
        _response = self._raw_client.authorizev_2(
            payment_details=payment_details,
            payment_method=payment_method,
            force_customer_creation=force_customer_creation,
            idempotency_key=idempotency_key,
            account_id=account_id,
            customer_data=customer_data,
            entry_point=entry_point,
            invoice_data=invoice_data,
            ipaddress=ipaddress,
            order_description=order_description,
            order_id=order_id,
            source=source,
            subdomain=subdomain,
            subscription_id=subscription_id,
            request_options=request_options,
        )
        return _response.data

    def capturev_2(
        self,
        trans_id: str,
        *,
        payment_details: CapturePaymentDetails,
        request_options: typing.Optional[RequestOptions] = None,
    ) -> V2TransactionResponseWrapper:
        """
        Capture an authorized transaction to complete the transaction and move funds from the customer to merchant account. This is the v2 version of the `api/MoneyIn/capture/{transId}` endpoint, and returns the unified response format. See [Pay In unified response codes reference](/guides/pay-in-unified-response-codes-reference) for more information.

        Parameters
        ----------
        trans_id : str
            ReferenceId for the transaction (PaymentId).

        payment_details : CapturePaymentDetails

        request_options : typing.Optional[RequestOptions]
            Request-specific configuration.

        Returns
        -------
        V2TransactionResponseWrapper
            Ok

        Examples
        --------
        from payabli import payabli
        from payabli.money_in import CapturePaymentDetails

        client = payabli(
            api_key="YOUR_API_KEY",
        )
        client.money_in.capturev_2(
            trans_id="10-7d9cd67d-2d5d-4cd7-a1b7-72b8b201ec13",
            payment_details=CapturePaymentDetails(
                total_amount=105.0,
                service_fee=5.0,
            ),
        )
        """
        _response = self._raw_client.capturev_2(
            trans_id, payment_details=payment_details, request_options=request_options
        )
        return _response.data

    def refundv_2(
        self, trans_id: str, *, request_options: typing.Optional[RequestOptions] = None
    ) -> V2TransactionResponseWrapper:
        """
        Give a full refund for a transaction that has settled and send money back to the account holder. To perform a partial refund, see [Partially refund a transaction](developers/api-reference/moneyinV2/partial-refund-a-settled-transaction).

        This is the v2 version of the refund endpoint, and returns the unified response format. See [Pay In unified response codes reference](/guides/pay-in-unified-response-codes-reference) for more information.

        Parameters
        ----------
        trans_id : str
            ReferenceId for the transaction (PaymentId).

        request_options : typing.Optional[RequestOptions]
            Request-specific configuration.

        Returns
        -------
        V2TransactionResponseWrapper
            Ok

        Examples
        --------
        from payabli import payabli

        client = payabli(
            api_key="YOUR_API_KEY",
        )
        client.money_in.refundv_2(
            trans_id="10-3ffa27df-b171-44e0-b251-e95fbfc7a723",
        )
        """
        _response = self._raw_client.refundv_2(trans_id, request_options=request_options)
        return _response.data

    def refundv_2_amount(
        self, trans_id: str, amount: float, *, request_options: typing.Optional[RequestOptions] = None
    ) -> V2TransactionResponseWrapper:
        """
        Refund a transaction that has settled and send money back to the account holder. If `amount` is omitted or set to 0, performs a full refund. When a non-zero `amount` is provided, this endpoint performs a partial refund.

        This is the v2 version of the refund endpoint, and returns the unified response format. See [Pay In unified response codes reference](/guides/pay-in-unified-response-codes-reference) for more information.

        Parameters
        ----------
        trans_id : str
            ReferenceId for the transaction (PaymentId).

        amount : float
            Amount to refund from original transaction, minus any service fees charged on the original transaction. If omitted or set to 0, performs a full refund.

        request_options : typing.Optional[RequestOptions]
            Request-specific configuration.

        Returns
        -------
        V2TransactionResponseWrapper
            Ok

        Examples
        --------
        from payabli import payabli

        client = payabli(
            api_key="YOUR_API_KEY",
        )
        client.money_in.refundv_2_amount(
            trans_id="10-3ffa27df-b171-44e0-b251-e95fbfc7a723",
            amount=0.0,
        )
        """
        _response = self._raw_client.refundv_2_amount(trans_id, amount, request_options=request_options)
        return _response.data

    def voidv_2(
        self, trans_id: str, *, request_options: typing.Optional[RequestOptions] = None
    ) -> V2TransactionResponseWrapper:
        """
        Cancel a transaction that hasn't been settled yet. Voiding non-captured authorizations prevents future captures. This is the v2 version of the `api/MoneyIn/void/{transId}` endpoint, and returns the unified response format. See [Pay In unified response codes reference](/guides/pay-in-unified-response-codes-reference) for more information.

        Parameters
        ----------
        trans_id : str
            ReferenceId for the transaction (PaymentId).

        request_options : typing.Optional[RequestOptions]
            Request-specific configuration.

        Returns
        -------
        V2TransactionResponseWrapper
            Ok

        Examples
        --------
        from payabli import payabli

        client = payabli(
            api_key="YOUR_API_KEY",
        )
        client.money_in.voidv_2(
            trans_id="10-3ffa27df-b171-44e0-b251-e95fbfc7a723",
        )
        """
        _response = self._raw_client.voidv_2(trans_id, request_options=request_options)
        return _response.data


class AsyncMoneyInClient:
    def __init__(self, *, client_wrapper: AsyncClientWrapper):
        self._raw_client = AsyncRawMoneyInClient(client_wrapper=client_wrapper)

    @property
    def with_raw_response(self) -> AsyncRawMoneyInClient:
        """
        Retrieves a raw implementation of this client that returns raw responses.

        Returns
        -------
        AsyncRawMoneyInClient
        """
        return self._raw_client

    async def authorize(
        self,
        *,
        payment_details: PaymentDetail,
        payment_method: PaymentMethod,
        force_customer_creation: typing.Optional[ForceCustomerCreation] = None,
        idempotency_key: typing.Optional[IdempotencyKey] = None,
        account_id: typing.Optional[AccountId] = OMIT,
        customer_data: typing.Optional[PayorDataRequest] = OMIT,
        entry_point: typing.Optional[Entrypointfield] = OMIT,
        invoice_data: typing.Optional[BillData] = OMIT,
        ipaddress: typing.Optional[IpAddress] = OMIT,
        order_description: typing.Optional[Orderdescription] = OMIT,
        order_id: typing.Optional[OrderId] = OMIT,
        source: typing.Optional[Source] = OMIT,
        subdomain: typing.Optional[Subdomain] = OMIT,
        subscription_id: typing.Optional[Subscriptionid] = OMIT,
        request_options: typing.Optional[RequestOptions] = None,
    ) -> AuthResponse:
        """
        Authorize a card transaction. This returns an authorization code and reserves funds for the merchant. Authorized transactions aren't flagged for settlement until [captured](/developers/api-reference/moneyin/capture-an-authorized-transaction).
        Only card transactions can be authorized. This endpoint can't be used for ACH transactions.
        <Tip>
          Consider migrating to the [v2 Authorize endpoint](/developers/api-reference/moneyinV2/authorize-a-transaction) to take advantage of unified response codes and improved response consistency.
        </Tip>

        Parameters
        ----------
        payment_details : PaymentDetail
            Object describing details of the payment. Required.

        payment_method : PaymentMethod
            Information about the payment method for the transaction. Required and recommended fields for each payment method type are described in each schema below.

        force_customer_creation : typing.Optional[ForceCustomerCreation]

        idempotency_key : typing.Optional[IdempotencyKey]

        account_id : typing.Optional[AccountId]

        customer_data : typing.Optional[PayorDataRequest]
            Object describing the Customer/Payor. Which fields are required depends on the paypoint's custom identifier settings.

        entry_point : typing.Optional[Entrypointfield]

        invoice_data : typing.Optional[BillData]
            Object describing an Invoice linked to the transaction.

        ipaddress : typing.Optional[IpAddress]

        order_description : typing.Optional[Orderdescription]

        order_id : typing.Optional[OrderId]

        source : typing.Optional[Source]

        subdomain : typing.Optional[Subdomain]

        subscription_id : typing.Optional[Subscriptionid]

        request_options : typing.Optional[RequestOptions]
            Request-specific configuration.

        Returns
        -------
        AuthResponse
            Ok

        Examples
        --------
        import asyncio

        from payabli import (
            Asyncpayabli,
            PaymentDetail,
            PayMethodCredit,
            PayorDataRequest,
        )

        client = Asyncpayabli(
            api_key="YOUR_API_KEY",
        )


        async def main() -> None:
            await client.money_in.authorize(
                customer_data=PayorDataRequest(
                    customer_id=4440,
                ),
                entry_point="f743aed24a",
                ipaddress="255.255.255.255",
                payment_details=PaymentDetail(
                    service_fee=0.0,
                    total_amount=100.0,
                ),
                payment_method=PayMethodCredit(
                    cardcvv="999",
                    cardexp="02/27",
                    card_holder="John Cassian",
                    cardnumber="4111111111111111",
                    cardzip="12345",
                    initiator="payor",
                ),
            )


        asyncio.run(main())
        """
        _response = await self._raw_client.authorize(
            payment_details=payment_details,
            payment_method=payment_method,
            force_customer_creation=force_customer_creation,
            idempotency_key=idempotency_key,
            account_id=account_id,
            customer_data=customer_data,
            entry_point=entry_point,
            invoice_data=invoice_data,
            ipaddress=ipaddress,
            order_description=order_description,
            order_id=order_id,
            source=source,
            subdomain=subdomain,
            subscription_id=subscription_id,
            request_options=request_options,
        )
        return _response.data

    async def capture(
        self, trans_id: str, amount: float, *, request_options: typing.Optional[RequestOptions] = None
    ) -> CaptureResponse:
        """
        <Warning>
          This endpoint is deprecated and will be sunset on November 24, 2025. Migrate to [POST `/capture/{transId}`](/developers/api-reference/moneyin/capture-an-authorized-transaction)`.
        </Warning>

          Capture an [authorized
        transaction](/developers/api-reference/moneyin/authorize-a-transaction) to complete the transaction and move funds from the customer to merchant account.

        Parameters
        ----------
        trans_id : str
            ReferenceId for the transaction (PaymentId).

        amount : float
            Amount to be captured. The amount can't be greater the original total amount of the transaction. `0` captures the total amount authorized in the transaction. Partial captures aren't supported.

        request_options : typing.Optional[RequestOptions]
            Request-specific configuration.

        Returns
        -------
        CaptureResponse
            Ok

        Examples
        --------
        import asyncio

        from payabli import Asyncpayabli

        client = Asyncpayabli(
            api_key="YOUR_API_KEY",
        )


        async def main() -> None:
            await client.money_in.capture(
                trans_id="10-7d9cd67d-2d5d-4cd7-a1b7-72b8b201ec13",
                amount=0.0,
            )


        asyncio.run(main())
        """
        _response = await self._raw_client.capture(trans_id, amount, request_options=request_options)
        return _response.data

    async def capture_auth(
        self,
        trans_id: str,
        *,
        payment_details: CapturePaymentDetails,
        request_options: typing.Optional[RequestOptions] = None,
    ) -> CaptureResponse:
        """
        Capture an [authorized transaction](/developers/api-reference/moneyin/authorize-a-transaction) to complete the transaction and move funds from the customer to merchant account.

        You can use this endpoint to capture both full and partial amounts of the original authorized transaction. See [Capture an authorized transaction](/developers/developer-guides/pay-in-auth-and-capture) for more information about this endpoint.

        <Tip>
        Consider migrating to the [v2 Capture endpoint](/developers/api-reference/moneyinV2/capture-an-authorized-transaction) to take advantage of unified response codes and improved response consistency.
        </Tip>

        Parameters
        ----------
        trans_id : str
            ReferenceId for the transaction (PaymentId).

        payment_details : CapturePaymentDetails

        request_options : typing.Optional[RequestOptions]
            Request-specific configuration.

        Returns
        -------
        CaptureResponse
            Ok

        Examples
        --------
        import asyncio

        from payabli import Asyncpayabli
        from payabli.money_in import CapturePaymentDetails

        client = Asyncpayabli(
            api_key="YOUR_API_KEY",
        )


        async def main() -> None:
            await client.money_in.capture_auth(
                trans_id="10-7d9cd67d-2d5d-4cd7-a1b7-72b8b201ec13",
                payment_details=CapturePaymentDetails(
                    total_amount=105.0,
                    service_fee=5.0,
                ),
            )


        asyncio.run(main())
        """
        _response = await self._raw_client.capture_auth(
            trans_id, payment_details=payment_details, request_options=request_options
        )
        return _response.data

    async def credit(
        self,
        *,
        customer_data: PayorDataRequest,
        payment_details: PaymentDetailCredit,
        payment_method: RequestCreditPaymentMethod,
        force_customer_creation: typing.Optional[ForceCustomerCreation] = None,
        idempotency_key: typing.Optional[IdempotencyKey] = None,
        account_id: typing.Optional[AccountId] = OMIT,
        entrypoint: typing.Optional[Entrypointfield] = OMIT,
        order_description: typing.Optional[Orderdescription] = OMIT,
        order_id: typing.Optional[OrderId] = OMIT,
        source: typing.Optional[Source] = OMIT,
        subdomain: typing.Optional[Subdomain] = OMIT,
        request_options: typing.Optional[RequestOptions] = None,
    ) -> PayabliApiResponse0:
        """
        Make a temporary microdeposit in a customer account to verify the customer's ownership and access to the target account. Reverse the microdeposit with `reverseCredit`. Payabli doesn't automatically make microdeposits when you add a bank account, you must manually make the requests.

        This feature must be enabled by Payabli on a per-merchant basis. Contact support for help.

        Parameters
        ----------
        customer_data : PayorDataRequest
            Object describing the customer/payor.

        payment_details : PaymentDetailCredit

        payment_method : RequestCreditPaymentMethod
            Object describing the ACH payment method to use for transaction.

        force_customer_creation : typing.Optional[ForceCustomerCreation]

        idempotency_key : typing.Optional[IdempotencyKey]

        account_id : typing.Optional[AccountId]

        entrypoint : typing.Optional[Entrypointfield]

        order_description : typing.Optional[Orderdescription]

        order_id : typing.Optional[OrderId]

        source : typing.Optional[Source]

        subdomain : typing.Optional[Subdomain]

        request_options : typing.Optional[RequestOptions]
            Request-specific configuration.

        Returns
        -------
        PayabliApiResponse0
            Success. The `referenceId` returned in a successful response is the `transId` value you need to reverse the microdeposit.

            A "Missing Gateway Data" message can indicate that the entrypoint targeted in the request isn't set up for ACH payments.

        Examples
        --------
        import asyncio

        from payabli import Asyncpayabli, PaymentDetailCredit, PayorDataRequest
        from payabli.money_in import RequestCreditPaymentMethod

        client = Asyncpayabli(
            api_key="YOUR_API_KEY",
        )


        async def main() -> None:
            await client.money_in.credit(
                idempotency_key="6B29FC40-CA47-1067-B31D-00DD010662DA",
                customer_data=PayorDataRequest(
                    billing_address_1="5127 Linkwood ave",
                    customer_number="100",
                ),
                entrypoint="my-entrypoint",
                payment_details=PaymentDetailCredit(
                    service_fee=0.0,
                    total_amount=1.0,
                ),
                payment_method=RequestCreditPaymentMethod(
                    ach_account="88354454",
                    ach_account_type="Checking",
                    ach_holder="John Smith",
                    ach_routing="021000021",
                ),
            )


        asyncio.run(main())
        """
        _response = await self._raw_client.credit(
            customer_data=customer_data,
            payment_details=payment_details,
            payment_method=payment_method,
            force_customer_creation=force_customer_creation,
            idempotency_key=idempotency_key,
            account_id=account_id,
            entrypoint=entrypoint,
            order_description=order_description,
            order_id=order_id,
            source=source,
            subdomain=subdomain,
            request_options=request_options,
        )
        return _response.data

    async def details(
        self, trans_id: str, *, request_options: typing.Optional[RequestOptions] = None
    ) -> TransactionQueryRecordsCustomer:
        """
        Retrieve a processed transaction's details.

        Parameters
        ----------
        trans_id : str
            ReferenceId for the transaction (PaymentId).

        request_options : typing.Optional[RequestOptions]
            Request-specific configuration.

        Returns
        -------
        TransactionQueryRecordsCustomer
            Success

        Examples
        --------
        import asyncio

        from payabli import Asyncpayabli

        client = Asyncpayabli(
            api_key="YOUR_API_KEY",
        )


        async def main() -> None:
            await client.money_in.details(
                trans_id="45-as456777hhhhhhhhhh77777777-324",
            )


        asyncio.run(main())
        """
        _response = await self._raw_client.details(trans_id, request_options=request_options)
        return _response.data

    async def getpaid(
        self,
        *,
        payment_details: PaymentDetail,
        payment_method: PaymentMethod,
        ach_validation: typing.Optional[AchValidation] = None,
        force_customer_creation: typing.Optional[ForceCustomerCreation] = None,
        include_details: typing.Optional[bool] = None,
        idempotency_key: typing.Optional[IdempotencyKey] = None,
        validation_code: typing.Optional[str] = None,
        account_id: typing.Optional[AccountId] = OMIT,
        customer_data: typing.Optional[PayorDataRequest] = OMIT,
        entry_point: typing.Optional[Entrypointfield] = OMIT,
        invoice_data: typing.Optional[BillData] = OMIT,
        ipaddress: typing.Optional[IpAddress] = OMIT,
        order_description: typing.Optional[Orderdescription] = OMIT,
        order_id: typing.Optional[OrderId] = OMIT,
        source: typing.Optional[Source] = OMIT,
        subdomain: typing.Optional[Subdomain] = OMIT,
        subscription_id: typing.Optional[Subscriptionid] = OMIT,
        request_options: typing.Optional[RequestOptions] = None,
    ) -> PayabliApiResponseGetPaid:
        """
        Make a single transaction. This method authorizes and captures a payment in one step.

          <Tip>
          Consider migrating to the [v2 Make a transaction endpoint](/developers/api-reference/moneyinV2/make-a-transaction) to take advantage of unified response codes and improved response consistency.
          </Tip>

        Parameters
        ----------
        payment_details : PaymentDetail
            Object describing details of the payment. Required.

        payment_method : PaymentMethod
            Information about the payment method for the transaction. Required and recommended fields for each payment method type are described in each schema below.

        ach_validation : typing.Optional[AchValidation]

        force_customer_creation : typing.Optional[ForceCustomerCreation]

        include_details : typing.Optional[bool]
            When `true`, transactionDetails object is returned in the response. See a full example of the `transactionDetails` object in the [Transaction integration guide](/developers/developer-guides/money-in-transaction-add#includedetailstrue-response).

        idempotency_key : typing.Optional[IdempotencyKey]

        validation_code : typing.Optional[str]
            Value obtained from user when an API generated CAPTCHA is used in payment page

        account_id : typing.Optional[AccountId]

        customer_data : typing.Optional[PayorDataRequest]
            Object describing the Customer/Payor. Which fields are required depends on the paypoint's custom identifier settings.

        entry_point : typing.Optional[Entrypointfield]

        invoice_data : typing.Optional[BillData]
            Object describing an Invoice linked to the transaction.

        ipaddress : typing.Optional[IpAddress]

        order_description : typing.Optional[Orderdescription]

        order_id : typing.Optional[OrderId]

        source : typing.Optional[Source]

        subdomain : typing.Optional[Subdomain]

        subscription_id : typing.Optional[Subscriptionid]

        request_options : typing.Optional[RequestOptions]
            Request-specific configuration.

        Returns
        -------
        PayabliApiResponseGetPaid
            Ok

        Examples
        --------
        import asyncio

        from payabli import (
            Asyncpayabli,
            PaymentDetail,
            PayMethodCredit,
            PayorDataRequest,
        )

        client = Asyncpayabli(
            api_key="YOUR_API_KEY",
        )


        async def main() -> None:
            await client.money_in.getpaid(
                customer_data=PayorDataRequest(
                    customer_id=4440,
                ),
                entry_point="f743aed24a",
                ipaddress="255.255.255.255",
                payment_details=PaymentDetail(
                    service_fee=0.0,
                    total_amount=100.0,
                ),
                payment_method=PayMethodCredit(
                    cardcvv="999",
                    cardexp="02/27",
                    card_holder="John Cassian",
                    cardnumber="4111111111111111",
                    cardzip="12345",
                    initiator="payor",
                ),
            )


        asyncio.run(main())
        """
        _response = await self._raw_client.getpaid(
            payment_details=payment_details,
            payment_method=payment_method,
            ach_validation=ach_validation,
            force_customer_creation=force_customer_creation,
            include_details=include_details,
            idempotency_key=idempotency_key,
            validation_code=validation_code,
            account_id=account_id,
            customer_data=customer_data,
            entry_point=entry_point,
            invoice_data=invoice_data,
            ipaddress=ipaddress,
            order_description=order_description,
            order_id=order_id,
            source=source,
            subdomain=subdomain,
            subscription_id=subscription_id,
            request_options=request_options,
        )
        return _response.data

    async def reverse(
        self, trans_id: str, amount: float, *, request_options: typing.Optional[RequestOptions] = None
    ) -> ReverseResponse:
        """
        A reversal either refunds or voids a transaction independent of the transaction's settlement status. Send a reversal request for a transaction, and Payabli automatically determines whether it's a refund or void. You don't need to know whether the transaction is settled or not.

        Parameters
        ----------
        trans_id : str
            ReferenceId for the transaction (PaymentId).

        amount : float

            Amount to reverse from original transaction, minus any service fees charged on the original transaction.

            The amount provided can't be greater than the original total amount of the transaction, minus service fees. For example, if a transaction was $90 plus a $10 service fee, you can reverse up to $90.

            An amount equal to zero will refunds the total amount authorized minus any service fee.

        request_options : typing.Optional[RequestOptions]
            Request-specific configuration.

        Returns
        -------
        ReverseResponse
            Ok

        Examples
        --------
        import asyncio

        from payabli import Asyncpayabli

        client = Asyncpayabli(
            api_key="YOUR_API_KEY",
        )


        async def main() -> None:
            await client.money_in.reverse(
                amount=0.0,
                trans_id="10-3ffa27df-b171-44e0-b251-e95fbfc7a723",
            )


        asyncio.run(main())
        """
        _response = await self._raw_client.reverse(trans_id, amount, request_options=request_options)
        return _response.data

    async def refund(
        self, trans_id: str, amount: float, *, request_options: typing.Optional[RequestOptions] = None
    ) -> RefundResponse:
        """
        Refund a transaction that has settled and send money back to the account holder. If a transaction hasn't been settled, void it instead.

          <Tip>
          Consider migrating to the [v2 Refund endpoint](/developers/api-reference/moneyinV2/refund-a-settled-transaction) to take advantage of unified response codes and improved response consistency.
          </Tip>

        Parameters
        ----------
        trans_id : str
            ReferenceId for the transaction (PaymentId).

        amount : float

            Amount to refund from original transaction, minus any service fees charged on the original transaction.

            The amount provided can't be greater than the original total amount of the transaction, minus service fees. For example, if a transaction was \\$90 plus a \\$10 service fee, you can refund up to \\$90.

            An amount equal to zero will refund the total amount authorized minus any service fee.

        request_options : typing.Optional[RequestOptions]
            Request-specific configuration.

        Returns
        -------
        RefundResponse
            Ok

        Examples
        --------
        import asyncio

        from payabli import Asyncpayabli

        client = Asyncpayabli(
            api_key="YOUR_API_KEY",
        )


        async def main() -> None:
            await client.money_in.refund(
                amount=0.0,
                trans_id="10-3ffa27df-b171-44e0-b251-e95fbfc7a723",
            )


        asyncio.run(main())
        """
        _response = await self._raw_client.refund(trans_id, amount, request_options=request_options)
        return _response.data

    async def refund_with_instructions(
        self,
        trans_id: str,
        *,
        idempotency_key: typing.Optional[IdempotencyKey] = None,
        amount: typing.Optional[float] = OMIT,
        ipaddress: typing.Optional[IpAddress] = OMIT,
        order_description: typing.Optional[Orderdescription] = OMIT,
        order_id: typing.Optional[OrderId] = OMIT,
        refund_details: typing.Optional[RefundDetail] = OMIT,
        source: typing.Optional[Source] = OMIT,
        request_options: typing.Optional[RequestOptions] = None,
    ) -> RefundWithInstructionsResponse:
        """
        Refunds a settled transaction with split instructions.

        Parameters
        ----------
        trans_id : str
            ReferenceId for the transaction (PaymentId).

        idempotency_key : typing.Optional[IdempotencyKey]

        amount : typing.Optional[float]

            Amount to refund from original transaction, minus any service fees charged on the original transaction.

            The amount provided can't be greater than the original total amount of the transaction, minus service fees. For example, if a transaction was $90 plus a $10 service fee, you can refund up to $90.

            An amount equal to zero will refund the total amount authorized minus any service fee.

        ipaddress : typing.Optional[IpAddress]

        order_description : typing.Optional[Orderdescription]

        order_id : typing.Optional[OrderId]

        refund_details : typing.Optional[RefundDetail]

        source : typing.Optional[Source]

        request_options : typing.Optional[RequestOptions]
            Request-specific configuration.

        Returns
        -------
        RefundWithInstructionsResponse
            Success

        Examples
        --------
        import asyncio

        from payabli import Asyncpayabli, RefundDetail, SplitFundingRefundContent

        client = Asyncpayabli(
            api_key="YOUR_API_KEY",
        )


        async def main() -> None:
            await client.money_in.refund_with_instructions(
                trans_id="10-3ffa27df-b171-44e0-b251-e95fbfc7a723",
                idempotency_key="8A29FC40-CA47-1067-B31D-00DD010662DB",
                source="api",
                order_description="Materials deposit",
                amount=100.0,
                refund_details=RefundDetail(
                    split_refunding=[
                        SplitFundingRefundContent(
                            origination_entry_point="7f1a381696",
                            account_id="187-342",
                            description="Refunding undelivered materials",
                            amount=60.0,
                        ),
                        SplitFundingRefundContent(
                            origination_entry_point="7f1a381696",
                            account_id="187-343",
                            description="Refunding deposit for undelivered materials",
                            amount=40.0,
                        ),
                    ],
                ),
            )


        asyncio.run(main())
        """
        _response = await self._raw_client.refund_with_instructions(
            trans_id,
            idempotency_key=idempotency_key,
            amount=amount,
            ipaddress=ipaddress,
            order_description=order_description,
            order_id=order_id,
            refund_details=refund_details,
            source=source,
            request_options=request_options,
        )
        return _response.data

    async def reverse_credit(
        self, trans_id: str, *, request_options: typing.Optional[RequestOptions] = None
    ) -> PayabliApiResponse:
        """
        Reverse microdeposits that are used to verify customer account ownership and access. The `transId` value is returned in the success response for the original credit transaction made with `api/MoneyIn/makecredit`.

        Parameters
        ----------
        trans_id : str
            ReferenceId for the transaction (PaymentId).

        request_options : typing.Optional[RequestOptions]
            Request-specific configuration.

        Returns
        -------
        PayabliApiResponse
            Success

        Examples
        --------
        import asyncio

        from payabli import Asyncpayabli

        client = Asyncpayabli(
            api_key="YOUR_API_KEY",
        )


        async def main() -> None:
            await client.money_in.reverse_credit(
                trans_id="45-as456777hhhhhhhhhh77777777-324",
            )


        asyncio.run(main())
        """
        _response = await self._raw_client.reverse_credit(trans_id, request_options=request_options)
        return _response.data

    async def send_receipt_2_trans(
        self,
        trans_id: str,
        *,
        email: typing.Optional[str] = None,
        request_options: typing.Optional[RequestOptions] = None,
    ) -> ReceiptResponse:
        """
        Send a payment receipt for a transaction.

        Parameters
        ----------
        trans_id : str
            ReferenceId for the transaction (PaymentId).

        email : typing.Optional[str]
            Email address where the payment receipt should be sent.

            If not provided, the email address on file for the user owner of the transaction is used.

        request_options : typing.Optional[RequestOptions]
            Request-specific configuration.

        Returns
        -------
        ReceiptResponse
            Success

        Examples
        --------
        import asyncio

        from payabli import Asyncpayabli

        client = Asyncpayabli(
            api_key="YOUR_API_KEY",
        )


        async def main() -> None:
            await client.money_in.send_receipt_2_trans(
                trans_id="45-as456777hhhhhhhhhh77777777-324",
                email="example@email.com",
            )


        asyncio.run(main())
        """
        _response = await self._raw_client.send_receipt_2_trans(trans_id, email=email, request_options=request_options)
        return _response.data

    async def validate(
        self,
        *,
        entry_point: Entrypointfield,
        payment_method: RequestPaymentValidatePaymentMethod,
        idempotency_key: typing.Optional[IdempotencyKey] = None,
        account_id: typing.Optional[AccountId] = OMIT,
        order_description: typing.Optional[Orderdescription] = OMIT,
        order_id: typing.Optional[OrderId] = OMIT,
        request_options: typing.Optional[RequestOptions] = None,
    ) -> ValidateResponse:
        """
        Validates a card number without running a transaction or authorizing a charge.

        Parameters
        ----------
        entry_point : Entrypointfield

        payment_method : RequestPaymentValidatePaymentMethod
            Object describing payment method to use for transaction.

        idempotency_key : typing.Optional[IdempotencyKey]

        account_id : typing.Optional[AccountId]

        order_description : typing.Optional[Orderdescription]

        order_id : typing.Optional[OrderId]

        request_options : typing.Optional[RequestOptions]
            Request-specific configuration.

        Returns
        -------
        ValidateResponse
            Ok

        Examples
        --------
        import asyncio

        from payabli import Asyncpayabli
        from payabli.money_in import RequestPaymentValidatePaymentMethod

        client = Asyncpayabli(
            api_key="YOUR_API_KEY",
        )


        async def main() -> None:
            await client.money_in.validate(
                idempotency_key="6B29FC40-CA47-1067-B31D-00DD010662DA",
                entry_point="entry132",
                payment_method=RequestPaymentValidatePaymentMethod(
                    method="card",
                    cardnumber="4360000001000005",
                    cardexp="12/29",
                    cardzip="14602-8328",
                    card_holder="Dianne Becker-Smith",
                ),
            )


        asyncio.run(main())
        """
        _response = await self._raw_client.validate(
            entry_point=entry_point,
            payment_method=payment_method,
            idempotency_key=idempotency_key,
            account_id=account_id,
            order_description=order_description,
            order_id=order_id,
            request_options=request_options,
        )
        return _response.data

    async def void(self, trans_id: str, *, request_options: typing.Optional[RequestOptions] = None) -> VoidResponse:
        """
        Cancel a transaction that hasn't been settled yet. Voiding non-captured authorizations prevents future captures. If a transaction has been settled, refund it instead.

          <Tip>
          Consider migrating to the [v2 Void endpoint](/developers/api-reference/moneyinV2/void-a-transaction) to take advantage of unified response codes and improved response consistency.
          </Tip>

        Parameters
        ----------
        trans_id : str
            ReferenceId for the transaction (PaymentId).

        request_options : typing.Optional[RequestOptions]
            Request-specific configuration.

        Returns
        -------
        VoidResponse
            Ok

        Examples
        --------
        import asyncio

        from payabli import Asyncpayabli

        client = Asyncpayabli(
            api_key="YOUR_API_KEY",
        )


        async def main() -> None:
            await client.money_in.void(
                trans_id="10-3ffa27df-b171-44e0-b251-e95fbfc7a723",
            )


        asyncio.run(main())
        """
        _response = await self._raw_client.void(trans_id, request_options=request_options)
        return _response.data

    async def getpaidv_2(
        self,
        *,
        payment_details: PaymentDetail,
        payment_method: PaymentMethod,
        ach_validation: typing.Optional[AchValidation] = None,
        force_customer_creation: typing.Optional[ForceCustomerCreation] = None,
        idempotency_key: typing.Optional[IdempotencyKey] = None,
        validation_code: typing.Optional[str] = None,
        account_id: typing.Optional[AccountId] = OMIT,
        customer_data: typing.Optional[PayorDataRequest] = OMIT,
        entry_point: typing.Optional[Entrypointfield] = OMIT,
        invoice_data: typing.Optional[BillData] = OMIT,
        ipaddress: typing.Optional[IpAddress] = OMIT,
        order_description: typing.Optional[Orderdescription] = OMIT,
        order_id: typing.Optional[OrderId] = OMIT,
        source: typing.Optional[Source] = OMIT,
        subdomain: typing.Optional[Subdomain] = OMIT,
        subscription_id: typing.Optional[Subscriptionid] = OMIT,
        request_options: typing.Optional[RequestOptions] = None,
    ) -> V2TransactionResponseWrapper:
        """
        Make a single transaction. This method authorizes and captures a payment in one step. This is the v2 version of the `api/MoneyIn/getpaid` endpoint, and returns the unified response format. See [Pay In unified response codes reference](/guides/pay-in-unified-response-codes-reference) for more information.

        Parameters
        ----------
        payment_details : PaymentDetail
            Object describing details of the payment. Required.

        payment_method : PaymentMethod
            Information about the payment method for the transaction. Required and recommended fields for each payment method type are described in each schema below.

        ach_validation : typing.Optional[AchValidation]

        force_customer_creation : typing.Optional[ForceCustomerCreation]

        idempotency_key : typing.Optional[IdempotencyKey]

        validation_code : typing.Optional[str]
            Value obtained from user when an API generated CAPTCHA is used in payment page

        account_id : typing.Optional[AccountId]

        customer_data : typing.Optional[PayorDataRequest]
            Object describing the Customer/Payor. Which fields are required depends on the paypoint's custom identifier settings.

        entry_point : typing.Optional[Entrypointfield]

        invoice_data : typing.Optional[BillData]
            Object describing an Invoice linked to the transaction.

        ipaddress : typing.Optional[IpAddress]

        order_description : typing.Optional[Orderdescription]

        order_id : typing.Optional[OrderId]

        source : typing.Optional[Source]

        subdomain : typing.Optional[Subdomain]

        subscription_id : typing.Optional[Subscriptionid]

        request_options : typing.Optional[RequestOptions]
            Request-specific configuration.

        Returns
        -------
        V2TransactionResponseWrapper
            Ok

        Examples
        --------
        import asyncio

        from payabli import (
            Asyncpayabli,
            PaymentDetail,
            PayMethodCredit,
            PayorDataRequest,
        )

        client = Asyncpayabli(
            api_key="YOUR_API_KEY",
        )


        async def main() -> None:
            await client.money_in.getpaidv_2(
                customer_data=PayorDataRequest(
                    customer_id=4440,
                ),
                entry_point="f743aed24a",
                ipaddress="255.255.255.255",
                payment_details=PaymentDetail(
                    service_fee=0.0,
                    total_amount=100.0,
                ),
                payment_method=PayMethodCredit(
                    cardcvv="999",
                    cardexp="02/27",
                    card_holder="John Cassian",
                    cardnumber="4111111111111111",
                    cardzip="12345",
                    initiator="payor",
                ),
            )


        asyncio.run(main())
        """
        _response = await self._raw_client.getpaidv_2(
            payment_details=payment_details,
            payment_method=payment_method,
            ach_validation=ach_validation,
            force_customer_creation=force_customer_creation,
            idempotency_key=idempotency_key,
            validation_code=validation_code,
            account_id=account_id,
            customer_data=customer_data,
            entry_point=entry_point,
            invoice_data=invoice_data,
            ipaddress=ipaddress,
            order_description=order_description,
            order_id=order_id,
            source=source,
            subdomain=subdomain,
            subscription_id=subscription_id,
            request_options=request_options,
        )
        return _response.data

    async def authorizev_2(
        self,
        *,
        payment_details: PaymentDetail,
        payment_method: PaymentMethod,
        force_customer_creation: typing.Optional[ForceCustomerCreation] = None,
        idempotency_key: typing.Optional[IdempotencyKey] = None,
        account_id: typing.Optional[AccountId] = OMIT,
        customer_data: typing.Optional[PayorDataRequest] = OMIT,
        entry_point: typing.Optional[Entrypointfield] = OMIT,
        invoice_data: typing.Optional[BillData] = OMIT,
        ipaddress: typing.Optional[IpAddress] = OMIT,
        order_description: typing.Optional[Orderdescription] = OMIT,
        order_id: typing.Optional[OrderId] = OMIT,
        source: typing.Optional[Source] = OMIT,
        subdomain: typing.Optional[Subdomain] = OMIT,
        subscription_id: typing.Optional[Subscriptionid] = OMIT,
        request_options: typing.Optional[RequestOptions] = None,
    ) -> V2TransactionResponseWrapper:
        """
        Authorize a card transaction. This returns an authorization code and reserves funds for the merchant. Authorized transactions aren't flagged for settlement until captured. This is the v2 version of the `api/MoneyIn/authorize` endpoint, and returns the unified response format. See [Pay In unified response codes reference](/guides/pay-in-unified-response-codes-reference) for more information.

        **Note**: Only card transactions can be authorized. This endpoint can't be used for ACH transactions.

        Parameters
        ----------
        payment_details : PaymentDetail
            Object describing details of the payment. Required.

        payment_method : PaymentMethod
            Information about the payment method for the transaction. Required and recommended fields for each payment method type are described in each schema below.

        force_customer_creation : typing.Optional[ForceCustomerCreation]

        idempotency_key : typing.Optional[IdempotencyKey]

        account_id : typing.Optional[AccountId]

        customer_data : typing.Optional[PayorDataRequest]
            Object describing the Customer/Payor. Which fields are required depends on the paypoint's custom identifier settings.

        entry_point : typing.Optional[Entrypointfield]

        invoice_data : typing.Optional[BillData]
            Object describing an Invoice linked to the transaction.

        ipaddress : typing.Optional[IpAddress]

        order_description : typing.Optional[Orderdescription]

        order_id : typing.Optional[OrderId]

        source : typing.Optional[Source]

        subdomain : typing.Optional[Subdomain]

        subscription_id : typing.Optional[Subscriptionid]

        request_options : typing.Optional[RequestOptions]
            Request-specific configuration.

        Returns
        -------
        V2TransactionResponseWrapper
            Ok

        Examples
        --------
        import asyncio

        from payabli import (
            Asyncpayabli,
            PaymentDetail,
            PayMethodCredit,
            PayorDataRequest,
        )

        client = Asyncpayabli(
            api_key="YOUR_API_KEY",
        )


        async def main() -> None:
            await client.money_in.authorizev_2(
                customer_data=PayorDataRequest(
                    customer_id=4440,
                ),
                entry_point="f743aed24a",
                ipaddress="255.255.255.255",
                payment_details=PaymentDetail(
                    service_fee=0.0,
                    total_amount=100.0,
                ),
                payment_method=PayMethodCredit(
                    cardcvv="999",
                    cardexp="02/27",
                    card_holder="John Cassian",
                    cardnumber="4111111111111111",
                    cardzip="12345",
                    initiator="payor",
                ),
            )


        asyncio.run(main())
        """
        _response = await self._raw_client.authorizev_2(
            payment_details=payment_details,
            payment_method=payment_method,
            force_customer_creation=force_customer_creation,
            idempotency_key=idempotency_key,
            account_id=account_id,
            customer_data=customer_data,
            entry_point=entry_point,
            invoice_data=invoice_data,
            ipaddress=ipaddress,
            order_description=order_description,
            order_id=order_id,
            source=source,
            subdomain=subdomain,
            subscription_id=subscription_id,
            request_options=request_options,
        )
        return _response.data

    async def capturev_2(
        self,
        trans_id: str,
        *,
        payment_details: CapturePaymentDetails,
        request_options: typing.Optional[RequestOptions] = None,
    ) -> V2TransactionResponseWrapper:
        """
        Capture an authorized transaction to complete the transaction and move funds from the customer to merchant account. This is the v2 version of the `api/MoneyIn/capture/{transId}` endpoint, and returns the unified response format. See [Pay In unified response codes reference](/guides/pay-in-unified-response-codes-reference) for more information.

        Parameters
        ----------
        trans_id : str
            ReferenceId for the transaction (PaymentId).

        payment_details : CapturePaymentDetails

        request_options : typing.Optional[RequestOptions]
            Request-specific configuration.

        Returns
        -------
        V2TransactionResponseWrapper
            Ok

        Examples
        --------
        import asyncio

        from payabli import Asyncpayabli
        from payabli.money_in import CapturePaymentDetails

        client = Asyncpayabli(
            api_key="YOUR_API_KEY",
        )


        async def main() -> None:
            await client.money_in.capturev_2(
                trans_id="10-7d9cd67d-2d5d-4cd7-a1b7-72b8b201ec13",
                payment_details=CapturePaymentDetails(
                    total_amount=105.0,
                    service_fee=5.0,
                ),
            )


        asyncio.run(main())
        """
        _response = await self._raw_client.capturev_2(
            trans_id, payment_details=payment_details, request_options=request_options
        )
        return _response.data

    async def refundv_2(
        self, trans_id: str, *, request_options: typing.Optional[RequestOptions] = None
    ) -> V2TransactionResponseWrapper:
        """
        Give a full refund for a transaction that has settled and send money back to the account holder. To perform a partial refund, see [Partially refund a transaction](developers/api-reference/moneyinV2/partial-refund-a-settled-transaction).

        This is the v2 version of the refund endpoint, and returns the unified response format. See [Pay In unified response codes reference](/guides/pay-in-unified-response-codes-reference) for more information.

        Parameters
        ----------
        trans_id : str
            ReferenceId for the transaction (PaymentId).

        request_options : typing.Optional[RequestOptions]
            Request-specific configuration.

        Returns
        -------
        V2TransactionResponseWrapper
            Ok

        Examples
        --------
        import asyncio

        from payabli import Asyncpayabli

        client = Asyncpayabli(
            api_key="YOUR_API_KEY",
        )


        async def main() -> None:
            await client.money_in.refundv_2(
                trans_id="10-3ffa27df-b171-44e0-b251-e95fbfc7a723",
            )


        asyncio.run(main())
        """
        _response = await self._raw_client.refundv_2(trans_id, request_options=request_options)
        return _response.data

    async def refundv_2_amount(
        self, trans_id: str, amount: float, *, request_options: typing.Optional[RequestOptions] = None
    ) -> V2TransactionResponseWrapper:
        """
        Refund a transaction that has settled and send money back to the account holder. If `amount` is omitted or set to 0, performs a full refund. When a non-zero `amount` is provided, this endpoint performs a partial refund.

        This is the v2 version of the refund endpoint, and returns the unified response format. See [Pay In unified response codes reference](/guides/pay-in-unified-response-codes-reference) for more information.

        Parameters
        ----------
        trans_id : str
            ReferenceId for the transaction (PaymentId).

        amount : float
            Amount to refund from original transaction, minus any service fees charged on the original transaction. If omitted or set to 0, performs a full refund.

        request_options : typing.Optional[RequestOptions]
            Request-specific configuration.

        Returns
        -------
        V2TransactionResponseWrapper
            Ok

        Examples
        --------
        import asyncio

        from payabli import Asyncpayabli

        client = Asyncpayabli(
            api_key="YOUR_API_KEY",
        )


        async def main() -> None:
            await client.money_in.refundv_2_amount(
                trans_id="10-3ffa27df-b171-44e0-b251-e95fbfc7a723",
                amount=0.0,
            )


        asyncio.run(main())
        """
        _response = await self._raw_client.refundv_2_amount(trans_id, amount, request_options=request_options)
        return _response.data

    async def voidv_2(
        self, trans_id: str, *, request_options: typing.Optional[RequestOptions] = None
    ) -> V2TransactionResponseWrapper:
        """
        Cancel a transaction that hasn't been settled yet. Voiding non-captured authorizations prevents future captures. This is the v2 version of the `api/MoneyIn/void/{transId}` endpoint, and returns the unified response format. See [Pay In unified response codes reference](/guides/pay-in-unified-response-codes-reference) for more information.

        Parameters
        ----------
        trans_id : str
            ReferenceId for the transaction (PaymentId).

        request_options : typing.Optional[RequestOptions]
            Request-specific configuration.

        Returns
        -------
        V2TransactionResponseWrapper
            Ok

        Examples
        --------
        import asyncio

        from payabli import Asyncpayabli

        client = Asyncpayabli(
            api_key="YOUR_API_KEY",
        )


        async def main() -> None:
            await client.money_in.voidv_2(
                trans_id="10-3ffa27df-b171-44e0-b251-e95fbfc7a723",
            )


        asyncio.run(main())
        """
        _response = await self._raw_client.voidv_2(trans_id, request_options=request_options)
        return _response.data
