Example #1
0
<?php

$merID = '6021';
$MerchantName = 'WantGo';
$MerchantID = '8220130016865';
$TerminalID = '99804617';
$purchAmt = $_GET['purchAmt'];
$txType = '0';
$Option = '1';
$OrderDetail = 'test';
$AutoCap = '0';
$customize = '0';
$cid = $_GET['cid'];
$Key = '5ZceaET0VMiI7MVdqNtwA00G';
$AuthResURL = $_SC['siteurl'] . "index.php?app=checkout&do=cardsendok&cid={$cid}";
$debug = '0';
$OrderDesc = 'test';
$Pid = 'a123456789';
$Brithday = '02261988';
$ProdCode = '00';
include_once 'auth_mpi/auth_mpi_mac.php';
$MACString = auth_in_mac($MerchantID, $TerminalID, $cid, $purchAmt, $txType, $Option, $Key, $MerchantName, $AuthResURL, $OrderDetail, $AutoCap, $customize, $debug);
$URLEnc = get_auth_urlenc($MerchantID, $TerminalID, $cid, $purchAmt, $txType, $Option, $Key, $MerchantName, $AuthResURL, $OrderDetail, $AutoCap, $customize, $MACString, $debug);
Example #2
0
 public function checkout_card_post()
 {
     $data = $this->data;
     $this->form_validation->set_rules('receive_name_Str', '收件人姓名', 'required');
     $this->form_validation->set_rules('receive_address_Str', '收件人地址', 'required');
     $this->form_validation->set_rules('receive_phone_Str', '收件人電話', 'required');
     if ($this->form_validation->run() !== FALSE) {
         $receive_name_Str = $this->input->post('receive_name_Str', TRUE);
         $receive_address_Str = $this->input->post('receive_address_Str', TRUE);
         $receive_phone_Str = $this->input->post('receive_phone_Str', TRUE);
         $receive_time_Str = $this->input->post('receive_time_Str', TRUE);
         $receive_remark_Str = $this->input->post('receive_remark_Str', TRUE);
         //讀取建構中的訂單
         $OrderShop = new OrderShop(['db_where_Arr' => array('uid_Num' => $data['User']->uid_Num, 'order_status_Num' => -1)]);
         if ($OrderShop->pay_paytype_Str === 'card' || $OrderShop->pay_paytype_Str === 'cash_on_delivery') {
             $OrderShop->pay_status_Num = 1;
             $OrderShop->paycheck_status_Num = 1;
         }
         $OrderShop->receive_name_Str = $receive_name_Str;
         $OrderShop->receive_address_Str = $receive_address_Str;
         $OrderShop->receive_phone_Str = $receive_phone_Str;
         $OrderShop->receive_time_Str = $receive_time_Str;
         $OrderShop->receive_remark_Str = $receive_remark_Str;
         $OrderShop->update(array());
         //金流開始
         include_once APPPATH . 'libraries/auth_mpi/auth_mpi_mac.php';
         $purchAmt = (int) $OrderShop->pay_price_total_Num;
         $cid = (int) $OrderShop->orderid_Num;
         // $data['AuthResURL'] = "http://localhost/ipix/order/checkout_card_response_post/";
         $data['AuthResURL'] = 'http://' . $_SERVER['HTTP_HOST'] . base_url("order/checkout_card_response_post/");
         $MerchantName = '大田映像有限公司';
         $MerchantID = '8220276806380';
         $TerminalID = '90008132';
         $txType = '0';
         $Option = '1';
         $OrderDetail = '大田映像有限公司';
         $AutoCap = '1';
         $customize = '1';
         $Key = 'asxPcbeXE7o9qn2dlH0hC8ti';
         $debug = '0';
         $data['merID'] = '3001';
         $data['MACString'] = auth_in_mac($MerchantID, $TerminalID, $cid, $purchAmt, $txType, $Option, $Key, $MerchantName, $data['AuthResURL'], $OrderDetail, $AutoCap, $customize, $debug);
         $data['URLEnc'] = get_auth_urlenc($MerchantID, $TerminalID, $cid, $purchAmt, $txType, $Option, $Key, $MerchantName, $data['AuthResURL'], $OrderDetail, $AutoCap, $customize, $data['MACString'], $debug);
         //輸出模板
         $this->load->view('shop/order/checkout_card', $data);
     } else {
         $message_Str = '請填寫詳細收件人資料';
         $url_Str = 'order/checkout';
         $this->load->model('Message');
         $this->Message->show(array('message' => $message_Str, 'url' => $url_Str));
     }
 }