Authored by 郝肖肖

payParams 判断变量是否存在

@@ -54,7 +54,7 @@ const Alibank = { @@ -54,7 +54,7 @@ const Alibank = {
54 }; 54 };
55 }, 55 },
56 notify(data, param) { 56 notify(data, param) {
57 - let payParams = JSON.parse(param.payParams); 57 + let payParams = param.payParams && JSON.parse(param.payParams) || {};
58 let orderCode = parseInt(data.out_trade_no, 10); 58 let orderCode = parseInt(data.out_trade_no, 10);
59 let extraParam = data.extra_common_param && JSON.parse(data.extra_common_param) || {}; 59 let extraParam = data.extra_common_param && JSON.parse(data.extra_common_param) || {};
60 let bankName = payHelpersBank.getList()[extraParam.defaultbank] && 60 let bankName = payHelpersBank.getList()[extraParam.defaultbank] &&
@@ -82,6 +82,10 @@ const Alibank = { @@ -82,6 +82,10 @@ const Alibank = {
82 checkNotify(data, payParams) { 82 checkNotify(data, payParams) {
83 let signValue = data.sign; 83 let signValue = data.sign;
84 84
  85 + if (!payParams || !data) {
  86 + return false;
  87 + }
  88 +
85 delete data.sign; 89 delete data.sign;
86 delete data.sign_type; 90 delete data.sign_type;
87 delete data.code; 91 delete data.code;