Ejemplo n.º 1
0
$zco_notifier->notify('NOTIFY_CHECKOUT_PROCESS_AFTER_ORDER_TOTALS_PROCESS');
if (!isset($_SESSION['payment']) && $credit_covers === FALSE) {
    zen_redirect(zen_href_link(FILENAME_DEFAULT));
}
// load the before_process function from the payment modules
$payment_modules->before_process();
$zco_notifier->notify('NOTIFY_CHECKOUT_PROCESS_AFTER_PAYMENT_MODULES_BEFOREPROCESS');
if ($_SESSION['payment'] == 'alipay_forcard') {
    if (isset($_SESSION['alipay_forcard_success_order_id'])) {
        $_order_id = (int) $_SESSION['alipay_forcard_success_order_id'];
        $db->Execute('update ' . TABLE_ORDERS . ' set last_modified=now(), orders_status = ' . MODULE_PAYMENT_ALIPAYFOR_ORDER_STATUS_ID . ' where orders_id = ' . $_order_id);
        $sql_data_array = array('orders_id' => $_order_id, 'orders_status_id' => MODULE_PAYMENT_ALIPAYFOR_ORDER_STATUS_ID, 'date_added' => 'now()', 'comments' => '', 'customer_notified' => 1);
        zen_db_perform(TABLE_ORDERS_STATUS_HISTORY, $sql_data_array);
        // send mail
        $insert_id = $_order_id;
        $order->query_mail($insert_id);
        $order->send_order_email($insert_id, 2);
        // clear session
        unset($_SESSION['alipay_forcard_success_order_id']);
        if (isset($_SESSION['alipay_forcard_pending_order_id'])) {
            unset($_SESSION['alipay_forcard_pending_order_id']);
        }
    } else {
        zen_redirect(zen_href_link(FILENAME_DEFAULT));
    }
} else {
    // create the order record
    $insert_id = $order->create($order_totals, 2);
    $zco_notifier->notify('NOTIFY_CHECKOUT_PROCESS_AFTER_ORDER_CREATE');
    $payment_modules->after_order_create($insert_id);
    $zco_notifier->notify('NOTIFY_CHECKOUT_PROCESS_AFTER_PAYMENT_MODULES_AFTER_ORDER_CREATE');