Skip to content

Commit

Permalink
feat(medusa): Convert SystemPaymentProvider to TypeScript (#1988)
Browse files Browse the repository at this point in the history
**What**
- convert system payment provider to typescript

Fixes CORE-397

Co-authored-by: Oliver Windall Juhl <59018053+olivermrbl@users.noreply.github.com>
  • Loading branch information
pKorsholm and olivermrbl authored Aug 22, 2022
1 parent c97ccd3 commit 80e0213
Show file tree
Hide file tree
Showing 3 changed files with 60 additions and 51 deletions.
5 changes: 5 additions & 0 deletions .changeset/thick-cows-guess.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"@medusajs/medusa": patch
---

Convert SystemPaymentProvider to TypeScript
51 changes: 0 additions & 51 deletions packages/medusa/src/services/system-payment-provider.js

This file was deleted.

55 changes: 55 additions & 0 deletions packages/medusa/src/services/system-payment-provider.ts
Original file line number Diff line number Diff line change
@@ -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<Record<string, unknown>> {
return {}
}

async getStatus(_): Promise<string> {
return "authorized"
}

async getPaymentData(_): Promise<Record<string, unknown>> {
return {}
}

async authorizePayment(_): Promise<Record<string, unknown>> {
return { data: {}, status: "authorized" }
}

async updatePaymentData(_): Promise<Record<string, unknown>> {
return {}
}

async updatePayment(_): Promise<Record<string, unknown>> {
return {}
}

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 {}
}
}

export default SystemProviderService

0 comments on commit 80e0213

Please sign in to comment.