Reputation: 505
I code a website (PHP) that allow user add fund via Paypal. I use IPN to get result and insert data into database. That 's step is okay.
However I wonder if a user login to Paypal and refund, I don't know how to detect that action occurs. Does any method return from Paypal via IPN that alert me when refund ?
Thanks so much !
Upvotes: 1
Views: 1408
Reputation: 1587
Under Payment Information Variables, see the description for mc_fee and mc_gross:
mc_fee: Transaction fee associated with the payment. mc_gross minus mc_fee equals the amount deposited into the receiver_email account. Equivalent to payment_fee for USD payments. If this amount is negative, it signifies a refund or reversal, and either of those payment statuses can be for the full or partial amount of the original transaction fee.
mc_gross: Full amount of the customer's payment, before transaction fee is subtracted. Equivalent to payment_gross for USD payments. If this amount is negative, it signifies a refund or reversal, and either of those payment statuses can be for the full or partial amount of the original transaction.
Same goes for payment_fee, etc. Just use that IPN Variable Reference page and do a search for "refund" to see which variables you want to evaluate in your own code.
Upvotes: 2