1

我在这里使用快速结帐,但我无法从以下代码中获取 Paypal transaction_id(收据中显示的那个):

    $httpParsedResponseAr = $paypal->PPHttpPost('DoExpressCheckoutPayment', $padata, $PayPalApiUsername, $PayPalApiPassword, $PayPalApiSignature, $PayPalMode);

    //Check if everything went ok..

if("SUCCESS" == strtoupper($httpParsedResponseAr["ACK"]) || "SUCCESSWITHWARNING" == strtoupper($httpParsedResponseAr["ACK"])) {

  if(isset($httpParsedResponseAr["L_TRANSACTIONID0"])){
  $pay->transaction_id = $httpParsedResponseAr["L_TRANSACTIONID0"];
  }

$httpParsedResponseAr["L_TRANSACTIONID0"]) 这应该是问题所在。我一直在查找 Paypal 的 API 几个小时,尝试了 5 种不同的东西,但仍然无法正常工作。

有任何想法吗?

4

1 回答 1

2

您是否尝试过从 PayPal 打印出全部退货?我使用 NVP API 进行的测试:

TOKEN=EC-1HY00019TK493783V
SUCCESSPAGEREDIRECTREQUESTED=false
TIMESTAMP=2013-04-27T20:09:05Z
CORRELATIONID=c2fceba2812b1
ACK=Success
VERSION=87.0
BUILD=5817241
INSURANCEOPTIONSELECTED=false
SHIPPINGOPTIONISDEFAULT=false
PAYMENTINFO_0_TRANSACTIONID=73D205616H9478136
PAYMENTINFO_0_TRANSACTIONTYPE=expresscheckout
PAYMENTINFO_0_PAYMENTTYPE=instant
PAYMENTINFO_0_ORDERTIME=2013-04-27T20:09:04Z
PAYMENTINFO_0_AMT=15.15
PAYMENTINFO_0_FEEAMT=0.74
PAYMENTINFO_0_TAXAMT=0.00
PAYMENTINFO_0_CURRENCYCODE=USD
PAYMENTINFO_0_PAYMENTSTATUS=Completed
PAYMENTINFO_0_PENDINGREASON=None
PAYMENTINFO_0_REASONCODE=None
PAYMENTINFO_0_PROTECTIONELIGIBILITY=Eligible
PAYMENTINFO_0_PROTECTIONELIGIBILITYTYPE=ItemNotReceivedEligible,UnauthorizedPaymentEligible
PAYMENTINFO_0_ERRORCODE=0
PAYMENTINFO_0_ACK=Success

在我看来 PAYMENTINFO_0_TRANSACTIONID 是您实际要查找的变量。

于 2013-04-27T20:11:41.387 回答