Example #1
0
    error_log("Invalid IP address: " . $remoteIP);
    exit;
}
if (empty($_POST['email'])) {
    header("HTTP/1.1 400 Missing parameter");
    error_log("POST variable 'email' is empty – exiting.");
    exit;
}
if (empty($_POST['last_name']) || empty($_POST['first_name']) || empty($_POST['payment_gross']) || empty($_POST['transaction_id'])) {
    header("HTTP/1.1 400 Missing parameter");
    error_log("Incomplete POST variables – exiting.");
    exit;
}
//
$app = new Application();
$app->select(7);
if (!$app->ok()) {
    header("HTTP/1.1 400 Missing parameter");
    error_log("Application not found!");
    exit;
}
//
$o = new Order();
$o->app_id = $app->id;
$o->item_name = $app->name;
$o->dt = dater();
$o->type = 'MUPromo';
$o->first_name = $_POST['first_name'];
$o->last_name = $_POST['last_name'];
$o->payer_email = $_POST['email'];
$o->txn_id = $_POST['transaction_id'];
Example #2
0
<?php

require 'includes/master.inc.php';
$app = new Application();
$app->select($_POST['item_number']);
// custom
if (!$app->ok()) {
    error_log("Application {$_POST['item_name']} {$_POST['item_number']} not found!");
    exit;
}
// FastSpring security check...
if (md5($_REQUEST['security_data'] . $app->fs_security_key) != $_REQUEST['security_hash']) {
    die('Security check failed.');
}
$o = new Order();
$o->payer_email = $_POST['CustomerEmail'];
$o->first_name = $_POST['CustomerFirstName'];
$o->last_name = $_POST['CustomerLastName'];
$o->txn_id = $_POST['OrderReference'];
$o->item_name = $_POST['item_name'];
// custom
$o->residence_country = $_POST['AddressCountry'];
$o->quantity = $_POST['quantity'];
// custom
$o->mc_currency = $_POST['mc_currency'];
// custom
$o->payment_gross = preg_replace('/[^0-9.]/', '', $_POST['payment_gross']);
// custom
$o->mc_gross = $o->payment_gross;
$o->license = $_POST['license'];
// custom - used for cocoafob