import { StripeConstructorOptions, Stripe as StripeDefault } from "@stripe/stripe-js"; /** * Stripe default interface with internal properties */ export interface StripeDefaultWithInternal extends StripeDefault { /** * Stripe api key after initialization, like pk_... */ _apiKey: string; } /** * Base interface for Stripe extension methods */ export interface StripeExtensionMethods { /** * Confirm payment intent by card */ confirmPaymentIntentByCard(clientSecret: string, cardId: string, returnUrl: string): Promise; /** * Confirm payment intent by payment method */ confirmPaymentIntentByPaymentMethod(clientSecret: string, paymentMethodId: string, returnUrl: string): Promise; /** * Add source to customer */ addSourceToCustomer(token: string, customerId: string, ephemeralKey: string): Promise; /** * Delete source from customer */ deleteSourceFromCustomer(sourceId: string, customerId: string, ephemeralKey: string): Promise; /** * Get all cards for customer */ getAllCards(customerId: string, ephemeralKey: string): Promise; /** * Get customer data */ getCustomer(customerId: string, ephemeralKey: string): Promise; /** * Get default card */ getDefaultCard(customerId: string, ephemeralKey: string): Promise; /** * Set default card */ setDefaultCard(cardId: string, customerId: string, ephemeralKey: string): Promise; /** * Add payment method to customer */ addPaymentMethodToCustomer(paymentMethodId: string, customerId: string, ephemeralKey: string): Promise; /** * Delete payment method from customer */ deletePaymentMethodFromCustomer(paymentMethodId: string, ephemeralKey: string): Promise; /** * Get all payment methods for customer */ getAllPaymentMethods(customerId: string, ephemeralKey: string): Promise; /** * Set default payment method */ setDefaultPaymentMethod(paymentMethodId: string, customerId: string, ephemeralKey: string): Promise; } /** * Extended Stripe interface combining default Stripe with extensions */ export interface Stripe extends StripeExtensionMethods, StripeDefault { } /** * Load Stripe function type */ export type LoadStripeFunction = (publishableKey: string, options?: StripeConstructorOptions) => Promise;