Commit 4f742b67 authored by Hsinli's avatar Hsinli

Merge branch 'master' of t-git.51gjj.com:fangbin/51business

parents 7880190a c93218df
Pipeline #13690 passed with stage
in 26 seconds
......@@ -4,6 +4,7 @@ const Controller = require('egg').Controller;
const xml2js = require('xml2js').parseString;
class OrderController extends Controller {
//订单支付详情页信息
async getOrderPayInfo() {
const { ctx } = this;
......@@ -14,7 +15,7 @@ class OrderController extends Controller {
}
//我的历史首页
//我的历史订单
async getRecord() {
const { ctx } = this;
......@@ -25,7 +26,7 @@ class OrderController extends Controller {
ctx.success({ results });
}
//微信支付
//支付订单
async payOrder() {
const { ctx } = this;
......@@ -36,8 +37,8 @@ class OrderController extends Controller {
ctx.success({ result });
}
//微信支付通知
async payNotice() {
//微信支付异步通知
async WexinpayNotice() {
const { ctx } = this;
let data = '';
......
......@@ -7,7 +7,7 @@ module.exports = app => {
router.get('/history/:type', 'credit.order.getRecord');
router.post('/order/pay', 'credit.order.payOrder');
router.get('/order/pay/:order_id', 'credit.order.payOrder');
router.post('/order/pay_notice', 'credit.order.payNotice');
router.post('/order/wx_pay_notice', 'credit.order.WexinpayNotice');
router.get('/order/check_pay/:order_id', 'credit.order.checkPay');
router.get('/order/info/:order_id', 'credit.order.getOrderPayInfo');
......
......@@ -301,7 +301,7 @@ class OrderService extends Service {
if (price <= 0) {
ctx.failed('error price');
}
if (type === 'wexin') {
if (type === 'wxpay') {
let body = '黑名单报告检测支付';
if (order.type === 2) {
......@@ -312,7 +312,7 @@ class OrderService extends Service {
order_id,
trade_no: moment().valueOf() + ctx.helper.PrefixInteger(order_id, 11),
total_fee: price,
notify_url: `${this.config.OUT_P_NODE_URL}/51business/api/credit/order/pay_notice`,
notify_url: `${this.config.OUT_P_NODE_URL}/51business/api/credit/order/wx_pay_notice`,
product_id: order.order_no,
scene_info: JSON.stringify({ h5_info: { type: 'Wap', wap_url: this.config.PHP_URL, wap_name: '我的信用' }, }),
};
......@@ -331,6 +331,7 @@ class OrderService extends Service {
await this.addCreditPay(pay_data);
await this.updateOrderStateToCancel(order);
await this.updateOrderPrice(order);
await ctx.prometheusModel.CreditOrder.update({ method: type, state: '支付中' }, { where: { id: order.id } });
return { url: ret.mweb_url, order_id: order_id, trade_no: data.trade_no };
} else if (type === 'alipay') {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment