1 Star 0 Fork 24

lhw / 灵动商城node版

forked from 秀杰 / 灵动商城node版 
加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
该仓库未声明开源许可证文件(LICENSE),使用请关注具体项目描述及其代码上游依赖。
克隆/下载
utils.js 634 Bytes
一键复制 编辑 原始数据 按行查看 历史
秀杰 提交于 2017-10-30 17:20 . wxpay
const wxpay = require('./wxpay');
const validateSign = results => {
const sign = wxpay.sign(results);
if (sign !== results.sign) {
const error = new Error('微信返回参数签名结果不正确');
error.code = 'INVALID_RESULT_SIGN';
throw error;
};
return results;
};
const handleError = results => {
if (results.return_code === 'FAIL') {
throw new Error(results.return_msg);
}
if (results.result_code !== 'SUCCESS') {
const error = new Error(results.err_code_des);
error.code = results.err_code;
throw error;
}
return results;
};
module.exports = {
validateSign,
handleError,
};
NodeJS
1
https://gitee.com/hw623724639/lendoo-web.git
git@gitee.com:hw623724639/lendoo-web.git
hw623724639
lendoo-web
灵动商城node版
master

搜索帮助