<?php file_put_contents('./' . basename(__FILE__, '.php') . '.log', print_r($_POST, true)); include '..\\lib\\AllPay.Logistics.Integration.PHP'; include '..\\lib\\misc.inc'; _display($_POST); try { $AL = new AllpayLogistics(); $AL->HashKey = '5294y06JbISpM5x9'; $AL->HashIV = 'v77hoKGq4kWxNNIS'; // $AL->HashKey = 'XBERn1YOvpM9nfZc'; // $AL->HashIV = 'h1ONHk4P4yqbl5LK'; $AL->CheckOutFeedback(); } catch (Exception $e) { _display('Exception : ' . $e->getMessage()); } _display('End');
$oA_L = new AllpayLogistics(); $oA_L->HashKey = TestC2CMerchantInfo::HASH_KEY; $oA_L->HashIV = TestC2CMerchantInfo::HASH_IV; $oA_L->Send = array("MerchantID" => TestC2CMerchantInfo::MERCHANT_ID, "AllPayLogisticsID" => "11810", "CVSPaymentNo" => "05902347158", "PlatformID" => ""); // PrintFamilyC2CBill(Button 名稱, Form target) $sTest_Result = $oA_L->PrintFamilyC2CBill("列印全家小白單(全家超商 C2C)"); } catch (Exception $e) { $sTest_Result = $e->getMessage(); unset($e); } assert_have($sTest_Result, "allpayForm", $sTest_Subject); unset($sHome_URL, $oA_L, $sTest_Subject, $sTest_Result); /** * CheckMacValue 驗證功能(CheckOutFeedback) */ $sTest_Subject = "allPay CheckMacValue 驗證功能(CheckOutFeedback)"; $sTest_Result = ""; $sHome_URL = "http://www.sample.com.tw"; $aTest_POST = array("MerchantID" => TestMerchantInfo::MERCHANT_ID, "MerchantTradeNo" => "no20160816070914", "MerchantTradeDate" => "2016/08/16 07:09:14", "LogisticsType" => "Home", "LogisticsSubType" => "TCAT", "GoodsAmount" => "1500", "IsCollection" => "N", "GoodsName" => "測試商品", "SenderName" => "測試寄件者", "SenderPhone" => "0226550115", "SenderCellPhone" => "0911222333", "ReceiverName" => "測試收件者", "ReceiverPhone" => "0226550115", "ReceiverCellPhone" => "0933222111", "ReceiverEmail" => "*****@*****.**", "TradeDesc" => "測試交易敘述", "ServerReplyURL" => $sHome_URL . "/ServerReplyURL.php", "ClientReplyURL" => $sHome_URL . "/ClientReplyURL.php", "LogisticsC2CReplyURL" => $sHome_URL . "/LogisticsC2CReplyURL.php", "Remark" => "測試備註", "PlatformID" => "", "SenderZipCode" => "11560", "SenderAddress" => "台北市南港區三重路 19-2 號 10 樓 D 棟", "ReceiverZipCode" => "11560", "ReceiverAddress" => "台北市南港區三重路 19-2 號 5 樓 D 棟", "Temperature" => "0003", "Distance" => "01", "Specification" => "0004", "ScheduledDeliveryTime" => "3", "ScheduledPickupTime" => "4", "CheckMacValue" => "BE972990BFE7BE986E33EE4673D37A45"); try { $oA_L = new AllpayLogistics(); $oA_L->HashKey = TestMerchantInfo::HASH_KEY; $oA_L->HashIV = TestMerchantInfo::HASH_IV; // CheckOutFeedback(POST 參數) $oA_L->CheckOutFeedback($aTest_POST); } catch (Exception $e) { $sTest_Result = $e->getMessage(); unset($e); } assert_empty($sTest_Result, $sTest_Subject); unset($sHome_URL, $oA_L, $sTest_Subject, $sTest_Result, $aTest_POST);