Well, I will answer this and read a little.
Instead of using the payKey specified when calling AdaptivePayments/Pay , another solution is to use trackingId.
Here's how:
First step: you create AdaptivePayments/Pay , and you specify trackId (must be unique):
{ "actionType":"PAY", "currencyCode":"USD", "receiverList":{"receiver":[{"amount":"1.00","email":" seller_1288085303_biz@gmail.com "}]}, "returnUrl":"http://apigee.com/console/-1/handlePaypalReturn", "cancelUrl":"http://apigee.com/console/-1/handlePaypalCancel?", "trackingId":"abcde-12345-unique-of-course", "ipnNotificationUrl":"http://apigee.com/console/-1/ipn", "requestEnvelope":{"errorLanguage":"en_US", "detailLevel":"ReturnAll"} }
In response, you will have payKey that you redirect your buyer to complete the payment.
Then, for the entire evolution of this payment, you will be notified at your IPN URL (here, http://apigee.com/console/-1/ipn ") ..
When you receive a POST request at this address, check the payment is correct in PayPal, and you will receive a trackingId in the parameter. Verify that this tracking ID exists, and then request AdaptivePayments/PaymentDetails with this tracking ID as follows:
{ "trackingId":"{put here}", "requestEnvelope":{"errorLanguage":"en_US", "detailLevel":"ReturnAll"} }
And you will have the full detailed status of your payment in return.
Now you are doing the work of updating the database, call your customer, etc. etc.:)
What was useful to me: