Пример #1
0
}
if (DISPLAY_CONDITIONS_ON_CHECKOUT == 'true') {
    if (!isset($_POST['conditions']) || $_POST['conditions'] != '1') {
        $messageStack->add_session('checkout_payment', ERROR_CONDITIONS_NOT_ACCEPTED, 'error');
    }
}
require_once BITCOMMERCE_PKG_PATH . 'classes/CommerceOrder.php';
$order = new order();
require_once DIR_FS_CLASSES . 'order_total.php';
$order_total_modules = new order_total();
$order_total_modules->collect_posts();
// load the selected payment module
require_once BITCOMMERCE_PKG_PATH . 'classes/CommercePaymentManager.php';
$paymentManager = new CommercePaymentManager($_SESSION['payment']);
$paymentManager->update_status($_REQUEST);
if ($order->hasPaymentDue() && is_array($paymentManager->modules) && sizeof($paymentManager->modules) > 1 && (empty(${$_SESSION}['payment']) || !is_object(${$_SESSION}['payment']))) {
    $messageStack->add_session('checkout_payment', ERROR_NO_PAYMENT_MODULE_SELECTED, 'error');
}
if ($messageStack->size('checkout_payment') > 0) {
    zen_redirect(zen_href_link(FILENAME_CHECKOUT_PAYMENT, '', 'SSL'));
}
//echo $messageStack->size('checkout_payment');
//die('here');
if (is_array($paymentManager->modules)) {
    if (!$paymentManager->verifyPayment($_REQUEST, $order)) {
        zen_redirect(zen_href_link(FILENAME_CHECKOUT_PAYMENT, NULL, 'SSL', true, false));
    }
}
// load the selected shipping module
require BITCOMMERCE_PKG_PATH . 'classes/CommerceShipping.php';
$shipping_modules = new CommerceShipping($_SESSION['shipping']);
Пример #2
0
    //		zen_redirect(zen_href_link(FILENAME_CHECKOUT_PAYMENT,'','SSL'));
}
// load selected payment module
require BITCOMMERCE_PKG_PATH . 'classes/CommercePaymentManager.php';
$paymentManager = new CommercePaymentManager($_SESSION['payment']);
// load the selected shipping module
require BITCOMMERCE_PKG_PATH . 'classes/CommerceShipping.php';
$shipping_modules = new CommerceShipping($_SESSION['shipping']);
require BITCOMMERCE_PKG_PATH . 'classes/CommerceOrder.php';
$order = new order();
require DIR_FS_CLASSES . 'order_total.php';
$order_total_modules = new order_total();
$order_totals = $order_total_modules->process($_REQUEST);
$gBitDb->mDb->StartTrans();
// load the before_process function from the payment modules
if ($order->hasPaymentDue() && !$paymentManager->processPayment($_REQUEST, $order)) {
    zen_redirect(zen_href_link(FILENAME_CHECKOUT_PAYMENT, NULL, 'SSL', true, false));
}
$newOrderId = $order->create($order_totals, 2);
$order->create_add_products($newOrderId);
$paymentManager->after_order_create($newOrderId);
$order->send_order_email($newOrderId);
$gBitDb->mDb->completeTrans();
$paymentManager->after_process();
$gBitCustomer->mCart->reset(true);
// unregister session variables used during checkout
foreach (array('sendto', 'billto', 'shipping', 'payment', 'comments') as $key) {
    if (isset($_SESSION[$key])) {
        unset($_SESSION[$key]);
    }
}