Authored by 郭成尧

wechat-pay-disturb

... ... @@ -2,7 +2,7 @@
* @Author: Targaryen
* @Date: 2017-01-03 17:42:41
* @Last Modified by: Targaryen
* @Last Modified time: 2017-01-04 18:19:06
* @Last Modified time: 2017-01-05 13:52:47
*/
'use strict';
... ... @@ -13,6 +13,8 @@ const logger = global.yoho.logger;
const rp = require('request-promise');
const Promise = require('bluebird');
const co = Promise.coroutine;
const sign = require('./sign');
const md5 = require('md5');
/**
* 微信支付相关工具类
... ... @@ -122,9 +124,12 @@ const tools = {
total_fee: params.totalFee,
trade_type: 'JSAPI',
openid: params.openId,
sign: '', // TODO 签名算法
sign_type: 'MD5',
};
let signStr = md5(sign.raw(unifiedParams) + WxPayConfig.KEY).toUpperCase();
_.assign(unifiedParams, {sign: signStr});
}
};
... ...
... ... @@ -111,6 +111,7 @@ module.exports = {
WxPayConfig: {
APPID: 'wx75e5a7c0c88e45c2',
MCHID: '1227694201',
KEY: '7e6f3307b64cc87c79c472814b88f7fb',
APPSECRET: 'ce21ae4a3f93852279175a167e54509b'
}
};
... ...