import { PoolClient } from '@evershop/postgres-query-builder'; import type Stripe from 'stripe'; /** * Money in from a Stripe PaymentIntent, shared by the webhook * (`payment_intent.succeeded` / `amount_capturable_updated`) and the * abandoned order job (the fallback for a webhook that never arrived). * * The caller holds the order row locked (`FOR UPDATE`) in a transaction on * `connection`, and has checked that the intent belongs to this Stripe order * and matches its amount (`paymentIntentMatchesOrder`). Writes the payment * transaction (idempotent); the first time only, sets the status, logs, and * places the order (`markOrderPlaced`, on this connection, so `order_placed` * lives or dies with the status update). */ interface LockedOrder { order_id: number; } /** Whether this intent was recorded for this order already (decide under the row lock) */ export declare function isPaymentIntentRecorded(connection: PoolClient, orderId: number, paymentIntentId: string): Promise; /** `succeeded`: the money is captured */ export declare function recordStripeCapture(connection: PoolClient, order: LockedOrder, paymentIntent: Stripe.PaymentIntent, alreadyProcessed: boolean): Promise; /** `requires_capture`: the money is authorized, to capture later */ export declare function recordStripeAuthorization(connection: PoolClient, order: LockedOrder, paymentIntent: Stripe.PaymentIntent, alreadyProcessed: boolean): Promise; export {};