From 80e02130b4a444287920989654b607f07dd8d4f8 Mon Sep 17 00:00:00 2001 From: Philip Korsholm <88927411+pKorsholm@users.noreply.github.com> Date: Mon, 22 Aug 2022 19:37:25 +0200 Subject: [PATCH] feat(medusa): Convert SystemPaymentProvider to TypeScript (#1988) **What** - convert system payment provider to typescript Fixes CORE-397 Co-authored-by: Oliver Windall Juhl <59018053+olivermrbl@users.noreply.github.com> --- .changeset/thick-cows-guess.md | 5 ++ .../src/services/system-payment-provider.js | 51 ----------------- .../src/services/system-payment-provider.ts | 55 +++++++++++++++++++ 3 files changed, 60 insertions(+), 51 deletions(-) create mode 100644 .changeset/thick-cows-guess.md delete mode 100644 packages/medusa/src/services/system-payment-provider.js create mode 100644 packages/medusa/src/services/system-payment-provider.ts diff --git a/.changeset/thick-cows-guess.md b/.changeset/thick-cows-guess.md new file mode 100644 index 0000000000000..5f78a673733a4 --- /dev/null +++ b/.changeset/thick-cows-guess.md @@ -0,0 +1,5 @@ +--- +"@medusajs/medusa": patch +--- + +Convert SystemPaymentProvider to TypeScript diff --git a/packages/medusa/src/services/system-payment-provider.js b/packages/medusa/src/services/system-payment-provider.js deleted file mode 100644 index 737c7490a0daf..0000000000000 --- a/packages/medusa/src/services/system-payment-provider.js +++ /dev/null @@ -1,51 +0,0 @@ -import { TransactionBaseService } from "../interfaces" - -class SystemProviderService extends TransactionBaseService { - static identifier = "system" - - constructor(_) { - super(_) - } - - async createPayment(_) { - return {} - } - - async getStatus(_) { - return "authorized" - } - - async getPaymentData(_) { - return {} - } - - async authorizePayment(_) { - return { data: {}, status: "authorized" } - } - - async updatePaymentData(_) { - return {} - } - - async updatePayment(_) { - return {} - } - - async deletePayment(_) { - return {} - } - - async capturePayment(_) { - return {} - } - - async refundPayment(_) { - return {} - } - - async cancelPayment(_) { - return {} - } -} - -export default SystemProviderService diff --git a/packages/medusa/src/services/system-payment-provider.ts b/packages/medusa/src/services/system-payment-provider.ts new file mode 100644 index 0000000000000..65ae67fc7daa7 --- /dev/null +++ b/packages/medusa/src/services/system-payment-provider.ts @@ -0,0 +1,55 @@ +import { EntityManager } from "typeorm" +import { TransactionBaseService } from "../interfaces/transaction-base-service" + +class SystemProviderService extends TransactionBaseService { + protected manager_: EntityManager + protected transactionManager_: EntityManager | undefined + + static identifier = "system" + + constructor(_) { + super(_) + } + + async createPayment(_): Promise> { + return {} + } + + async getStatus(_): Promise { + return "authorized" + } + + async getPaymentData(_): Promise> { + return {} + } + + async authorizePayment(_): Promise> { + return { data: {}, status: "authorized" } + } + + async updatePaymentData(_): Promise> { + return {} + } + + async updatePayment(_): Promise> { + return {} + } + + async deletePayment(_): Promise> { + return {} + } + + async capturePayment(_): Promise> { + return {} + } + + async refundPayment(_): Promise> { + return {} + } + + async cancelPayment(_): Promise> { + return {} + } +} + +export default SystemProviderService