session_id($_GET['sid']); session_start(); // save the transaction data to individual variables list($pubAdd, $price, $quantity, $item, $seller, $success_url, $cancel_url, $note, $baggage) = explode('|', $_SESSION['t_data']); // get the total price $total = $price * $quantity; // reset or increase the progress if (!isset($_SESSION[$pubAdd . '-confirms'])) { $_SESSION[$pubAdd . '-confirms'] = 1; $_SESSION['progress'] = 0; } else { $_SESSION['progress'] += $prog_inc; $_SESSION[$pubAdd . '-confirms']++; } // check if the payment has been recieved $check_result = bitsci::check_payment($total, $pubAdd, $_SESSION[$pubAdd . '-confirms']); if ($check_result === false) { // the payment isn't confirmed yet $_SESSION[$pubAdd . '-confirms']--; $payment_status = 'confirming payment'; } elseif ($check_result === 'e1') { // we have no working API's... $_SESSION[$pubAdd . '-confirms']--; $payment_status = 'All API\'s are unavailable'; } elseif ($check_result === 'e2') { // this really shouldn't happen... $_SESSION[$pubAdd . '-confirms']--; $payment_status = 'address is invalid!'; } elseif ($check_result === 'e3') { // something weird happened... $_SESSION[$pubAdd . '-confirms']--;
//MYSQL CONNECT $con = mysql_connect($mysvr, $myusr, $mypass); if (!$con) { die('Could not connect: ' . mysql_error()); } mysql_select_db($mydb) or die(mysql_error()); // Insert a row of information into the table "payment" mysql_query("INSERT INTO payment \n(inhand) VALUES('YES') ") or die(mysql_error()); confirm_transaction('ipn-control.php?sid=' . $sid, $pubAdd, $sec_str); } else { invalid_input('Error confirming transaction. Refresh the page or go back and try again.'); } } // check for potential errors before proceeding if (empty($_GET['u'])) { $check_result = bitsci::check_payment($_SESSION['total_price'], $pubAdd, $confirm_num); if ($check_result === 'e1') { invalid_input('Block Explorer API is offline. Please try again later.'); } elseif ($check_result === 'e2') { invalid_input('The address is corrupt. Please go back and try again.'); } elseif ($check_result === 'e3') { invalid_input('An unknown error occured. Please try again later.'); } elseif ($check_result === true) { confirm_transaction('ipn-control.php?sid=' . $sid, $pubAdd, $sec_str); } } ?> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />