# -*- coding: utf-8 -*-
# File generated from our OpenAPI spec
from stripe._request_options import RequestOptions
from stripe._stripe_object import UntypedStripeObject
from typing import Dict, List
from typing_extensions import Literal, NotRequired, TypedDict


class PaymentAttemptRecordReportRefundParams(RequestOptions):
    amount: NotRequired["PaymentAttemptRecordReportRefundParamsAmount"]
    """
    A positive integer in the [smallest currency unit](https://docs.stripe.com/currencies#zero-decimal) representing how much of this payment to refund. Can refund only up to the remaining, unrefunded amount of the payment.
    """
    expand: NotRequired[List[str]]
    """
    Specifies which fields in the response should be expanded.
    """
    failed: NotRequired["PaymentAttemptRecordReportRefundParamsFailed"]
    """
    Information about the refund failure.
    """
    initiated_at: NotRequired[int]
    """
    When the reported refund was initiated. Measured in seconds since the Unix epoch.
    """
    metadata: NotRequired[
        "Literal['']|Dict[str, str]|UntypedStripeObject[str]"
    ]
    """
    Set of [key-value pairs](https://docs.stripe.com/api/metadata) that you can attach to an object. This can be useful for storing additional information about the object in a structured format. Individual keys can be unset by posting an empty value to them. All keys can be unset by posting an empty value to `metadata`.
    """
    outcome: NotRequired[Literal["failed", "refunded"]]
    """
    The outcome of the reported refund.
    """
    processor_details: "PaymentAttemptRecordReportRefundParamsProcessorDetails"
    """
    Processor information for this refund.
    """
    reason: NotRequired[
        Literal["duplicate", "fraudulent", "requested_by_customer"]
    ]
    """
    The reason for the refund. One of `duplicate`, `fraudulent`, or `requested_by_customer`.
    """
    refund_group: NotRequired[str]
    """
    A key to group refunds together.
    """
    refunded: NotRequired["PaymentAttemptRecordReportRefundParamsRefunded"]
    """
    Information about the payment attempt refund.
    """


class PaymentAttemptRecordReportRefundParamsAmount(TypedDict):
    currency: str
    """
    Three-letter [ISO currency code](https://www.iso.org/iso-4217-currency-codes.html), in lowercase. Must be a [supported currency](https://stripe.com/docs/currencies).
    """
    value: int
    """
    A positive integer representing the amount in the currency's [minor unit](https://docs.stripe.com/currencies#zero-decimal). For example, `100` can represent 1 USD or 100 JPY.
    """


class PaymentAttemptRecordReportRefundParamsFailed(TypedDict):
    failed_at: NotRequired[int]
    """
    When the reported refund failed. Measured in seconds since the Unix epoch.
    """
    failure_reason: NotRequired[
        Literal[
            "charge_for_pending_refund_disputed",
            "declined",
            "expired_or_canceled_card",
            "insufficient_funds",
            "lost_or_stolen_card",
            "merchant_request",
            "unknown",
        ]
    ]
    """
    Provides the reason for the refund failure. Possible values are: `lost_or_stolen_card`, `expired_or_canceled_card`, `charge_for_pending_refund_disputed`, `insufficient_funds`, `declined`, `merchant_request`, or `unknown`.
    """


class PaymentAttemptRecordReportRefundParamsProcessorDetails(TypedDict):
    custom: NotRequired[
        "PaymentAttemptRecordReportRefundParamsProcessorDetailsCustom"
    ]
    """
    Information about the custom processor used to make this refund.
    """
    type: Literal["custom"]
    """
    The type of the processor details. An additional hash is included on processor_details with a name matching this value. It contains additional information specific to the processor.
    """


class PaymentAttemptRecordReportRefundParamsProcessorDetailsCustom(TypedDict):
    refund_reference: str
    """
    A reference to the external refund. This field must be unique across all refunds.
    """


class PaymentAttemptRecordReportRefundParamsRefunded(TypedDict):
    refunded_at: int
    """
    When the reported refund completed. Measured in seconds since the Unix epoch.
    """
