Authored by 郝肖肖

支付updateOrdersPaymentByCode调用不须要调用savePrePayInfo接口

... ... @@ -14,7 +14,7 @@ const Sign = {
}).sort();
return keys.map(k => {
return k + '=' + args[k];
return k + '=' + decodeURI(args[k]);
}).join('&');
},
... ... @@ -26,7 +26,7 @@ const Sign = {
}).sort();
return keys.map(k => {
return k.toLowerCase() + '=' + encodeURIComponent(args[k]);
return k.toLowerCase() + '=' + encodeURI(args[k]);
}).join('&');
}
};
... ...
... ... @@ -90,14 +90,12 @@ const Payment = {
beforePay(user, order, method, bankCode) {
return Promise.all([
OrderData.updateOrderPayment(order.order_code, method, user.uid),
PayData.savePrePayInfo(order.order_code, method, user.uid),
PayData.getBankByOrder(order.order_code)
]).then(result => {
let paymentRecord = result[0];
let prePayResult = result[1];
let bankRecord = result[2];
let bankRecord = result[1];
if (!paymentRecord || paymentRecord.code !== 200 || !prePayResult || prePayResult.code !== 200) {
if (!paymentRecord || paymentRecord.code !== 200) {
let message = paymentRecord && paymentRecord.message ? paymentRecord.message : '系统繁忙,请稍后再试';
return {code: 400, message: message};
... ...
... ... @@ -61,16 +61,6 @@ const sendPayConfirm = (code, payment, uid) => {
});
};
/* 选择支付,校验时间间隔,插入数据,为用户取消订单做准备<用户支付取消订单,10分钟间隔>。*/
const savePrePayInfo = (code, payment, uid) => {
return api.get('', {
method: 'app.order.savePrePayInfo',
orderCode: code,
payment: payment,
uid: uid
});
};
const sendMessage = (mobile, template, codes) => {
return api.get('', {
method: 'app.message.sendMsg',
... ... @@ -87,6 +77,5 @@ module.exports = {
setOrderPayBank,
updateOrderPayBank,
sendPayConfirm,
savePrePayInfo,
sendMessage
};
... ...
... ... @@ -179,21 +179,6 @@ const updateOrderPayBank = (code, payment, bankCode) => {
};
/**
* 选择支付,校验时间间隔,插入数据
* @param code
* @param payment
* @param uid
*/
const savePrePayInfo = (code, payment, uid) => {
return co(function *() {
let data = yield api.savePrePayInfo(code, payment, uid);
return data;
})();
};
/**
* 支付确认
* @param code
* @param payment
... ... @@ -271,7 +256,6 @@ module.exports = {
updateOrderPayBank,
sendPayConfirm,
procOrderData,
savePrePayInfo,
payments
};
... ...