import type * as Whop from "../index.mjs"; /** * A refund represents a full or partial reversal of a payment, including the amount, status, and payment provider. */ export interface RefundLegacy { /** The refunded amount as a decimal in the specified currency, such as 10.43 for $10.43 USD. */ amount: number; /** The datetime the refund was created. */ created_at: string; /** The three-letter ISO currency code for the refunded amount. */ currency: Whop.Currencies; /** The unique identifier for the refund. */ id: string; /** The custom metadata attached when this refund was requested. */ metadata: Record | null; /** The original payment that this refund was issued against. Null if the payment is no longer available. */ payment: RefundLegacy.Payment | null; /** The payment provider that processed the refund. */ provider: Whop.PaymentProviders; /** The timestamp when the refund was created in the payment provider's system. Null if not available from the provider. */ provider_created_at: string | null; /** The availability status of the refund tracking reference from the payment processor. Null if no reference was provided. */ reference_status: Whop.RefundReferenceStatuses | null; /** The type of tracking reference provided by the payment processor, such as an acquirer reference number. Null if no reference was provided. */ reference_type: Whop.RefundReferenceTypes | null; /** The tracking reference value from the payment processor, used to trace the refund through banking networks. Null if no reference was provided. */ reference_value: string | null; /** The current processing status of the refund, such as pending, succeeded, or failed. */ status: Whop.RefundStatuses; } export declare namespace RefundLegacy { /** * The original payment that this refund was issued against. Null if the payment is no longer available. */ interface Payment { /** The machine-readable reason this charge was created, such as initial subscription purchase, renewal cycle, or one-time payment. */ billing_reason: Whop.BillingReasons | null; /** Card network reported by the processor (e.g., 'visa', 'mastercard', 'amex'). Present only when the payment method type is 'card'. */ card_brand: Whop.CardBrands | null; /** The last four digits of the card used to make this payment. Null if the payment was not made with a card. */ card_last4: string | null; /** The datetime the payment was created. */ created_at: string; /** The three-letter ISO currency code for this payment (e.g., 'usd', 'eur'). */ currency: Whop.Currencies; /** When an alert came in that this transaction will be disputed */ dispute_alerted_at: string | null; /** The unique identifier for the payment. */ id: string; /** The member attached to this payment. */ member: Payment.Member | null; /** The membership attached to this payment. */ membership: Payment.Membership | null; /** The custom metadata stored on this payment. This will be copied over to the checkout configuration for which this payment was made */ metadata: Record | null; /** The time at which this payment was successfully collected. Null if the payment has not yet succeeded. As a Unix timestamp. */ paid_at: string | null; /** The type of payment instrument used for this payment (e.g., card, Cash App, iDEAL, Klarna, crypto). Null when the processor does not supply a type. */ payment_method_type: Whop.PaymentMethodTypes | null; /** The plan attached to this payment. */ plan: Payment.Plan | null; /** The product this payment was made for */ product: Payment.Product | null; /** The subtotal to show to the creator (excluding buyer fees). */ subtotal: number | null; /** The calculated amount of the sales/VAT tax (if applicable). */ tax_amount: number | null; /** The type of tax inclusivity applied to the payment, for determining whether the tax is included in the final price, or paid on top. */ tax_behavior: Whop.ReceiptTaxBehaviors | null; /** The amount of tax that has been refunded (if applicable). */ tax_refunded_amount: number | null; /** The total to show to the creator (excluding buyer fees). */ total: number | null; /** The total in USD to show to the creator (excluding buyer fees). */ usd_total: number | null; /** The user that made this payment. */ user: Payment.User | null; } namespace Payment { /** * The member attached to this payment. */ interface Member { /** The unique identifier for the company member. */ id: string; /** The phone number for the member, if available. */ phone: string | null; } /** * The membership attached to this payment. */ interface Membership { /** The unique identifier for the membership. */ id: string; /** The state of the membership. */ status: Whop.MembershipStatus; } /** * The plan attached to this payment. */ interface Plan { /** The unique identifier for the plan. */ id: string; /** Custom key-value pairs stored on the plan. Included in webhook payloads for payment and membership events. Max 50 keys, 100 chars per key, 500 chars per string value. The reserved keys `custom_cta` and `custom_cta_url`, when set, override the product's checkout call to action for this plan. */ metadata: Record | null; } /** * The product this payment was made for */ interface Product { /** The unique identifier for the product. */ id: string; /** Custom key-value pairs stored on the product and included in payment and membership webhook payloads. Max 50 keys, 100 characters per key, 500 characters per string value. */ metadata: Record | null; } /** * The user that made this payment. */ interface User { /** The user's email address. Requires the member:email:read permission to access. Null if not authorized. */ email: string | null; /** The unique identifier for the user. */ id: string; /** The user's display name shown on their public profile. */ name: string | null; /** The user's unique username shown on their public profile. */ username: string; } } }