Advertisement
Guest User

Untitled

a guest
Mar 25th, 2019
59
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.50 KB | None | 0 0
  1. <?php
  2.  
  3. include('files/configuration.php');
  4. include('files/verifier.php');
  5.  
  6. $listener = new IpnListener();
  7.  
  8. $listener->use_sandbox = false;
  9. $listener->use_ssl = true;
  10. $listener->use_curl = false;
  11.  
  12. $listener->requirePostMethod();
  13. $verified = $listener->processIpn();
  14.  
  15. if ($verified) {
  16. $pdo = new PDO('mysql:host='.hostname.';dbname='.database, username, password);
  17. $deposit_verification = $_POST['verify_sign'];
  18.  
  19. $stmt = $pdo->prepare('SELECT DepositVerification FROM deposits WHERE DepositVerification = :DepositVerification');
  20. $stmt->bindParam(':DepositVerification', $deposit_verification);
  21. $stmt->execute();
  22.  
  23. if($stmt->rowCount() == 0) {
  24. $user_id = $_POST['custom'];
  25. $stmt = $pdo->prepare('SELECT * FROM users WHERE UserID = :UserID');
  26. $stmt->execute(array(':UserID' => $user_id));
  27.  
  28. if($stmt->rowCount() == 1) {
  29. $row = $stmt->fetch();
  30.  
  31. $user_funds = $row['UserBalance'];
  32. $deposited_funds = $_POST['payment_gross'];
  33. $total_funds = $user_funds + $deposited_funds;
  34.  
  35. $stmt = $pdo->prepare('UPDATE users SET UserBalance = :UserBalance WHERE UserID = :UserID');
  36. $stmt->execute(array(':UserBalance' => $total_funds, ':UserID' => $user_id));
  37.  
  38. $stmt = $pdo->prepare('INSERT INTO deposits (DepositUserID, DepositDate, DepositAmount, DepositVerification, DepositType) VALUES (:DUID, :DD, :DA, :DV, :DT)');
  39. $stmt->execute(array(':DUID' => $user_id, ':DD' => time(), ':DA' => $deposited_funds, ':DV' => $deposit_verification, ':DT' => 'paypal'));
  40. }
  41. }
  42. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement