Home > Backend Development > PHP Tutorial > 什么原因导致支付宝即时到账异步通知获取的sign值不空,notify_data值为空。

什么原因导致支付宝即时到账异步通知获取的sign值不空,notify_data值为空。

WBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWB
Release: 2016-06-06 20:11:47
Original
1760 people have browsed it

支付宝及时到账支付成功后异步通知处理时post获取的notify_data值为空。

php代码如下:

<code>public function alinotify(){      
    //header('Access-Control-Allow-Origin: *');
    //header('Content-type: text/plain');
    $notify_data = $_POST['notify_data'];//获取notify_data
    $sign = I('sign');//获取sign签名

    
    $isVerify = $this->verify('notify_data='.$notify_data, $sign);//验证签名,需要添加notify_data=
    if (!$isVerify) {//如果验签没有通过
        //echo 'fail';
        return;
    }
    $trade_status = $this->getDataForXML($notify_data, '/notify/trade_status');//获取交易状态
    if ($trade_status == 'TRADE_FINISHED' || $trade_status == 'TRADE_SUCCESS') {//判断交易是否完成</code>
Copy after login
Copy after login

回复内容:

支付宝及时到账支付成功后异步通知处理时post获取的notify_data值为空。

php代码如下:

<code>public function alinotify(){      
    //header('Access-Control-Allow-Origin: *');
    //header('Content-type: text/plain');
    $notify_data = $_POST['notify_data'];//获取notify_data
    $sign = I('sign');//获取sign签名

    
    $isVerify = $this->verify('notify_data='.$notify_data, $sign);//验证签名,需要添加notify_data=
    if (!$isVerify) {//如果验签没有通过
        //echo 'fail';
        return;
    }
    $trade_status = $this->getDataForXML($notify_data, '/notify/trade_status');//获取交易状态
    if ($trade_status == 'TRADE_FINISHED' || $trade_status == 'TRADE_SUCCESS') {//判断交易是否完成</code>
Copy after login
Copy after login
Related labels:
php
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Latest Issues
php data acquisition?
From 1970-01-01 08:00:00
0
0
0
PHP extension intl
From 1970-01-01 08:00:00
0
0
0
How to learn php well
From 1970-01-01 08:00:00
0
0
0
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template