修改文件:extend\service\AlipayTradeWapService
修改方法:AliPayNotify()
protected function AliPayNotify(callable $notifyFn)
{
$post = Request::instance()->post();
//卡劵紅包類
$voucher_detail_list = Request::instance()->param('voucher_detail_list');
if ($voucher_detail_list) {
$post['voucher_detail_list'] = $voucher_detail_list;
}
$result = self::AliPaycheck($post);
if ($result) {
//商戶訂單號(hào)
$post['out_trade_no'] = isset($post['out_trade_no']) ? $post['out_trade_no'] : '';
//支付寶交易號(hào)
$post['trade_no'] = isset($post['trade_no']) ? $post['trade_no'] : '';
//交易狀態(tài)
$post['trade_status'] = isset($post['trade_status']) ? $post['trade_status'] : '';
//備注
$post['attach'] = isset($post['passback_params']) ? urldecode($post['passback_params']) : '';
//異步回調(diào)成功執(zhí)行
try {
if (is_callable($notifyFn)) $notifyFn((object)$post, $result);
} catch (\Exception $e) {
self::$isDeBug && self::WriteLog('支付寶支付成功,訂單號(hào)為:' . $post['out_trade_no'] . '.回調(diào)報(bào)錯(cuò):' . $e->getMessage());
}
echo 'success';
} else {
echo 'fail';
}
self::$isDeBug && self::WriteLog($result);
return true;
}