Beispiel #1
0
<?php 
// 電子地圖
define('HOME_URL', 'http://www.sample.com.tw/logistics_dev');
require 'AllPay.Logistics.Integration.php';
try {
    $AL = new AllpayLogistics();
    $AL->Send = array('MerchantID' => '2000132', 'MerchantTradeNo' => 'no' . date('YmdHis'), 'LogisticsSubType' => LogisticsSubType::UNIMART, 'IsCollection' => IsCollection::NO, 'ServerReplyURL' => HOME_URL . '/ServerReplyURL.php', 'ExtraData' => '歐付寶測試額外資訊', 'Device' => Device::PC);
    // CvsMap(Button名稱, Form target)
    $html = $AL->CvsMap('電子地圖(統一)');
    echo $html;
} catch (Exception $e) {
    echo $e->getMessage();
}
<?php

require 'AllPay.Logistics.Integration.php';
try {
    $AL = new AllpayLogistics();
    $AL->Send = array('MerchantID' => '2000132', 'MerchantTradeNo' => date('YmdHis'), 'LogisticsSubType' => LogisticsSubType::UNIMART, 'IsCollection' => IsCollection::NO, 'ServerReplyURL' => 'http://localhost/allpay/store.php', 'ExtraData' => '測試額外資訊', 'Device' => Device::PC);
    $Result = $AL->CvsMap('電子地圖', '_blank');
    echo $Result;
} catch (Exception $e) {
    echo $e->getMessage();
}
} 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);
/**
 * 全家電子地圖串接(CvsMap)
 */
$sTest_Subject = "allPay 全家電子地圖串接(CvsMap)";
$sTest_Result = "";
$sHome_URL = "http://www.sample.com.tw";
try {
    $oA_L = new AllpayLogistics();
    $oA_L->Send = array("MerchantID" => TestMerchantInfo::MERCHANT_ID, "MerchantTradeNo" => "no" . date("YmdHis"), "LogisticsSubType" => LogisticsSubType::FAMILY, "IsCollection" => IsCollection::NO, "ServerReplyURL" => $sHome_URL . "/ServerReplyURL.php", "ExtraData" => "測試額外資訊", "Device" => Device::PC);
    $sTest_Result = $oA_L->CvsMap("電子地圖(全家)");
} 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);
/**
 * 幕前宅配物流訂單產生(CreateShippingOrder)
 */
$sTest_Subject = "allPay 宅配物流訂單產生(CreateShippingOrder)";
$sTest_Result = "";
$sHome_URL = "http://www.sample.com.tw";
try {
    $oA_L = new AllpayLogistics();
    $oA_L->HashKey = TestMerchantInfo::HASH_KEY;