'amt' => Tools::getValue("amt"), //交易金額 'expire_date' => Tools::getValue("expire_date"), //繳費截止日期 'succ' => Tools::getValue("succ"), //交易狀態 'payer_bank' => Tools::getValue("payer_bank"), //付款人銀行代碼 'payer_acc' => Tools::getValue("payer_acc"), //付款人銀行帳號後5碼 'proc_date' => Tools::getValue("proc_date"), //處理日期 'proc_time' => Tools::getValue("proc_time"), //處理時間 'tac' => Tools::getValue("tac"), //交易驗證壓碼 )); */ //echo"ddd"; $checkTemp=New greenworld_vacc(); // 商店設定在ECBank管理後台的交易加密私鑰 $key = $checkTemp->getEncryptionCode(); // 組合字串 $amount = $checkTemp->getAmount(Tools::getValue("od_sob")); $serial = trim($_REQUEST['proc_date'].$_REQUEST['proc_time'].$_REQUEST['tsr']); // 回傳的交易驗證壓碼 $tac = trim($_REQUEST['tac']); // ECBank 驗證Web Service網址 $ws_url = 'https://ecbank.com.tw/web_service/get_outmac_valid.php?key='.$key. '&serial='.$serial. '&tac='.$tac; // 取得驗證結果 (也可以使用curl) $tac_valid = file_get_contents($ws_url); if ($tac_valid == 'valid=1' ) {
session_destroy(); }else{ $_SESSION["checkStep"]="1"; echo Module::display(_iMODULE_NAME_,'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.="&expire_day=".$CheckPay->getExpireDay(); $PostData.="&setbank=".$CheckPay->getSetBank(); $PostData.="&payment_type=".$CheckPay->getPaymentType(); $PostData.="&amt=".$inttotal; $PostData.="&od_sob=".$CheckPay->currentOrder; $PostData.="&ok_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);