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

from ..core.unchecked_base_model import UncheckedBaseModel
import typing
import pydantic
from ..core.pydantic_utilities import IS_PYDANTIC_V2


class InvoiceAcceptedPaymentMethods(UncheckedBaseModel):
    """
    The payment methods that customers can use to pay an [invoice](entity:Invoice) on the Square-hosted invoice payment page.
    """

    card: typing.Optional[bool] = pydantic.Field(default=None)
    """
    Indicates whether credit card or debit card payments are accepted. The default value is `false`.
    """

    square_gift_card: typing.Optional[bool] = pydantic.Field(default=None)
    """
    Indicates whether Square gift card payments are accepted. The default value is `false`.
    """

    bank_account: typing.Optional[bool] = pydantic.Field(default=None)
    """
    Indicates whether ACH bank transfer payments are accepted. The default value is `false`.
    """

    buy_now_pay_later: typing.Optional[bool] = pydantic.Field(default=None)
    """
    Indicates whether Afterpay (also known as Clearpay) payments are accepted. The default value is `false`.
    
    This option is allowed only for invoices that have a single payment request of the `BALANCE` type. This payment method is
    supported if the seller account accepts Afterpay payments and the seller location is in a country where Afterpay
    invoice payments are supported. As a best practice, consider enabling an additional payment method when allowing
    `buy_now_pay_later` payments. For more information, including detailed requirements and processing limits, see
    [Buy Now Pay Later payments with Afterpay](https://developer.squareup.com/docs/invoices-api/overview#buy-now-pay-later).
    """

    cash_app_pay: typing.Optional[bool] = pydantic.Field(default=None)
    """
    Indicates whether Cash App payments are accepted. The default value is `false`.
    
    This payment method is supported only for seller [locations](entity:Location) in the United States.
    """

    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
