import { ChannelService, OrderService, PaymentMethodService, RequestContextService, TransactionalConnection } from '@vendure/core'; import type { Response } from 'express'; import { StripeService } from './stripe.service'; import { RequestWithRawBody, StripePluginOptions } from './types'; export declare class StripeController { private options; private paymentMethodService; private orderService; private stripeService; private requestContextService; private connection; private channelService; constructor(options: StripePluginOptions, paymentMethodService: PaymentMethodService, orderService: OrderService, stripeService: StripeService, requestContextService: RequestContextService, connection: TransactionalConnection, channelService: ChannelService); webhook(signature: string | undefined, request: RequestWithRawBody, response: Response): Promise; /** * Captures the funds held for an `Authorized` payment and then settles the payment. Must be * called outside of any database transaction: Stripe is called first, so that a capture can * only be followed by a short, database-only transaction that records it. * * If the process stops after the capture, or the settlement fails, the payment stays * `Authorized` and is settled by the `payment_intent.succeeded` webhook or by a redelivery of * the authorization event. A temporary Stripe error is thrown so the webhook responds with a 5xx. */ private captureAndSettle; /** * Settles the payment for a PaymentIntent that Stripe has captured, but only if it is still * `Authorized`. Returns whether a payment was settled. Must run in a transaction that already * holds the order lock; it makes no Stripe calls. */ private settleCapturedPayment; /** * Whether the funds held for an order's `Authorized` payment may be captured. Vendure moves the * order to `PaymentAuthorized`, allocating stock, only once its payments cover the total. An * additional payment for a modified order leaves it in `ArrangingAdditionalPayment`, so there * the payments are checked directly. */ private isReadyForCapture; /** * Cancels the payment for a PaymentIntent that Stripe has cancelled, but only if it is still * `Authorized`. Returns whether a payment was cancelled. Must run in a transaction that already * holds the order lock; it makes no Stripe calls. */ private cancelVoidedPayment; /** * Takes a row lock on the order for the rest of the current transaction. Skipped on SQLite * drivers, which don't support row locks and only allow one writer at a time anyway. */ private lockOrderForUpdate; private createContext; private getPaymentMethod; }