You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
48 lines
1.0 KiB
48 lines
1.0 KiB
<?php
|
|
|
|
namespace app\base\controller\demo\api;
|
|
|
|
|
|
class Callback extends Base
|
|
{
|
|
|
|
|
|
/**
|
|
* 支付宝预授权回调
|
|
* @date 2022-04-01
|
|
*/
|
|
public function freezeNotify()
|
|
{
|
|
$uid = input('param.uid');
|
|
$data = input('post.');
|
|
|
|
|
|
defined('UID') || define('UID', $uid);
|
|
$ali_pay_param = get_app_alipay_config();
|
|
$ali_pay_class = new \ali\alipay\pay\AliPay($ali_pay_param);
|
|
|
|
//异步通知验签
|
|
$result = $ali_pay_class->verifyNotify($data);
|
|
|
|
// 记录日志
|
|
platformLog($data, $result, 'alipaysdk_pay_check_sign_freeze_' . UID);
|
|
|
|
//验签失败
|
|
if (!$result) {
|
|
exit;
|
|
}
|
|
|
|
//在支付宝的业务通知中,资金预授权明细的状态:INIT--初始 SUCCESS--成功 CLOSED--关闭
|
|
if ($data['status'] != 'SUCCESS') {
|
|
exit;
|
|
}
|
|
|
|
$order_number = $data['out_order_no']; //订单编号
|
|
|
|
echo "success";// 告诉支付宝,我已经处理完了,别再通知我了
|
|
exit;
|
|
}
|
|
|
|
|
|
}
|