/** * Express Payment Methods Context Provider using v2 Architecture * Manages express payment methods (Apple Pay, Google Pay, PayPal, Klarna) * * Payment methods are resolved from: * 1. paymentSetupConfig prop (from __TGD_STEP_CONFIG__ or useStepConfig) * 2. API fallback (GET /api/v1/payment-methods) for legacy integrations */ import React, { ReactNode } from 'react'; import { TagadaError } from '../../core/errors'; import type { PaymentSetupConfig } from '../../core/funnelClient'; import { CheckoutData } from '../../core/resources/checkout'; import { Address, PaymentMethod } from '../../core/resources/expressPaymentMethods'; type ExpressOrderLineItem = { label: string; amount: string; }; type ExpressShippingMethod = { label: string; amount: string; identifier: string; detail: string; }; interface ExpressPaymentMethodsContextType { paymentMethods: PaymentMethod[] | undefined; applePayPaymentMethod?: PaymentMethod; googlePayPaymentMethod?: PaymentMethod; paypalPaymentMethod?: PaymentMethod; klarnaPaymentMethod?: PaymentMethod; stripeExpressPaymentMethod?: PaymentMethod; availableExpressPaymentMethodIds: string[]; setAvailableExpressPaymentMethodIds: (value: string[]) => void; handleAddExpressId: (id: string) => void; shippingMethods: ExpressShippingMethod[]; lineItems: ExpressOrderLineItem[]; reComputeOrderSummary: () => Promise<{ lineItems: ExpressOrderLineItem[]; total: { label: string; amount: string; }; shippingMethods: ExpressShippingMethod[]; selectedShippingRateId?: string; } | undefined>; updateCheckoutSessionValues: (input: { data: { shippingAddress: Address; billingAddress?: Address | null; }; }) => Promise; updateCustomerEmail: (input: { data: { email: string; }; }) => Promise; loading?: boolean; error: TagadaError | null; setError: (error: string | null) => void; } interface ExpressPaymentMethodsProviderProps { children: ReactNode; customerId?: string; checkout?: CheckoutData; /** Step-level payment config from __TGD_STEP_CONFIG__ / useStepConfig(). */ paymentSetupConfig?: PaymentSetupConfig; } export declare const ExpressPaymentMethodsContext: React.Context; export declare const ExpressPaymentMethodsProvider: React.FC; export type { ExpressPaymentMethodsContextType, ExpressPaymentMethodsProviderProps };