Esempio n. 1
0
    session_destroy();   
}

if(!session_is_registered("checkStep")){
    session_register("checkStep");
    
    if ($total==0){
        echo Module::display(_iMODULE_NAME_ECPAY_,'ErrorStep.tpl');
        session_destroy(); 
    }else{
        $_SESSION["checkStep"]="1";
        echo Module::display(_iMODULE_NAME_ECPAY_,'validationOrder.tpl');
    }
    
}else if($_SESSION["checkStep"]=="1" && $check=="1"){
    $CheckPay->validateOrder((int)$cart->id, 1, $inttotal, $CheckPay->displayName, NULL, array(), NULL, false, $customer->secure_key);
    $newOrderStatusId="1";
    $history = new OrderHistory();
    $history->id_order = (int)($CheckPay->currentOrder);
    $history->changeIdOrderState((int)$newOrderStatusId, (int)($CheckPay->currentOrder));
    $history->addWithemail();
    
    $smarty->assign(array(  'mer_id'        =>  $CheckPay->getShopCode(),
                            'payment_type'  =>  $CheckPay->getPaymentType(),
                            'amt'           =>  $inttotal,
                            "od_sob"        =>  $CheckPay->currentOrder,
                            "URL"           =>  $CheckPay->getBaseURL(),
                            "return_url"    =>  "http://".$_SERVER["HTTP_HOST"].__PS_BASE_URI__.'order-confirmation.php?key='.$customer->secure_key.'&id_cart='.(int)($cart->id).'&id_module='.(int)$CheckPay->id.'&id_order='.(int)$CheckPay->currentOrder,
        ));

    echo Module::display(_iMODULE_NAME_ECPAY_,'sentToEcPay.tpl');