コード例 #1
0
<?php 
// 宅配物流訂單幕後建立
define('HOME_URL', 'http://www.sample.com.tw/logistics_dev');
require 'AllPay.Logistics.Integration.php';
try {
    $AL = new AllpayLogistics();
    $AL->HashKey = '5294y06JbISpM5x9';
    $AL->HashIV = 'v77hoKGq4kWxNNIS';
    $AL->Send = array('MerchantID' => '2000132', 'MerchantTradeNo' => 'no' . date('YmdHis'), 'MerchantTradeDate' => date('Y/m/d H:i:s'), 'LogisticsType' => LogisticsType::HOME, 'LogisticsSubType' => LogisticsSubType::TCAT, 'GoodsAmount' => 1500, 'CollectionAmount' => 10, 'IsCollection' => IsCollection::NO, 'GoodsName' => '測試商品', 'SenderName' => '歐付寶(寄)', 'SenderPhone' => '0226550115', 'SenderCellPhone' => '0911222333', 'ReceiverName' => '歐付寶(收)', 'ReceiverPhone' => '0226550115', 'ReceiverCellPhone' => '0933222111', 'ReceiverEmail' => '*****@*****.**', 'TradeDesc' => '測試交易敘述', 'ServerReplyURL' => HOME_URL . '/ServerReplyURL.php', 'LogisticsC2CReplyURL' => HOME_URL . '/LogisticsC2CReplyURL.php', 'Remark' => '測試備註', 'PlatformID' => '');
    $AL->SendExtend = array('SenderZipCode' => '11560', 'SenderAddress' => '台北市南港區三重路19-2號10樓D棟', 'ReceiverZipCode' => '11560', 'ReceiverAddress' => '台北市南港區三重路19-2號5樓D棟', 'Temperature' => Temperature::FREEZE, 'Distance' => Distance::SAME, 'Specification' => Specification::CM_150, 'ScheduledDeliveryTime' => ScheduledDeliveryTime::TIME_17_20);
    // BGCreateShippingOrder()
    $Result = $AL->BGCreateShippingOrder();
    echo '<pre>' . print_r($Result, true) . '</pre>';
} catch (Exception $e) {
    echo $e->getMessage();
}
コード例 #2
0
}
assert_have($sTest_Result, "allpayForm", $sTest_Subject);
unset($sHome_URL, $oA_L, $sTest_Subject, $sTest_Result);
/**
 * 幕後超商取貨物流訂單產生(CreateShippingOrder)
 */
$sTest_Subject = "allPay 幕後超商取貨物流訂單產生(BGCreateShippingOrder)";
$sTest_Result = "";
$sHome_URL = "http://www.sample.com.tw";
try {
    $oA_L = new AllpayLogistics();
    $oA_L->HashKey = TestMerchantInfo::HASH_KEY;
    $oA_L->HashIV = TestMerchantInfo::HASH_IV;
    $oA_L->Send = array("MerchantID" => TestMerchantInfo::MERCHANT_ID, "MerchantTradeNo" => "no" . date("YmdHis"), "MerchantTradeDate" => date("Y/m/d H:i:s"), "LogisticsType" => LogisticsType::CVS, "LogisticsSubType" => LogisticsSubType::UNIMART, "GoodsAmount" => 1500, "CollectionAmount" => 10, "IsCollection" => IsCollection::YES, "GoodsName" => "測試商品", "SenderName" => "測試寄件者", "SenderPhone" => "0226550115", "SenderCellPhone" => "0911222333", "ReceiverName" => "測試收件者", "ReceiverPhone" => "0226550115", "ReceiverCellPhone" => "0933222111", "ReceiverEmail" => "*****@*****.**", "TradeDesc" => "測試交易敘述", "ServerReplyURL" => $sHome_URL . "/ServerReplyURL.php", "LogisticsC2CReplyURL" => $sHome_URL . "/LogisticsC2CReplyURL.php", "Remark" => "測試備註", "PlatformID" => "");
    $oA_L->SendExtend = array("ReceiverStoreID" => "991182", "ReturnStoreID" => "991182");
    $sTest_Result = $oA_L->BGCreateShippingOrder();
} catch (Exception $e) {
    $sTest_Result = $e->getMessage();
    unset($e);
}
assert_internal_type("array", gettype($sTest_Result), $sTest_Subject);
unset($sHome_URL, $oA_L, $sTest_Subject, $sTest_Result);
/**
 * 宅配逆物流訂單產生(CreateHomeReturnOrder)
 */
$sTest_Subject = "allPay 宅配逆物流訂單產生(CreateHomeReturnOrder)";
$sTest_Result = "";
$sHome_URL = "http://www.sample.com.tw";
try {
    $oA_L = new AllpayLogistics();
    $oA_L->HashKey = TestMerchantInfo::HASH_KEY;