Example #1
0
        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');
    

    
    
    


    
Example #2
0
    } 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();
        $URL = $CheckPay->getBaseURL();
        $PostData .= "mer_id=" . $CheckPay->getShopCode();
        $PostData .= "&enc_key=" . $CheckPay->getEncryptionCode();
        $PostData .= "&payment_type=" . $CheckPay->getPaymentType();
        $PostData .= "&amt=" . $inttotal;
        $PostData .= "&od_sob=" . $CheckPay->currentOrder;
        $PostData .= "&return_url=" . rawurlencode("http://" . $_SERVER["HTTP_HOST"] . $CheckPay->path . "doFictitiousDetonate.php");
        // 建立CURL連線
        $ch = curl_init();
        // 設定擷取的URL網址
        curl_setopt($ch, CURLOPT_URL, $URL);
        curl_setopt($ch, CURLOPT_HEADER, false);
        //將curl_exec()獲取的訊息以文件流的形式返回,而不是直接輸出。
        curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
        //設定CURLOPT_POST 為 1或true,表示要用POST方式傳遞
        curl_setopt($ch, CURLOPT_POST, 0);
        //CURLOPT_POSTFIELDS 後面則是要傳接的POST資料。
        curl_setopt($ch, CURLOPT_POSTFIELDS, $PostData);
        // 執行