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

from ..core.unchecked_base_model import UncheckedBaseModel
import typing
import pydantic
from .afterpay_details import AfterpayDetails
from .clearpay_details import ClearpayDetails
from ..core.pydantic_utilities import IS_PYDANTIC_V2


class BuyNowPayLaterDetails(UncheckedBaseModel):
    """
    Additional details about a Buy Now Pay Later payment type.
    """

    brand: typing.Optional[str] = pydantic.Field(default=None)
    """
    The brand used for the Buy Now Pay Later payment.
    The brand can be `AFTERPAY`, `CLEARPAY` or `UNKNOWN`.
    """

    afterpay_details: typing.Optional[AfterpayDetails] = pydantic.Field(default=None)
    """
    Details about an Afterpay payment. These details are only populated if the `brand` is
    `AFTERPAY`.
    """

    clearpay_details: typing.Optional[ClearpayDetails] = pydantic.Field(default=None)
    """
    Details about a Clearpay payment. These details are only populated if the `brand` is
    `CLEARPAY`.
    """

    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
