import { OpenBorderApiClient, type OpenBorderMedusaPluginOptions } from '../client'; import { OpenBorderPaymentProvider } from '../payment-provider'; import type { MedusaAuthorizePaymentInput, MedusaAuthorizePaymentOutput, MedusaCancelPaymentInput, MedusaCapturePaymentInput, MedusaDeletePaymentInput, MedusaGetPaymentStatusOutput, MedusaInitiatePaymentInput, MedusaInitiatePaymentOutput, MedusaPaymentOutput, MedusaPaymentProviderInput, MedusaRefundPaymentInput, MedusaRetrievePaymentInput, MedusaUpdatePaymentInput, MedusaWebhookActionResult } from '../medusa-provider-types'; interface OpenBorderMedusaPaymentProviderOptions extends OpenBorderMedusaPluginOptions { /** Test seam; Medusa apps should configure `apiKey` and optional `baseUrl`. */ openBorderClient?: OpenBorderApiClient; } /** * Medusa v2 payment-provider runtime wrapper for Open Border. * * The class intentionally keeps Medusa-specific glue thin: it exposes the static * shape Medusa's Payment Module expects, while all money-moving behavior still * delegates to the already-tested OpenBorderPaymentProvider adapter. */ export declare class OpenBorderMedusaPaymentProviderService { static identifier: string; static _isPaymentProvider: boolean; protected readonly openBorder: OpenBorderApiClient; protected readonly provider: OpenBorderPaymentProvider; static validateOptions(options: Record): void; static isPaymentProvider(object: unknown): boolean; constructor(_container: Record | undefined, options: OpenBorderMedusaPaymentProviderOptions); getIdentifier(): string; initiatePayment(input: MedusaInitiatePaymentInput): Promise; updatePayment(input: MedusaUpdatePaymentInput): Promise; /** * Answer Medusa with the intent's authoritative status, allowing for the fact that we * hear about a completed authentication AFTER the shopper does. * * A shopper who has just passed a 3DS/SCA challenge is authenticated at the provider * before Open Border knows it: the intent moves off `requires_action` on the provider's * signed charge webhook, and this read is of our own record, never of the provider. So * an authorize called the instant the challenge closes can still see `requires_action` * — and answering `requires_more` there fails a checkout whose payment actually * succeeded. Re-read a bounded number of times instead (see * {@link AUTHORIZE_REREAD_DELAYS_MS}), and only for that one status: it is the only one * a webhook converges on its own, so waiting on any other would just be a slower way to * return the same answer. * * Giving up costs one shopper a second press, not an order: the session keeps its * intent id so completion re-drives without a second charge, and the money state is * correct throughout — it is our VIEW of it that is behind. */ authorizePayment(input: MedusaAuthorizePaymentInput): Promise; capturePayment(input: MedusaCapturePaymentInput): Promise; cancelPayment(input: MedusaCancelPaymentInput): Promise; refundPayment(input: MedusaRefundPaymentInput): Promise; retrievePayment(input: MedusaRetrievePaymentInput): Promise; deletePayment(input: MedusaDeletePaymentInput): Promise; getPaymentStatus(input: MedusaPaymentProviderInput): Promise; getWebhookActionAndData(): Promise; private createOrPreparePayment; private cancelExistingAuthorization; private existingPaymentForUpdate; private existingCanonicalPaymentForUpdate; private existingPayment; } /** * Medusa v2 Payment Module provider-registration export. * * The Payment Module loader reads `.services` off a provider entry's default export * and instantiates each service (which must carry a static `identifier`). A bare * service class as the default export is not iterable, so registering * `resolve: '@open-border/medusa-payment-openborder/providers/openborder'` — exactly as * the setup guide documents — crashed a fresh Medusa store at boot with * "moduleProviderServices is not iterable". Exporting this `{ services }` shape is what * the loader consumes. It is deliberately a plain literal (equivalent to * `ModuleProvider(Modules.PAYMENT, { services })`) so the plugin still imports no Medusa * runtime package and stays testable offline. The service class remains the named export * `OpenBorderMedusaPaymentProviderService` for consumers that instantiate it directly. */ declare const _default: { services: (typeof OpenBorderMedusaPaymentProviderService)[]; }; export default _default; //# sourceMappingURL=openborder.d.ts.map