- All schemas have been rewritten to a relational model - All services have been rewritten to accommodate the new data model - Adds idempotency keys to core endpoints allowing you to retry requests with no additional side effects - Adds staged jobs to avoid putting jobs in the queue when transactions abort - Adds atomic transactions to all methods with access to the data layer Co-authored-by: Oliver Windall Juhl <oliver@mrbltech.com>
63 lines
1.4 KiB
JavaScript
63 lines
1.4 KiB
JavaScript
import _ from "lodash"
|
|
import { PaymentService } from "medusa-interfaces"
|
|
|
|
class CardAdyenService extends PaymentService {
|
|
static identifier = "scheme-adyen"
|
|
|
|
constructor({ adyenService }) {
|
|
super()
|
|
|
|
this.adyenService_ = adyenService
|
|
}
|
|
|
|
async retrieveSavedMethods(customer) {
|
|
return this.adyenService_.retrieveSavedMethods(customer)
|
|
}
|
|
|
|
async getStatus(paymentData) {
|
|
return this.adyenService_.getStatus(paymentData)
|
|
}
|
|
|
|
async createPayment(data) {
|
|
return this.adyenService_.createPayment(data)
|
|
}
|
|
|
|
async authorizePayment(sessionData, context) {
|
|
return this.adyenService_.authorizePayment(sessionData, context)
|
|
}
|
|
|
|
async retrievePayment(data) {
|
|
return this.adyenService_.retrievePayment(data)
|
|
}
|
|
|
|
async getPaymentData(data) {
|
|
return this.adyenService_.getPaymentData(data)
|
|
}
|
|
|
|
async updatePayment(data, _) {
|
|
return this.adyenService_.updatePayment(data)
|
|
}
|
|
|
|
async updatePaymentData(sessionData, update) {
|
|
return this.adyenService_.updatePaymentData(sessionData, update)
|
|
}
|
|
|
|
async deletePayment(data) {
|
|
return this.adyenService_.deletePayment(data)
|
|
}
|
|
|
|
async capturePayment(data) {
|
|
return this.adyenService_.capturePayment(data)
|
|
}
|
|
|
|
async refundPayment(data, amountToRefund) {
|
|
return this.adyenService_.refundPayment(data, amountToRefund)
|
|
}
|
|
|
|
async cancelPayment(data) {
|
|
return this.adyenService_.cancelPayment(data)
|
|
}
|
|
}
|
|
|
|
export default CardAdyenService
|