...
|
...
|
@@ -7,7 +7,7 @@ |
|
|
'use strict';
|
|
|
|
|
|
|
|
|
const api = require('./pay-api');
|
|
|
const payApi = require('./pay-api');
|
|
|
const Promise = require('bluebird');
|
|
|
const co = Promise.coroutine;
|
|
|
const camelCase = global.yoho.camelCase;
|
...
|
...
|
@@ -29,7 +29,7 @@ const payments = { |
|
|
* @returns {*|Promise.<TResult>}
|
|
|
*/
|
|
|
const getOnlinePayProvider = () => {
|
|
|
return api.getPayProvider().then(result => {
|
|
|
return payApi.getPayProvider().then(result => {
|
|
|
let payPattern = [], nav = [];
|
|
|
|
|
|
if (!(result.code && result.code === 200)) {
|
...
|
...
|
@@ -95,7 +95,7 @@ const getOrderInfo = (uid, code) => { |
|
|
*/
|
|
|
const getBankByOrder = (id) => {
|
|
|
return co(function *() {
|
|
|
let data = yield api.getBankByOrder(id);
|
|
|
let data = yield payApi.getBankByOrder(id);
|
|
|
|
|
|
if (data && data.code === 200 && data.data) {
|
|
|
return camelCase(data.data);
|
...
|
...
|
@@ -141,7 +141,7 @@ const getPayInfo = (uid, code) => { |
|
|
*/
|
|
|
const getPaymentInfo = (id) => {
|
|
|
return co(function *() {
|
|
|
let data = yield api.getPaymentInfo(id);
|
|
|
let data = yield payApi.getPaymentInfo(id);
|
|
|
|
|
|
if (data && data.code === 200 && data.data) {
|
|
|
return camelCase(data.data);
|
...
|
...
|
@@ -158,7 +158,7 @@ const getPaymentInfo = (id) => { |
|
|
*/
|
|
|
const setOrderPayBank = (code, payment, bankCode) => {
|
|
|
return co(function *() {
|
|
|
let data = yield api.setOrderPayBank(code, payment, bankCode);
|
|
|
let data = yield payApi.setOrderPayBank(code, payment, bankCode);
|
|
|
|
|
|
return data;
|
|
|
})();
|
...
|
...
|
@@ -172,7 +172,7 @@ const setOrderPayBank = (code, payment, bankCode) => { |
|
|
*/
|
|
|
const updateOrderPayBank = (code, payment, bankCode) => {
|
|
|
return co(function *() {
|
|
|
let data = yield api.updateOrderPayBank(code, payment, bankCode);
|
|
|
let data = yield payApi.updateOrderPayBank(code, payment, bankCode);
|
|
|
|
|
|
return data;
|
|
|
})();
|
...
|
...
|
@@ -186,7 +186,7 @@ const updateOrderPayBank = (code, payment, bankCode) => { |
|
|
*/
|
|
|
const sendPayConfirm = (code, payment, uid) => {
|
|
|
return co(function *() {
|
|
|
let data = yield api.sendPayConfirm(code, payment, uid);
|
|
|
let data = yield payApi.sendPayConfirm(code, payment, uid);
|
|
|
|
|
|
return data;
|
|
|
})();
|
...
|
...
|
@@ -215,7 +215,7 @@ const procOrderData = (payResult, uid) => { |
|
|
if (order.is_cancel === 'Y') {
|
|
|
logger.warn('front pay success but order is cancel.', {payResult: payResult, order: order});
|
|
|
|
|
|
api.sendMessage(order.mobile, 'error_sms', '支付成功,但订单已取消,订单号为' + orderCode);
|
|
|
payApi.sendMessage(order.mobile, 'error_sms', '支付成功,但订单已取消,订单号为' + orderCode);
|
|
|
return {code: 417, message: '支付成功,但订单已取消,需联系客服!'};
|
|
|
}
|
|
|
|
...
|
...
|
|