# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.

from __future__ import annotations

from typing_extensions import Literal, Required, Annotated, TypedDict

from ...._utils import PropertyInfo

__all__ = ["OrderCreateParams", "PaymentDetails"]


class OrderCreateParams(TypedDict, total=False):
    country_code: Required[Annotated[str, PropertyInfo(alias="countryCode")]]
    """Country code."""

    device_data: Required[Annotated[str, PropertyInfo(alias="deviceData")]]
    """
    Device data to send to Braintree and 3rd party fraud tools to help detect
    fraudulent activity.
    """

    email: Required[str]
    """Email address."""

    hold: Required[int]
    """Numeric identifier for a resource"""

    is_guest_order: Required[Annotated[bool, PropertyInfo(alias="isGuestOrder")]]
    """
    A boolean to determine whether or not the current order is being made through
    "Guest Checkout."
    """

    phone: Required[str]
    """Phone number."""

    pickup_name: Required[Annotated[str, PropertyInfo(alias="pickupName")]]

    agent_payment_reference: Annotated[str, PropertyInfo(alias="agentPaymentReference")]
    """
    A unique string to identify the booking within a payment on-account retailer's
    internal system
    """

    amount: float
    """The amount that payment_service has authorized.

    used to verify that what's been authorized on payment service, matches the cost
    platform is expecting. required for all non-todaytix retailers.
    """

    billing_zip: Annotated[str, PropertyInfo(alias="billingZip")]
    """
    Billing zip of payment method (used only in case payment method is Apple Pay
    Card or Google Pay)
    """

    checkout_type: Annotated[Literal["BASKET", "EXPRESS_PAY"], PropertyInfo(alias="checkoutType")]
    """
    The type of checkout being used. BASKET = checkout from the basket page.
    EXPRESS_PAY = express pay checkout.
    """

    click_id: Annotated[str, PropertyInfo(alias="clickId")]
    """ImpactRadius click tracking id"""

    first_name: Annotated[str, PropertyInfo(alias="firstName")]
    """
    the first name of the user ("user" because they might not be a registered
    customer).
    """

    last_name: Annotated[str, PropertyInfo(alias="lastName")]
    """
    the last name of the user ("user" because they might not be a registered
    customer).
    """

    non_commissionable_markup_per_ticket: Annotated[float, PropertyInfo(alias="nonCommissionableMarkupPerTicket")]
    """The non-commissionable markup per ticket for Prio retailers."""

    payment_details: Annotated[PaymentDetails, PropertyInfo(alias="paymentDetails")]

    payment_gateway_type: Annotated[
        Literal["PAYMENT_ON_ACCOUNT", "PAYMENT_SERVICE", "EXTERNAL_SERVICE"], PropertyInfo(alias="paymentGatewayType")
    ]
    """Supported payment gateway"""

    payment_nonce: Annotated[str, PropertyInfo(alias="paymentNonce")]
    """
    Nonce that client should get from Braintree (supports only Apple Pay Card and
    Google Pay)
    """

    paypal_device_data: Annotated[str, PropertyInfo(alias="paypalDeviceData")]
    """device data for paypal"""

    should_send_confirmation_email_override: Annotated[bool, PropertyInfo(alias="shouldSendConfirmationEmailOverride")]
    """
    An optional boolean field that will override the flag that helps identify of the
    confirmation email are to be sent by the system or not. 'null' - means we are
    not overriding anything 'true' - we are always sending confirmation email
    'false' - we are suppressing confirmation email
    """

    upgraded3d_secure_nonce: Annotated[str, PropertyInfo(alias="upgraded3dSecureNonce")]
    """
    Optional nonce based on user's credit card used by Braintree in order to adhere
    to 3DS2-compliance
    """


class PaymentDetails(TypedDict, total=False):
    apple_pay_token: Annotated[str, PropertyInfo(alias="applePayToken")]
    """token returned after Apple Pay verification"""

    billing_zip: Annotated[str, PropertyInfo(alias="billingZip")]
    """Billing zip code for card payment"""

    cvv: str
    """Card security code"""

    encrypted_card_number: Annotated[str, PropertyInfo(alias="encryptedCardNumber")]
    """Encrypted card number."""

    encrypted_expiry_month: Annotated[str, PropertyInfo(alias="encryptedExpiryMonth")]
    """Encrypted expiration month."""

    encrypted_expiry_year: Annotated[str, PropertyInfo(alias="encryptedExpiryYear")]
    """Encrypted expiration year."""

    encrypted_security_code: Annotated[str, PropertyInfo(alias="encryptedSecurityCode")]
    """Encrypted cvv code."""

    google_pay_token: Annotated[str, PropertyInfo(alias="googlePayToken")]
    """Google Pay token after verification"""

    payment_gateway_type: Annotated[
        Literal["BRAINTREE", "ADYEN", "PAYMENT_ON_ACCOUNT", "PAYMENT_SERVICE", "EXTERNAL_SERVICE"],
        PropertyInfo(alias="paymentGatewayType"),
    ]
    """Supported payment gateway"""

    payment_nonce: Annotated[str, PropertyInfo(alias="paymentNonce")]
    """Nonce returned from PSP"""

    paypal_device_data: Annotated[str, PropertyInfo(alias="paypalDeviceData")]
    """Device data for paypal"""

    upgraded3d_secure_nonce: Annotated[str, PropertyInfo(alias="upgraded3dSecureNonce")]
    """Nonce returned after 3DS verification"""
