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

from ...core.pydantic_utilities import UniversalBaseModel
from .custom_payment_method_fee_type import CustomPaymentMethodFeeType
import typing
import pydantic
from ...core.pydantic_utilities import IS_PYDANTIC_V2


class CustomPaymentMethodSchemaFee(UniversalBaseModel):
    type: CustomPaymentMethodFeeType
    amount: typing.Optional[float] = pydantic.Field(default=None)
    """
    If type is 'flat', this is the flat amount that will be charged as a fee. For example, if the fee is $2.50, set this to 2.50. If type is 'percentage', this is the percentage of the payment amount that will be charged as a fee. For example, if the fee is 2.5%, set this to 2.5.
    """

    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
