Question

I'm using express checkout here but I can't get Paypal transaction_id (the one shows up in the receipt) from the following codes:

    $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"]) this should be the problem. I've been looking up Paypal's API for hours and tried for 5 different things but still can't get it work.

Any ideas?

Était-ce utile?

La solution

Have you tried printing out the whole return from PayPal? My test with the 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

It looks to me like PAYMENTINFO_0_TRANSACTIONID is the variable you're actually looking for.

Licencié sous: CC-BY-SA avec attribution
Non affilié à StackOverflow
scroll top