PHP verify PayPal Donation

DanSpd picture DanSpd · Jan 2, 2010 · Viewed 8.8k times · Source

How can I verify a paypal donation?

In the user panel I have a donate button. And once someone actually donates I want to do something to him. But I do not know how to check if the user actually donated or just clicked the donate button.

Answer

Steven Smethurst picture Steven Smethurst · Jan 2, 2010

Look in to Paypal's IPN (Instant Payment Notification)

When someone makes a payment or donation to your Paypal account, Paypal will send a post message to your web server with all the payment details. You can then send a message back to Paypal to make sure that the payment was real...

There are even some code examples on paypal's website. Including one for PHP.

Note you have to enable IPN and define the call back URL in your paypal account before you can start using IPN.