2

SetExpressCheckout only posts to the ReturnURL the following ACK CORRELATIONID TIMESTAMP VERSION BUILD

To complete a transaction though we must first call GetTransactionDetails with TRANSACTIONID to get the PAYERID to ultimately use with DoExpressCheckout to complete the transaction.

Where do we obtain TRANSACTIONID? I can't find information anywhere.

If I use the CORRELATIONID as TRANSACTIONID, I get 'Transaction Id is invalid'.

The sample files just have 'example_transactionId' and no indication of where it is supposed to come from.

From paypal

  1. Invoke an API operation, such as SetExpressCheckout, that sets up the return URL to which PayPal redirects your buyer’s browser after the buyer finishes on PayPal. Other setup also can be performed by this API operation.
  2. Invoke additional API operations after receiving the buyer’s permission on PayPal, for example, GetExpressCheckoutDetails or DoExpressCheckoutPayment.

Step one works because we have all the information and returns this.

enter image description here

Step 2 can't be completed without at least TRANSACTIONID which isn't given.

What the?

TijuanaKez
  • 1,472
  • 3
  • 20
  • 28

3 Answers3

2

you have to do the TransactionSearch first. it will return the transactions with id. you can then use the id for GetTransactionDetails

amrit_neo
  • 1,759
  • 4
  • 19
  • 39
  • 1
    ebay says it includes it in the order response, but that doesn't seem to be the case. :) Your answer does help.. but it returns a pile of payments. None of which tell you directly which transaction you're looking for. – baash05 Feb 21 '13 at 02:17
  • Hello, Using setExpresschecout CURL method i am able to set recurring payment and i get array in return with Success ACK, Here i update by database for user has paid but now suppose my billing cycle is 15 days how this script can check that the transaction successful after 15 days? Do i need any cron job or what , i check on may article but not found how to check status of payer after billing cycle is over. Thanks – Rakhi Mar 19 '16 at 11:40
1

When paypal redirects the user back to RETURNURL (which you should set in your call to SetExpressCheckout) you get a TOKEN parameter in the request.

You then fetch the transaction information using GetExpressCheckoutDetails passing TOKEN as a parameter. The response will contain AMT, PAYERID and TOKEN among other things.

To finalize the transaction you pass those parameters to DoExpressCheckoutPayment.

Btw the only time you need to use CORRELATIONID is when you are talking to PayPal support. It has no practical use for handling payments.

Hope it helps! :)

Leif Högberg
  • 378
  • 1
  • 5
0

In DGdoExpressCheckout.php, response is received in $DoECResponse. Transaction Id can be found deep inside this object:

$tranId = $DoECResponse->DoExpressCheckoutPaymentResponseDetails->PaymentInfo[0]->TransactionID;

You can get the whole object's details in a file:

file_put_contents('debug.log', print_r($DoECResponse, true));

$DoECResponse object provides some of the basic information about the transaction, and GetTransactionDetails can be used to get more verbose information. Mostly, one would not much require to call GetTransactionDetails.

Nikunj Bhatt
  • 188
  • 4
  • 16