我正在使用PayPal经典API并使用以下代码获取所有PayPal交易明细。
$info = 'USER=api_username&PWD=api_password&SIGNATURE=api_sgnature&VERSION=94&METHOD=GetTransactionDetails&TRANSACTIONID='.$value;
$curl = curl_init('https://api-3t.paypal.com/nvp');
curl_setopt($curl, CURLOPT_FAILONERROR, true);
curl_setopt($curl, CURLOPT_FOLLOWLOCATION, true);
curl_setopt($curl, CURLOPT_RETURNTRANSFER, true);
curl_setopt($curl, CURLOPT_SSL_VERIFYHOST, false);
curl_setopt($curl, CURLOPT_SSL_VERIFYPEER, false);
curl_setopt($curl, CURLOPT_POSTFIELDS, $info);
curl_setopt($curl, CURLOPT_HEADER, 0);
curl_setopt($curl, CURLOPT_POST, 1);
$result = curl_exec($curl);
$str = $result;
parse_str($result, $result);
foreach($result as $key => $value){
echo $key.' => '.$value."<BR>";
}
在输出之后,我将收到创建和取消的付款或交易。
ADDRESSOWNER => PayPal
ADDRESSSTATUS => None
TIMESTAMP => 2015-06-26T05:10:54Z
CORRELATIONID => 4dad1aa370757
ACK => Failure
VERSION => 94
BUILD => 17103657
L_ERRORCODE0 => 10004
L_SHORTMESSAGE0 => Transaction refused because of an invalid argument. See additional error messages for details.
L_LONGMESSAGE0 => The transaction id is not valid
L_SEVERITYCODE0 => Error
PENDINGREASON => None
REASONCODE => None
L_TAXABLE0 => true
正如您从回复中看到的那样,我既没有获得交易ID也没有取消交易的电子邮件,因此无法识别此交易。
可能是错误还是有其他选择?