KXStudio Website https://kx.studio/
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

ipn.php 958B

123456789101112131415161718192021222324252627
  1. <?php
  2. require "paypal_integration_class/paypal.class.php";
  3. require "config.php";
  4. require "connect_rw.php";
  5. function esc($str) {
  6. global $db_link;
  7. return mysql_real_escape_string($str, $db_link);
  8. }
  9. $p = new paypal_class;
  10. if ($p->validate_ipn()) {
  11. if($p->ipn_data["payment_status"] == "Completed") {
  12. $amount = $p->ipn_data['mc_gross'] - $p->ipn_data['mc_fee'];
  13. mysql_query("INSERT INTO donations (transaction_id,donor_email,amount,original_request)
  14. VALUES (
  15. '".esc($p->ipn_data['txn_id'])."',
  16. '".esc($p->ipn_data['payer_email'])."',
  17. ".(float)$amount.",
  18. '".esc(http_build_query($_POST))."'
  19. )");
  20. }
  21. }
  22. ?>