if (!defined("WP_USE_THEMES")) {
    global $isapage;
    $isapage = true;
    define('WP_USE_THEMES', false);
    require_once dirname(__FILE__) . '/../../../../wp-load.php';
}
// Require TwoCheckout class
if (!class_exists("Twocheckout")) {
    require_once PMPRO_DIR . "/includes/lib/Twocheckout/Twocheckout.php";
}
//some globals
global $wpdb, $gateway_environment, $logstr;
$logstr = "";
//will put debug info here and write to inslog.txt
//validate?
if (false || !pmpro_twocheckoutValidate()) {
    inslog("(!!FAILED VALIDATION!!)");
    //validation failed
    pmpro_twocheckoutExit();
}
//assign posted variables to local variables
$message_type = pmpro_getParam('message_type', 'REQUEST');
$md5_hash = pmpro_getParam('md5_hash', 'REQUEST');
$txn_id = pmpro_getParam('sale_id', 'REQUEST');
$recurring = pmpro_getParam('recurring', 'REQUEST');
$order_id = pmpro_getParam('merchant_order_id', 'REQUEST');
if (empty($order_id)) {
    $order_id = pmpro_getParam('vendor_order_id', 'REQUEST');
}
$product_id = pmpro_getParam('item_id_1', 'REQUEST');
// Should be item 0 or 1?
if (!defined("ABSPATH")) {
    global $isapage;
    $isapage = true;
    define('WP_USE_THEMES', false);
    require_once dirname(__FILE__) . '/../../../../wp-load.php';
}
// Require TwoCheckout class
if (!class_exists("Twocheckout")) {
    require_once PMPRO_DIR . "/includes/lib/Twocheckout/Twocheckout.php";
}
//some globals
global $wpdb, $gateway_environment, $logstr;
$logstr = "";
//will put debug info here and write to inslog.txt
//validate?
if (!pmpro_twocheckoutValidate()) {
    inslog("(!!FAILED VALIDATION!!)");
    //validation failed
    pmpro_twocheckoutExit();
}
//assign posted variables to local variables
$message_type = pmpro_getParam('message_type', 'REQUEST');
$md5_hash = pmpro_getParam('md5_hash', 'REQUEST');
$txn_id = pmpro_getParam('sale_id', 'REQUEST');
$recurring = pmpro_getParam('recurring', 'REQUEST');
$order_id = pmpro_getParam('merchant_order_id', 'REQUEST');
if (empty($order_id)) {
    $order_id = pmpro_getParam('vendor_order_id', 'REQUEST');
}
$product_id = pmpro_getParam('item_id_1', 'REQUEST');
// Should be item 0 or 1?