Commit c86cffc0 by yeran

update getNotifyData for MiNotify by yeran

1 parent a2ae41ce
......@@ -11,7 +11,7 @@ date_default_timezone_set('Asia/Shanghai');
$miConfig = require_once 'MiConfig.php';
$orderNo = 12134567981211;//time() . rand(1000, 9999);
$orderNo = 12134567980211;//time() . rand(1000, 9999);
// 订单信息
$payData = [
'body' => '商品名称',
......
......@@ -45,6 +45,14 @@ class MiNotify extends NotifyStrategy
foreach($_POST as $key=>$val) {//动态遍历获取所有收到的参数,此步非常关键
$params[$key] = $val;
}
//支持直接读取input流
$data = @file_get_contents('php://input');
if(!empty($data)){
$inputArray = json_decode($data,true);
$params = array_merge($params,$inputArray);
}
if(count($params)<1){//如果参数为空,则不进行处理
return false;
}
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!