Reputation: 4688
I am testing Adaptive Payments in the PayPal sandbox, the IPNs are returning to my website properly, except I cannot get the transcation ID to appear, I want this in my database as users will be able to use it to redownload media in the future, or if they do not redirect to the site instantly and miss the initial download.
The payment is a Chain payment.
According to the IPN Developer guide (https://cms.paypal.com/cms_content/US/en_US/files/developer/IPNGuide.pdf), the response should use transaction[n].id
as the transcation ID, i have tried:
$_POST['transaction[0].id']
$_POST['transaction[0]['id']']
$_POST['txn_id']
all are returning NULL
. I have IPN information emails being returned for every IPN, and this is what I have been getting:
VERIFIED
--------------------------------------------------------------------------------
transaction Array
log_default_shipping_address_in_transactionfalse
action_type PAY
ipn_notification_url xxx
charset windows-1252
transaction_type Adaptive Payment PAY
notify_version UNVERSIONED
cancel_url xxx
verify_sign AM-T87RnkCBg1jNaY5s.rN3m7228AwQazhSReOMGBFi9VRyKsQwGyQ9f
sender_email [email protected]
fees_payer EACHRECEIVER
return_url xxx
reverse_all_parallel_payments_on_errorfalse
pay_key AP-13220443VY964171X
status COMPLETED
test_ipn 1
payment_request_date Sat Aug 25 23:49:05 PDT 2012
How do I get the transaction Id's? (Most importantly, the primary receivers ID)
Upvotes: 2
Views: 1491
Reputation: 564
I wrote a series of articles about the Adaptive Payment API. The second one deals with working with the variables sent to your IPN handler from an Adaptive Payment.
PayPal sends a strange set of variables, but it's possible to decode them into something we're able to easily work with in PHP.
Upvotes: 4
Reputation: 563
You need to go into your primary receiver's profile settings in Paypal (in the Sandbox or live environment) and set-up the instant payment notification (IPN) preferences. This will send a second IPN to the URL you specify with the details you are looking for.
Upvotes: 0