init
This commit is contained in:
24
api/controller_admin/biz_payment.js
Normal file
24
api/controller_admin/biz_payment.js
Normal file
@@ -0,0 +1,24 @@
|
||||
const logic = require("../service/biz_subscription_logic");
|
||||
|
||||
function getRequestBody(ctx) {
|
||||
if (ctx.request && ctx.request.body && Object.keys(ctx.request.body).length > 0) {
|
||||
return ctx.request.body;
|
||||
}
|
||||
if (typeof ctx.getBody === "function") {
|
||||
return ctx.getBody() || {};
|
||||
}
|
||||
return {};
|
||||
}
|
||||
|
||||
module.exports = {
|
||||
"POST /biz_payment/confirm-offline": async (ctx) => {
|
||||
const body = getRequestBody(ctx);
|
||||
const row = await logic.confirmOfflinePayment(body);
|
||||
ctx.success(row);
|
||||
},
|
||||
"POST /biz_payment/confirm-link": async (ctx) => {
|
||||
const body = getRequestBody(ctx);
|
||||
const row = await logic.confirmLinkPayment(body);
|
||||
ctx.success(row);
|
||||
},
|
||||
};
|
||||
Reference in New Issue
Block a user