Example #1
0
/**
 * Description of linkGreenWorld
 *
 * @author 李泓承
 */

include_once(dirname(__FILE__).'/../../config/config.inc.php');
include_once(dirname(__FILE__).'/../../header.php');
include_once(dirname(__FILE__).'/../../init.php');
include_once(dirname(__FILE__).'/greenworld_ecpay.php');
include_once(dirname(__FILE__).'/../../classes/OrderHistory.php');

session_start();

global $cookie;
$CheckPay=new greenworld_ecpay();
$authorized = false;
foreach (Module::getPaymentModules() as $module)
    if ($module['name'] == $CheckPay->name){
            $authorized = true;
            break;
    }
if (!$authorized)
    die(Tools::displayError('This payment method is not available.'));


$customer = new Customer((int)$cart->id_customer);
$total = $cart->getOrderTotal(true, Cart::BOTH);
$inttotal=round($total);
$HomePage=Tools::getShopDomain(true, true).__PS_BASE_URI__;
$order = new Order((int)$CheckPay->currentOrder);
    'payment_type'  =>  Tools::getValue("payment_type"),    //付款方式
    'ECBANK_tsr'    =>  Tools::getValue("tsr"),             //交易單號是唯一的編號
    'od_sob'        =>  Tools::getValue("od_sob"),          //回傳取號時傳入的自訂交易編號
    '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_ecpay();
    
    // 商店設定在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;
Example #3
0
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
/**
 * Description of linkGreenWorld
 *
 * @author 李泓承
 */
include_once dirname(__FILE__) . '/../../config/config.inc.php';
include_once dirname(__FILE__) . '/../../header.php';
include_once dirname(__FILE__) . '/../../init.php';
include_once dirname(__FILE__) . '/greenworld_ecpay.php';
include_once dirname(__FILE__) . '/../../classes/OrderHistory.php';
session_start();
global $cookie;
$CheckPay = new greenworld_ecpay();
$authorized = false;
foreach (Module::getPaymentModules() as $module) {
    if ($module['name'] == $CheckPay->name) {
        $authorized = true;
        break;
    }
}
if (!$authorized) {
    die(Tools::displayError('This payment method is not available.'));
}
$customer = new Customer((int) $cart->id_customer);
$total = $cart->getOrderTotal(true, Cart::BOTH);
$inttotal = round($total);
$HomePage = Tools::getShopDomain(true, true) . __PS_BASE_URI__;
$order = new Order((int) $CheckPay->currentOrder);