import { ServiceProvider } from "@entity-access/entity-access/dist/di/di.js"; import { StoreJournal } from "../../model/entities/StoreJournal.js"; import type StorePaymentAttempt from "../../model/entities/StorePaymentAttempt.js"; import StorePaymentGateway from "../../model/entities/StorePaymentGateway.js"; import type { paymentStatusType } from "../../model/entities/StorePaymentAttempt.js"; export default abstract class LedgerPaymentGateway { static async for(sp: any, name: string) { const { default: GatewayClass} = await import("./gateways/" + name + ".js"); return ServiceProvider.create(sp, GatewayClass) as LedgerPaymentGateway; } abstract createPayment(host: string, gateway: StorePaymentGateway, order: StoreJournal, pa: StorePaymentAttempt); abstract getStatus(pa: StorePaymentAttempt): Promise; abstract refund(pa: StorePaymentAttempt): Promise<"refunded" | void>; // abstract createSubscription(p1: ICreateSubscriptionRequest): Promise<{ url?, content? }>; // abstract fetchSubscriptionInfo(pgSubscription: StorePGSubscription): Promise<{ active?, error? }>; // abstract createPlan(gateway: StorePaymentGateway, itemPrice: StoreItemPrice): Promise<{ id: string }>; }