2
votes

I am struggling with implementing PayPal's Instant Payment Notifications. I do get a IPN request from PayPal but it just doesn't have the fields PayPal says it would. For instance, there's no "mc_gross", "payment_gross" or "txn_id". How am I supposed to validate the IPN with all these fields missing?

Using the Instant Payment Notification (IPN) simulator on PayPal's Sandbox site yields a totally different IPN (which of course has all the fiels mentioned in the API docs).

I am using the "Adaptive Payments" API and I set it up to perform just a very simple PAY operation (which works fine otherwise). I have been reading posts on SO and the internet all day now but I just can't figure out what's wrong.

Here's a dump of the Request.Params array of my IPN handler (unrelated vars omitted):

payment_request_date => Fri Jan 18 05:50:04 PST 2013
return_url => http://MYHOST/ReturnUrl
fees_payer => EACHRECEIVER
ipn_notification_url => http://MYHOST/PayPal.aspx
sender_email => [email protected]
verify_sign => AoIh-cQwnxZ7nSmfalIL7L182SDTA2JKiIrVnwt.uetdGX.Jw0bG2C1f
test_ipn => 1
transaction[0].id_for_sender_txn => 66X080248E331472D
transaction[0].receiver => [email protected]
cancel_url => http://MYHOST/CancelUrl
transaction[0].is_primary_receiver => false
pay_key => AP-28U75135KE1302901
action_type => PAY
transaction[0].id => 96E03111D3558372G
memo => This is a sandbox test payment
transaction[0].status => Completed
transaction[0].paymentType => SERVICE
transaction[0].status_for_sender_txn => Completed
transaction[0].pending_reason => NONE
transaction_type => Adaptive Payment PAY
transaction[0].amount => EUR 30.25
status => COMPLETED
log_default_shipping_address_in_transaction => false
charset => windows-1252
notify_version => UNVERSIONED
reverse_all_parallel_payments_on_error => false
ALL_HTTP => HTTP_CONTENT_LENGTH:1102
HTTP_CONTENT_TYPE:application/x-www-form-urlencoded
HTTP_HOST:92.231.161.192

Any ideas?

1

1 Answers

2
votes

Adaptive Payments IPN's are a little different than your typical IPN.

With Adaptive Payments your application has its own IPN notifier separate from the receiver accounts. Your application simply gets a notification that the transaction took place and doesn't give you much detail at all about the items, pricing, etc. as you've discovered.

The receiver's account would get a separate IPN (if they have it configured) that would contain the fields you're expecting to see.

In your case, what you'll need to do is save transaction data to your database as "pending" or whatever you want to call it and then relate back to the IPN data that comes in based on the transaction ID.