Reputation: 25
I use paypal ipn and the ipn script is activated when a paypal refund is done
how can I tell in paypal ipn that it's a refund and treat it differently?
Upvotes: 2
Views: 90
Reputation: 30457
payment_status=Refunded
See page 48 here: https://www.paypalobjects.com/webstatic/en_US/developer/docs/pdf/ipnguide.pdf
2019 edit, current link: https://developer.paypal.com/docs/classic/ipn/integration-guide/IPNandPDTVariables/#transaction-and-notification-related-variables
Upvotes: 2
Reputation: 2917
if($_POST["payment_status"] == "Refunded"){
//it's a refund
}
Note there are other payment statuses too, like Completed (for a sale) and Reversed (for when the buyer makes a complaint).
Upvotes: 1