0

After somebody clicks the donate button in my website, is there any way my site can retrieve information like:

  1. the donation was successful
  2. donation amount
  3. time the donation was completed

and then, the information will be stored automatically in one of my site databases

thank you

Steve
  • 337
  • 2
  • 10

1 Answers1

2

You can add notify_url variable to your Donate button (or link) with URL of script on your site. That script receives POST with all payment data.

Example:

<form action="https://www.paypal.com/cgi-bin/webscr" method="post">
<input type="hidden" name="cmd" value="_donations"/>
....
<input type="hidden" name="notify_url" value="https://www.example.com/paypal.php"/>
....
<input type="hidden" name="amount" value="9"/>
<input type="image" src="..." border="0" name="submit"/>
</form>

The POST includes among other these fields that would interest you:

payment_status = Completed  
payment_gross = 9.00  
payment_fee = 0.65  
residence_country = NL  
payer_email = donor@example.com  
first_name = Jon  
last_name = de Miranda

See also question Notify url of Paypal.

Community
  • 1
  • 1
Martin Prikryl
  • 188,800
  • 56
  • 490
  • 992