* feat(payments): Refactor core Payment related * fix(medusa): typings * test(unit): fix suite * test(unit): fix suite * feat(medusa): Improve payment provider container typings * fix(medusa): typings * styles(medusa): renove comments * feat(medusa): cleanup * feat(medusa): Add uniq constraint on payment session and idem key on create-payment-session end point * fix(medusa): migration * fix(medusa): create payment session * feat(medusa): cleanup
60 lines
952 B
JavaScript
60 lines
952 B
JavaScript
import { AbstractPaymentService } from "@medusajs/medusa";
|
|
|
|
class TestPayService extends AbstractPaymentService {
|
|
static identifier = "test-pay";
|
|
|
|
constructor(_) {
|
|
super(_);
|
|
}
|
|
|
|
async getStatus(paymentData) {
|
|
return "authorized";
|
|
}
|
|
|
|
async retrieveSavedMethods(customer) {
|
|
return Promise.resolve([]);
|
|
}
|
|
|
|
async createPayment() {
|
|
return {};
|
|
}
|
|
|
|
async retrievePayment(data) {
|
|
return {};
|
|
}
|
|
|
|
async getPaymentData(sessionData) {
|
|
return {};
|
|
}
|
|
|
|
async authorizePayment(sessionData, context = {}) {
|
|
return {};
|
|
}
|
|
|
|
async updatePaymentData(sessionData, update) {
|
|
return {};
|
|
}
|
|
|
|
async updatePayment(sessionData, cart) {
|
|
return {};
|
|
}
|
|
|
|
async deletePayment(payment) {
|
|
return {};
|
|
}
|
|
|
|
async capturePayment(payment) {
|
|
return {};
|
|
}
|
|
|
|
async refundPayment(payment, amountToRefund) {
|
|
return {};
|
|
}
|
|
|
|
async cancelPayment(payment) {
|
|
return {};
|
|
}
|
|
}
|
|
|
|
export default TestPayService;
|