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

from ..core.unchecked_base_model import UncheckedBaseModel
import typing
from .tender_card_details_status import TenderCardDetailsStatus
import pydantic
from .card import Card
from .tender_card_details_entry_method import TenderCardDetailsEntryMethod
from ..core.pydantic_utilities import IS_PYDANTIC_V2


class TenderCardDetails(UncheckedBaseModel):
    """
    Represents additional details of a tender with `type` `CARD` or `SQUARE_GIFT_CARD`
    """

    status: typing.Optional[TenderCardDetailsStatus] = pydantic.Field(default=None)
    """
    The credit card payment's current state (such as `AUTHORIZED` or
    `CAPTURED`). See [TenderCardDetailsStatus](entity:TenderCardDetailsStatus)
    for possible values.
    See [TenderCardDetailsStatus](#type-tendercarddetailsstatus) for possible values
    """

    card: typing.Optional[Card] = pydantic.Field(default=None)
    """
    The credit card's non-confidential details.
    """

    entry_method: typing.Optional[TenderCardDetailsEntryMethod] = pydantic.Field(default=None)
    """
    The method used to enter the card's details for the transaction.
    See [TenderCardDetailsEntryMethod](#type-tendercarddetailsentrymethod) for possible values
    """

    if IS_PYDANTIC_V2:
        model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True)  # type: ignore # Pydantic v2
    else:

        class Config:
            frozen = True
            smart_union = True
            extra = pydantic.Extra.allow
