import crypto from "crypto" import { AuthorizePaymentInput, AuthorizePaymentOutput, CancelPaymentInput, CancelPaymentOutput, CapturePaymentInput, CapturePaymentOutput, CreateAccountHolderInput, CreateAccountHolderOutput, DeleteAccountHolderInput, DeleteAccountHolderOutput, DeletePaymentInput, DeletePaymentOutput, GetPaymentStatusInput, GetPaymentStatusOutput, InitiatePaymentInput, InitiatePaymentOutput, ProviderWebhookPayload, RefundPaymentInput, RefundPaymentOutput, RetrievePaymentInput, RetrievePaymentOutput, UpdatePaymentInput, UpdatePaymentOutput, WebhookActionResult, } from "@medusajs/framework/types" import { AbstractPaymentProvider, PaymentActions, PaymentSessionStatus, } from "@medusajs/framework/utils" export class SystemProviderService extends AbstractPaymentProvider { static identifier = "system" async getStatus(_): Promise { return "authorized" } async getPaymentData(_): Promise> { return {} } async initiatePayment( input: InitiatePaymentInput ): Promise { return { data: {}, id: crypto.randomUUID() } } async getPaymentStatus( input: GetPaymentStatusInput ): Promise { throw new Error("Method not implemented.") } async retrievePayment( input: RetrievePaymentInput ): Promise { return {} } async authorizePayment( input: AuthorizePaymentInput ): Promise { return { data: {}, status: PaymentSessionStatus.AUTHORIZED } } async updatePayment(input: UpdatePaymentInput): Promise { return { data: {} } } async deletePayment(input: DeletePaymentInput): Promise { return { data: {} } } async capturePayment( input: CapturePaymentInput ): Promise { return { data: {} } } async createAccountHolder( input: CreateAccountHolderInput ): Promise { return { id: input.context.customer.id } } async deleteAccountHolder( input: DeleteAccountHolderInput ): Promise { return { data: {} } } async refundPayment(input: RefundPaymentInput): Promise { return { data: {} } } async cancelPayment(input: CancelPaymentInput): Promise { return { data: {} } } async getWebhookActionAndData( data: ProviderWebhookPayload["payload"] ): Promise { return { action: PaymentActions.NOT_SUPPORTED } } } export default SystemProviderService