如果交易挂起,PayPal错误的交易ID

时间:2015-03-25 11:54:50

标签: php curl paypal transactions

我使用paypal的交易API获取交易清单(使用交易搜索),然后我获得每笔交易的交易详情。

但有些交易的状态为待定,而 id 则为 U-24V32336LV1084332

例如,我得到了一个事务列表id

[0] => 42C34246JA059630C
[1] => U-0H291148PK663910J
[2] => U-11199059VV672535T
[3] => U-24V32336LV1084332
[4] => 8ST99663LH729151G
[5] => U-6XE57490SR859123R
[6] => 0YW39810TP322471A

事务编号0,4和6成功返回详细信息,但其他事务返回事务ID无效。应该是这样的(虽然状态是“待定”),还是我做错了什么?

更新

获取交易详情的部分代码

    $headers = [
        "X-PAYPAL-SECURITY-USERID:" .   $this->userId,
        "X-PAYPAL-SECURITY-PASSWORD:" . $this->pass,
        "X-PAYPAL-SECURITY-SIGNATURE:". $this->sign,
        "X-PAYPAL-APPLICATION-ID: APP-80W284485P519543T",
        "X-PAYPAL-SECURITY-SUBJECT:third_party_permission_email@gmail.com",
        "X-PAYPAL-REQUEST-DATA-FORMAT: JSON",
        "X-PAYPAL-RESPONSE-DATA-FORMAT: JSON",
        "X-PAYPAL-AUTHENTICATION:" . $auth
    ];

    $post = [
        'user'          => $this->userId,
        'USER'          => $this->userId,
        'PWD'           => $this->pass,
        'SIGNATURE'     => $this->sign,
        'METHOD'        => 'GetTransactionDetails',
        'TRANSACTIONID' => $transId,
        'VERSION'       => 95
    ];

    $response = $this->curl( $this->_Merchant_API_Endpoint, $headers, $post, true );

0 个答案:

没有答案