Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- include('files/configuration.php');
- include('files/verifier.php');
- $listener = new IpnListener();
- $listener->use_sandbox = false;
- $listener->use_ssl = true;
- $listener->use_curl = false;
- $listener->requirePostMethod();
- $verified = $listener->processIpn();
- if ($verified) {
- $pdo = new PDO('mysql:host='.hostname.';dbname='.database, username, password);
- $deposit_verification = $_POST['verify_sign'];
- $stmt = $pdo->prepare('SELECT DepositVerification FROM deposits WHERE DepositVerification = :DepositVerification');
- $stmt->bindParam(':DepositVerification', $deposit_verification);
- $stmt->execute();
- if($stmt->rowCount() == 0) {
- $user_id = $_POST['custom'];
- $stmt = $pdo->prepare('SELECT * FROM users WHERE UserID = :UserID');
- $stmt->execute(array(':UserID' => $user_id));
- if($stmt->rowCount() == 1) {
- $row = $stmt->fetch();
- $user_funds = $row['UserBalance'];
- $deposited_funds = $_POST['payment_gross'];
- $total_funds = $user_funds + $deposited_funds;
- $stmt = $pdo->prepare('UPDATE users SET UserBalance = :UserBalance WHERE UserID = :UserID');
- $stmt->execute(array(':UserBalance' => $total_funds, ':UserID' => $user_id));
- $stmt = $pdo->prepare('INSERT INTO deposits (DepositUserID, DepositDate, DepositAmount, DepositVerification, DepositType) VALUES (:DUID, :DD, :DA, :DV, :DT)');
- $stmt->execute(array(':DUID' => $user_id, ':DD' => time(), ':DA' => $deposited_funds, ':DV' => $deposit_verification, ':DT' => 'paypal'));
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement