Skip to content

Commit

Permalink
异步通知
Browse files Browse the repository at this point in the history
  • Loading branch information
dedemao authored Dec 18, 2020
1 parent 2d91fb8 commit 89a6644
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions notify.php
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
$aliPay = new AlipayService($alipayPublicKey);
//验证签名
$result = $aliPay->rsaCheck($_POST,$_POST['sign_type']);
if($result===true){
if($result===true && $_POST['trade_status'] == 'TRADE_SUCCESS'){
//处理你的逻辑,例如获取订单号$_POST['out_trade_no'],订单金额$_POST['total_amount']等
//程序执行完后必须打印输出“success”(不包含引号)。如果商户反馈给支付宝的字符不是success这7个字符,支付宝服务器会不断重发通知,直到超过24小时22分钟。一般情况下,25小时以内完成8次通知(通知的间隔频率一般是:4m,10m,10m,1h,2h,6h,15h);
echo 'success';exit();
Expand Down Expand Up @@ -106,4 +106,4 @@ function characet($data, $targetCharset) {
}
return $data;
}
}
}

0 comments on commit 89a6644

Please sign in to comment.