import { ReactNode, Ref } from 'react'; import { PaymentSubmitError } from '../../components/PaymentSubmitError'; import { SavedCardProps } from '../../components/SavedCard'; export type { PaymentSubmitError } from '../../components/PaymentSubmitError'; export type PaymentSectionProps = { expressCheckoutSlot?: ReactNode; expressCheckoutLabel?: string; cardSlot?: ReactNode; cardLabel?: string; cardBrandsSlot?: ReactNode; /** * Inline card-field error (e.g. Stripe's "Your card number is invalid" / "Your card was * declined"). Rendered as a danger icon + message directly beneath the card input — host passes * the message string; the DS owns the icon, danger token, and placement (Figma 569:12568). */ cardError?: ReactNode; savedCard?: SavedCardProps; onAddCard?: () => void; addCardLabel?: string; /** Collapses the expanded "add new card" panel back to the saved card. */ onCancel?: () => void; cancelLabel?: string; /** * Controlled open state for the "add new card" panel. When provided, the host fully owns the * panel and MUST update this value to open it — the component will not open on its own. Wire the * host's `onAddCard` (and `savedCard.onEdit` when `savedCard` is set) to set this `true`, kept in * sync with the host's card view (e.g. express checkout). When omitted, the panel manages its own * open state internally. */ addCardOpen?: boolean; manualCardEntry?: boolean; manualEntryLabel?: string; /** Read-only shipping address (rendered in a ShippingRow with an EDIT action). */ shippingAddress?: ReactNode; /** * Raw shipping content rendered without the read-only ShippingRow wrapper — e.g. a host's * interactive address form. Takes precedence over `shippingAddress`/`onEditAddress`. */ shippingSlot?: ReactNode; shippingLabel?: string; onEditAddress?: () => void; editLabel?: string; /** * Legal acknowledgment copy shown above the CTA. Consent is given by submitting — there is no * checkbox to tick — so the copy should reference the submit action. */ consent?: ReactNode; ctaText?: string; onSubmit: () => void; submitting?: boolean; submitDisabled?: boolean; /** * Order/submit-level error shown directly beneath the CTA (e.g. "Something went wrong. Please * message us." on a failed charge). The host passes the message + optional contact handler; the * component renders the danger treatment + link. Mirrors legacy's under-CTA placement. */ submitError?: PaymentSubmitError; footerNote?: ReactNode; /** Ref to the inline submit button — the host observes it to hide the sticky footer once the real * CTA is on screen (so the inline and floating CTAs never show at once). */ submitRef?: Ref; }; export declare const PaymentSection: ({ expressCheckoutSlot, expressCheckoutLabel, cardSlot, cardLabel, cardBrandsSlot, cardError, savedCard, onAddCard, addCardLabel, onCancel, cancelLabel, addCardOpen, manualCardEntry, manualEntryLabel, shippingAddress, shippingSlot, shippingLabel, onEditAddress, editLabel, consent, ctaText, onSubmit, submitting, submitDisabled, submitError, footerNote, submitRef, }: PaymentSectionProps) => import("react").JSX.Element;