Esempio n. 1
0
function verify_payment($address, $user, $fiatcurrency)
{
    global $mysqli;
    global $getinsert;
    //Retrieve address balance
    $stmt = $mysqli->prepare("Select doge_last_balance from user_receive_address where doge_address = '{$address}'");
    $stmt->execute();
    $stmt->bind_result($last_balance);
    $stmt->fetch();
    $stmt->close();
    //echo "1";
    $validbid = check_valid($address, $last_balance);
    if ($validbid) {
        //update adress balance
        //echo $validbid."--".$address;
        $stmt = $mysqli->query("Update user_receive_address SET doge_last_balance = doge_last_balance+{$validbid} WHERE doge_address = '{$address}'");
        //echo "(" . $address . "==" . $validbid . "==" . $user . ")";
        $fiat = get_doge_conversion(1, $fiatcurrency, true);
        $fiat = $fiat * $validbid;
        $insertid = log_transaction($address, $validbid, $fiat, $fiatcurrency, 'DOGE', $user, "na");
        echo $validbid;
        if ($getinsert == true) {
            echo ":::" . $insertid;
        }
    }
}
Esempio n. 2
0
<?php

require_once "db-settings.php";
//Require DB connection
require_once "cryptofunctions.php";
$amount = $_GET['amount'];
$currency = $_GET['currency'];
$reverse = $_GET['reverse'];
$value = get_doge_conversion($amount, $currency, $reverse);
echo $value;
Esempio n. 3
0
function withdraw($userid, $currency, $amount, $address = NULL, $fiatcurrency = "USD")
{
    global $handshake;
    global $dogeWalletServer;
    global $btcWalletServer;
    if ($address == NULL) {
        $userdetails = fetchUserDetails(NULL, NULL, $userid);
        $address = $userdetails[$currency . 'address'];
    }
    $params = $address . '@@@' . $amount . '@@@' . 'dogepos-' . $userid;
    $key = $params . $handshake;
    $key = sha1($key);
    if (strtoupper($currency) == "DOGE") {
        //generate api call
        $url = $dogeWalletServer . 'index.php?call=withdraw&params=' . $params . '&key=' . $key;
        //do conversion
        $fiat = get_doge_conversion($amount, $fiatcurrency, true);
    } else {
        if (strtoupper($currency) == "BTC") {
            $url = $btcWalletServer . 'index.php?call=withdraw&params=' . $params . '&key=' . $key;
            //do conversion
            $fiat = get_btc_conversion($amount, $fiatcurrency, true);
        }
    }
    echo "[fiat=" . $fiat . $fiatcurrency . " || amount=" . $amount . $currency;
    echo $url;
    //open connection
    $ch = curl_init();
    //set the url, number of POST vars, POST data
    curl_setopt($ch, CURLOPT_URL, $url);
    curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
    //execute post
    $result = curl_exec($ch);
    //print_r($result);
    if (strlen($result) > 20) {
        $logamount = 0 - $amount;
        $logfiat = 0 - $fiat;
        log_transaction($address, $logamount, $logfiat, $fiatcurrency, strtoupper($currency), $userid, $result);
    }
    //close connection
    curl_close($ch);
    //echo "result".$result;
    return $result;
    /* part of pin check
    	}
    	*/
}
Esempio n. 4
0
<?php

require_once "models/config.php";
require_once "models/db-settings.php";
//Require DB connection
require_once "models/cryptofunctions.php";
require_once "models/header.php";
require_once "models/ajax_calls.php";
print_r($_POST);
echo "let's process payments!";
$amount = $_POST['amount'];
$user = $_POST['account'];
$user = substr($user, 2);
$user = $user - 100;
$fiatcurrency = $_POST['fiatcurrency'];
$amountcrypto = get_doge_conversion($amount, 'USD');
echo $amountcrypto;
echo "==" . $user;
?>

<div class='container container_12'>
	<div class="currency">
		<img src="images/dogecoin.png">
		<p class="supplemental">Converted Amount</p>
		<p class="converted">&#393; <span class="doge"></span></p>
	</div>
	<div class="amount">
		<form method="post" id="customer">
			<label for="first">First Name:
				<input type="text" name="first" id="first">
			</label><br>