容易出错的几点
1.要使用支付宝公钥
2.sign_type推荐使用RSA2(RSA2048)
3.(重点)回调数据中的fund_bill_list会被转义。*
正确的应该是
"fund_bill_list":"[{\"amount\":\"0.01\",\"fundChannel\":\"ALIPAYACCOUNT\"}]"
下面是我接收到的fund_bill_list回调信息(也有被转义成其他的可能随机应变)
"fund_bill_list":"[{"amount":"0.10","fundChannel":"ALIPAYACCOUNT"}]
解决方法
$arr=$_POST;
$arr['fund_bill_list'] = html_entity_decode($arr['fund_bill_list']);
在出现问题的时候打印一下返回的数据
file_put_contents("log.txt",date('Y-m-d H:i:s',time())."----111-----".json_encode($arr)."\n\r",FILE_APPEND);