import type { PaymentChoice } from "../checkout-types.js"; export interface UseCollectPaymentOptions { /** * Provider id registered in checkout's `paymentStarters` map. Only used * when the choice is `send_link`. Defaults to `"netopia"` since that's * the only processor in tree today; pass explicitly when adding others. */ cardProvider?: string; /** Payer email — used as the recipient for the payment-link notification. */ payerEmail?: string | null; /** Payer name — passed through to the payment session (display only). */ payerName?: string | null; /** * Customer-facing language for the processor's hosted payment page (e.g. * the picked CRM person's `preferredLanguage`, the booking locale, or the * operator's current locale). When omitted, falls back to the processor's * deploy-wide default (e.g. `NETOPIA_LANGUAGE`). * * Forwarded to `startProvider.payload.language` — Netopia honors it for * its hosted page; other processors map their own equivalent field. */ payerLanguage?: string | null; /** * Where the customer's browser should land after a successful (or * cancelled) payment on the processor's hosted page. Storefronts pass * their own confirmation route; operator-initiated send-link flows * typically leave this unset and let the deploy-wide * `NETOPIA_REDIRECT_URL` point at the public `/pay/:sessionId` landing. */ returnUrl?: string | null; cancelUrl?: string | null; /** Optional vertical-supplied notes attached to the collection. */ notes?: string | null; } export interface CollectPaymentInput { choice: PaymentChoice; amountCents: number; } /** * Higher-level collection hook: takes a `PaymentChoice` from `` * and translates it into the appropriate `initiateCheckoutCollection` call. * * Routes: * - `hold` → creates a payment session, starts the configured card * processor (so `redirectUrl` is populated), and returns the result. * The customer-facing card vs bank-transfer choice happens later on * the public `/pay/:sessionId` landing page; the admin's job is just * to produce that link and share it. * - any other → throws. `saved_method` / `new_card` / `extra` are * vertical-specific (immediate-charge or vertical action) and the * parent handles them by calling `useInitiateCheckoutCollection` * directly with its own request body. */ export declare function useCollectPayment(bookingId: string, options?: UseCollectPaymentOptions): import("@tanstack/react-query").UseMutationResult<{ plan: { bookingId: string; method: "bank_transfer" | "card"; stage: "manual" | "initial" | "reminder"; paymentSessionTarget: "invoice" | "schedule" | null; documentType: "invoice" | "proforma" | null; willCreateDefaultPaymentPlan: boolean; selectedSchedule: { id: string; bookingId: string; bookingItemId: string | null; scheduleType: string; status: string; dueDate: string; currency: string; amountCents: number; notes: string | null; } | null; selectedInvoice: { id: string; invoiceNumber: string; invoiceType: string; bookingId: string; personId: string | null; organizationId: string | null; status: string; currency: string; totalCents: number; paidCents: number; balanceDueCents: number; issueDate: string; dueDate: string; notes: string | null; createdAt: string; updatedAt: string; } | null; amountCents: number; currency: string; recommendedAction: "none" | "create_bank_transfer_document" | "create_payment_session" | "create_invoice_then_payment_session"; }; invoice: { id: string; invoiceNumber: string; invoiceType: string; bookingId: string; personId: string | null; organizationId: string | null; status: string; currency: string; totalCents: number; paidCents: number; balanceDueCents: number; issueDate: string; dueDate: string; notes: string | null; createdAt: string; updatedAt: string; } | null; paymentSession: { legacyOrderId: string | null; providerConnectionId: string | null; target: { type: "booking_session"; bookingSessionId: string; } | { type: "booking"; bookingId: string; } | { type: "invoice"; invoiceId: string; } | { type: "booking_payment_schedule"; bookingPaymentScheduleId: string; } | { type: "booking_guarantee"; bookingGuaranteeId: string; } | { type: "flight_order"; flightOrderId: string; } | { type: "program"; programId: string; } | { type: "supplier_settlement"; supplierSettlementId: string; } | { type: "channel_settlement"; channelSettlementId: string; } | { type: "provider_reference"; provider: string; reference: string; } | { type: "legacy_order"; legacyOrderId: string; } | null; provenance: { source: "other" | "operator" | "storefront" | "customer_portal" | "payment_provider" | "supplier_channel" | "migration"; provider?: string | null | undefined; reference?: string | null | undefined; idempotencyKey?: string | null | undefined; } | null; id: string; targetType: "invoice" | "other" | "booking_session" | "booking" | "order" | "booking_payment_schedule" | "booking_guarantee" | "flight_order"; targetId: string | null; bookingId: string | null; invoiceId: string | null; bookingPaymentScheduleId: string | null; bookingGuaranteeId: string | null; status: "paid" | "pending" | "failed" | "requires_redirect" | "processing" | "authorized" | "cancelled" | "expired"; provider: string | null; providerSessionId: string | null; providerPaymentId: string | null; externalReference: string | null; clientReference: string | null; currency: string; amountCents: number; paymentMethod: "bank_transfer" | "credit_card" | "debit_card" | "cash" | "cheque" | "wallet" | "direct_bill" | "travel_credit" | "other" | null; payerEmail: string | null; payerName: string | null; redirectUrl: string | null; returnUrl: string | null; cancelUrl: string | null; expiresAt: string | null; completedAt: string | null; failureCode: string | null; failureMessage: string | null; notes: string | null; } | null; invoiceNotification: { id: string; templateSlug: string | null; channel: "email" | "sms"; provider: string; status: "pending" | "failed" | "cancelled" | "sent"; toAddress: string; subject: string | null; sentAt: string | null; failedAt: string | null; errorMessage: string | null; } | null; paymentSessionNotification: { id: string; templateSlug: string | null; channel: "email" | "sms"; provider: string; status: "pending" | "failed" | "cancelled" | "sent"; toAddress: string; subject: string | null; sentAt: string | null; failedAt: string | null; errorMessage: string | null; } | null; bankTransferInstructions: { provider: string | null; invoiceId: string; invoiceNumber: string; documentType: "invoice" | "proforma"; amountCents: number; currency: string; dueDate: string | null; beneficiary: string; iban: string; bankName: string | null; notes: string | null; } | null; providerStart: { provider: string; paymentSessionId: string; redirectUrl: string | null; externalReference: string | null; providerSessionId: string | null; providerPaymentId: string | null; response: Record | null; } | null; }, Error, CollectPaymentInput, unknown>;