const API = require("../../lib/API") const { BaseStdResponse } = require("../../BaseStdResponse") const { getPaymentMethods } = require("../../lib/OrderPayment") class GetPaymentMethods extends API { constructor() { super() this.setPath('/Order/PaymentMethods') this.setMethod('GET') } async onRequest(req, res) { try { const methods = await getPaymentMethods() return res.json({ ...BaseStdResponse.OK, data: methods }) } catch (error) { this.logger.error(`获取支付方式失败:${error.stack || error}`) return res.json({ ...BaseStdResponse.OK, data: [] }) } } } module.exports.GetPaymentMethods = GetPaymentMethods