Exemple #1
0
function process_payment()
{
    // response fields indicating status of transaction
    $approval_code = $_POST["approval_code"];
    $status = $_POST["status"];
    $oid = $_POST["oid"];
    $ttime = $_POST["ttime"];
    // our fields
    $chargetotal = (double) $_POST["chargetotal"];
    $userid = $_POST["userid"];
    $itemid = $_POST["itemid"];
    $x_payment = urldecode($_POST["x_payment"]);
    $x_addr = urldecode($_POST["x_addr"]);
    $x_aprcode = $_POST["x_aprcode"];
    $x_ccshort = $_POST["x_ccshort"];
    if (!isset($x_ccshort)) {
        $x_ccshort = "";
    }
    $x_desc = store_GetItemDesc($itemid);
    // get cvv/avs codes from approval code
    $check_code = get_result_from_code($x_aprcode);
    if (!check_avs_code($check_code)) {
        echo "<strong>Please note that credit card address was not verified</strong><br>";
    }
    echo "Thank you for placing your order !<br><br>";
    echo "Your Receipt<br><br>";
    //	UserID:	$userid <br>
    echo "\n\t<br>\n\tOrder Number:  {$oid}<br>\n\tTime:   {$ttime} <br>\n\t{$x_desc} <br>\n\tPayment Method - {$x_payment}<br><br>\n\tBilling Address<br>\n\t{$x_addr}";
    echo "<br>\n\tItem:       {$x_desc}<br>\n\tPrice:      \${$chargetotal}<br>\n\tTaxes:\t    \$0.00<br>\n\tTotal:      \${$chargetotal}<br>\n\t<br>\n\t<br>";
    //	echo "Transaction details<br>";
    //	echo "Status: '$status'<br>";
    //	echo "ACode1: '$approval_code'<br>";
    //	echo "ACode2: '$x_aprcode'<br>";
    require_once 'dbinfo.inc.php';
    // create & execute query
    $tsql = "EXECUTE ECLIPSE_PROCESSTRANSACTION ?, ?, ?, ?, ?, ?, ?, ?";
    $params = array($x_ccshort . " " . $oid, $userid, $ttime, $chargetotal, $x_aprcode, $status, $itemid, 'SJFei937cjsjf029sdkWccYY9');
    $member = db_exec($conn, $tsql, $params);
    // matomy
    require_once 'matomy.inc.php';
    $geoIpCode = matomy_get_geoIpCode();
    matomy_do_conversion($conn, $userid, $geoIpCode, $itemid, $chargetotal, $oid);
    // send confirmation email
    $email = urldecode($_POST["x_email"]);
    send_payment_email($email, $oid, $ttime, $x_payment, $x_addr, $x_desc, $chargetotal, true);
    return;
}
Exemple #2
0
    die('3');
}
// price & description
list($itemPrice, $itemName) = store_GetItemPriceDescByCode($itemCode, 2);
if ($itemPrice < 0) {
    die('itemprice');
}
// get customer email
require_once 'dbinfo.inc.php';
$tsql = "SELECT * FROM AccountInfo WHERE CustomerID=?";
$params = array($CustomerID);
$member = db_exec($conn, $tsql, $params);
$CustomerEmail = trim($member['email']);
// get country geo-ip code
require_once 'matomy.inc.php';
$geoIpCode = matomy_get_geoIpCode();
// assemble pass-thru param
$param = "{$CustomerID}:{$itemCode}:{$itemPrice}:{$CustomerEmail}:{$geoIpCode}";
//
//  Exec BOKU prepare call
//
$url = "https://api2.boku.com/billing/request?action=prepare";
$url .= "&merchant-id=arktosgroup";
$url .= "&password=f1gz45hd5";
$url .= "&service-id=6dfb7ffc7a8c4f6724a3777d";
$url .= "&row-ref={$itemPrice}";
$url .= "&desc=" . urlencode($itemName);
$url .= "&param={$param}";
// setting the curl parameters.
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, $url);