* chore: Update modules providers configuration with 'identifier' and 'PROVIDER' * update check * fix tests * type * normalize auth provider * emailpass * providers --------- Co-authored-by: Carlos R. L. Rodrigues <rodrigolr@gmail.com> Co-authored-by: Carlos R. L. Rodrigues <37986729+carlos-r-l-rodrigues@users.noreply.github.com>
83 lines
1.9 KiB
TypeScript
83 lines
1.9 KiB
TypeScript
import {
|
|
CreatePaymentProviderSession,
|
|
PaymentProviderError,
|
|
PaymentProviderSessionResponse,
|
|
ProviderWebhookPayload,
|
|
WebhookActionResult,
|
|
} from "@medusajs/framework/types"
|
|
import {
|
|
AbstractPaymentProvider,
|
|
PaymentActions,
|
|
PaymentSessionStatus,
|
|
} from "@medusajs/framework/utils"
|
|
|
|
export class SystemProviderService extends AbstractPaymentProvider {
|
|
static identifier = "system"
|
|
|
|
async getStatus(_): Promise<string> {
|
|
return "authorized"
|
|
}
|
|
|
|
async getPaymentData(_): Promise<Record<string, unknown>> {
|
|
return {}
|
|
}
|
|
|
|
async initiatePayment(
|
|
context: CreatePaymentProviderSession
|
|
): Promise<PaymentProviderSessionResponse> {
|
|
return { data: {} }
|
|
}
|
|
|
|
async getPaymentStatus(
|
|
paymentSessionData: Record<string, unknown>
|
|
): Promise<PaymentSessionStatus> {
|
|
throw new Error("Method not implemented.")
|
|
}
|
|
|
|
async retrievePayment(
|
|
paymentSessionData: Record<string, unknown>
|
|
): Promise<Record<string, unknown> | PaymentProviderError> {
|
|
return {}
|
|
}
|
|
|
|
async authorizePayment(_): Promise<
|
|
| PaymentProviderError
|
|
| {
|
|
status: PaymentSessionStatus
|
|
data: PaymentProviderSessionResponse["data"]
|
|
}
|
|
> {
|
|
return { data: {}, status: PaymentSessionStatus.AUTHORIZED }
|
|
}
|
|
|
|
async updatePayment(
|
|
_
|
|
): Promise<PaymentProviderError | PaymentProviderSessionResponse> {
|
|
return { data: {} } as PaymentProviderSessionResponse
|
|
}
|
|
|
|
async deletePayment(_): Promise<Record<string, unknown>> {
|
|
return {}
|
|
}
|
|
|
|
async capturePayment(_): Promise<Record<string, unknown>> {
|
|
return {}
|
|
}
|
|
|
|
async refundPayment(_): Promise<Record<string, unknown>> {
|
|
return {}
|
|
}
|
|
|
|
async cancelPayment(_): Promise<Record<string, unknown>> {
|
|
return {}
|
|
}
|
|
|
|
async getWebhookActionAndData(
|
|
data: ProviderWebhookPayload["payload"]
|
|
): Promise<WebhookActionResult> {
|
|
return { action: PaymentActions.NOT_SUPPORTED }
|
|
}
|
|
}
|
|
|
|
export default SystemProviderService
|