...
|
...
|
@@ -21,7 +21,7 @@ const _ = require('lodash'); |
|
|
const payments = {
|
|
|
alipay: 33,
|
|
|
wechat: 36,
|
|
|
alibank: 42
|
|
|
alibank: 44
|
|
|
};
|
|
|
|
|
|
/**
|
...
|
...
|
@@ -205,43 +205,43 @@ const procOrderData = (payResult, uid) => { |
|
|
if (!orderCode) {
|
|
|
result.message = '未查到订单信息,订单状态更新失败!';
|
|
|
return result;
|
|
|
} else {
|
|
|
let orderInfo = yield OrderData.orderDetail(uid, orderCode);
|
|
|
}
|
|
|
|
|
|
if (orderInfo && orderInfo.data) {
|
|
|
let order = orderInfo.data;
|
|
|
let amount = order.payment_amount;
|
|
|
let orderInfo = yield OrderData.orderDetail(uid, orderCode);
|
|
|
|
|
|
if (order.is_cancel === 'Y') {
|
|
|
logger.warn('front pay success but order is cancel.', {payResult: payResult, order: order});
|
|
|
if (orderInfo && orderInfo.data) {
|
|
|
let order = orderInfo.data;
|
|
|
let amount = order.payment_amount;
|
|
|
|
|
|
payApi.sendMessage(order.mobile, 'error_sms', '支付成功,但订单已取消,订单号为' + orderCode);
|
|
|
return {code: 417, message: '支付成功,但订单已取消,需联系客服!'};
|
|
|
}
|
|
|
if (order.is_cancel === 'Y') {
|
|
|
logger.warn('front pay success but order is cancel.', {payResult: payResult, order: order});
|
|
|
|
|
|
if (order.payment_status === 'N') {
|
|
|
logger.warn('front pay success but may be notify fail');
|
|
|
}
|
|
|
payApi.sendMessage(order.mobile, 'error_sms', '支付成功,但订单已取消,订单号为' + orderCode);
|
|
|
return {code: 417, message: '支付成功,但订单已取消,需联系客服!'};
|
|
|
}
|
|
|
|
|
|
if (_.round(parseFloat(amount), 2) !== _.round(parseFloat(payResult.totalFee), 2)) {
|
|
|
logger.warn('front pay success but the amount is not same.', {payResult: payResult, order: order});
|
|
|
return {
|
|
|
code: 415,
|
|
|
message: '支付金额与订单金额不一致,订单状态更新失败!'
|
|
|
};
|
|
|
}
|
|
|
if (order.payment_status === 'N') {
|
|
|
logger.warn('front pay success but may be notify fail');
|
|
|
}
|
|
|
|
|
|
if (_.round(parseFloat(amount), 2) !== _.round(parseFloat(payResult.totalFee), 2)) {
|
|
|
logger.warn('front pay success but the amount is not same.', {payResult: payResult, order: order});
|
|
|
return {
|
|
|
code: 200,
|
|
|
message: '支付成功,请等待发货',
|
|
|
data: {
|
|
|
order: order
|
|
|
}
|
|
|
code: 415,
|
|
|
message: '支付金额与订单金额不一致,订单状态更新失败!'
|
|
|
};
|
|
|
|
|
|
} else {
|
|
|
result.message = '未查到订单信息,订单状态更新失败!';
|
|
|
}
|
|
|
|
|
|
return {
|
|
|
code: 200,
|
|
|
message: '支付成功,请等待发货',
|
|
|
data: {
|
|
|
order: order
|
|
|
}
|
|
|
};
|
|
|
|
|
|
} else {
|
|
|
result.message = '未查到订单信息,订单状态更新失败!';
|
|
|
}
|
|
|
|
|
|
return result;
|
...
|
...
|
|