I would have expected a payment reversal to come back as, well, "REVERSED".
The two IPN notifications are nearly identical, and im really confused as to how I'm supposed to handle these two very different and impacting cases..
I see no indication that one is for a successful payment, and one is for a cancellation(reversal) of that payment..
Here is a successful payment
{
"transaction": ["USD 107.75"],
"payment_request_date": "Thu Dec 13 06:36:41 PST 2012",
"return_url": "http:\\/\\/dev.something.com\\/paypal\\/callback\\/success",
"fees_payer": "EACHRECEIVER",
"ipn_notification_url": "http:\\/\\/dev.something.com\\/paypal\\/ipn_pay",
"sender_email": "[email protected]",
"verify_sign": "APXJM61hjKwY87DLzueyb5wEw.d6A-0.-hTUGwmFgZwciame2x1SEpe1",
"test_ipn": "1",
"cancel_url": "http:\\/\\/dev.something.com\\/paypal\\/callback\\/cancel",
"pay_key": "AP-4AC54963BJ135581V",
"action_type": "PAY",
"memo": "MEMO",
"transaction_type": "Adaptive Payment PAY",
"tracking_id": "pay_50c9e7f8658ae",
"status": "COMPLETED",
"log_default_shipping_address_in_transaction": "false",
"charset": "windows-1252",
"notify_version": "UNVERSIONED",
"reverse_all_parallel_payments_on_error": "false"
}
Here is the same payment that is reversed after payment review
{
"transaction": ["USD 107.75"],
"payment_request_date": "Thu Dec 13 06:36:41 PST 2012",
"return_url": "http:\\/\\/dev.something.com\\/paypal\\/callback\\/success",
"fees_payer": "EACHRECEIVER",
"ipn_notification_url": "http:\\/\\/dev.something.com\\/paypal\\/ipn_pay",
"sender_email": "[email protected]",
"verify_sign": "Am2jFc4B6hWjlKD0-6LqtZwFoCEPACrjGEsaP1pg3GsZN5Q33vlx.AO1",
"test_ipn": "1",
"cancel_url": "http:\\/\\/dev.something.com\\/paypal\\/callback\\/cancel",
"reason_code": "Unknown",
"pay_key": "AP-4AC54963BJ135581V",
"action_type": "PAY",
"memo": "MEMO",
"expiration_date": "Thu Dec 13 06:40:07 PST 2012",
"transaction_type": "Adjustment",
"tracking_id": "pay_50c9e7f8658ae",
"status": "COMPLETED",
"log_default_shipping_address_in_transaction": "false",
"charset": "windows-1252",
"notify_version": "UNVERSIONED",
"reverse_all_parallel_payments_on_error": "false"
}
The difference here is the transaction_type of "Adaptive Payment Pay" vs. "Adjustment".
One thing to keep in mind, though, is that these IPN's are for your Adaptive Payments application and are meant for the application owner as oppose to the seller.
The actual seller account involved would be getting its own IPN(s) from the system that would contain more details about the payments themselves.