<?php 
// 超商取貨逆物流訂單(全家超商B2C)
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', 'AllPayLogisticsID' => '15624', 'ServerReplyURL' => HOME_URL . '/ServerReplyURL.php', 'GoodsName' => '測試商品A#測試商品B', 'GoodsAmount' => 1500, 'SenderName' => '歐付寶(寄)', 'SenderPhone' => '0226550115', 'Remark' => '測試備註', 'Quantity' => '1#2', 'Cost' => '100#700', 'PlatformID' => '');
    // CreateFamilyB2CReturnOrder()
    $Result = $AL->CreateFamilyB2CReturnOrder();
    echo '<pre>' . print_r($Result, true) . '</pre>';
} catch (Exception $e) {
    echo $e->getMessage();
}
Ejemplo n.º 2
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();
}
Ejemplo n.º 3
0
<?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');
<?php 
// 物流訂單查詢
require '../lib/AllPay.Logistics.Integration.php';
try {
    $AL = new AllpayLogistics();
    $AL->HashKey = 'XBERn1YOvpM9nfZc';
    $AL->HashIV = 'h1ONHk4P4yqbl5LK';
    $AL->Send = array('MerchantID' => '2000933', 'AllPayLogisticsID' => '11796', 'PlatformID' => '');
    $Result = $AL->QueryLogisticsInfo();
    echo '<pre>' . print_r($Result, true) . '</pre>';
} catch (Exception $e) {
    echo $e->getMessage();
}
Ejemplo n.º 5
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', 'ClientReplyURL' => HOME_URL . '/ClientReplyURL.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);
    // CreateShippingOrder(Button名稱, Form target)
    $html = $AL->CreateShippingOrder('宅配物流訂單建立');
    echo $html;
} catch (Exception $e) {
    echo $e->getMessage();
}
Ejemplo n.º 6
0
<?php 
// 列印繳款單(統一超商C2C)
require 'AllPay.Logistics.Integration.php';
try {
    $AL = new AllpayLogistics();
    $AL->HashKey = 'XBERn1YOvpM9nfZc';
    $AL->HashIV = 'h1ONHk4P4yqbl5LK';
    $AL->Send = array('MerchantID' => '2000933', 'AllPayLogisticsID' => '11808', 'CVSPaymentNo' => 'F0015102', 'CVSValidationNo' => '4130', 'PlatformID' => '');
    // PrintUnimartC2CBill(Button名稱, Form target)
    $html = $AL->PrintUnimartC2CBill('列印繳款單(統一超商C2C)');
    echo $html;
} catch (Exception $e) {
    echo $e->getMessage();
}
<?php 
// 宅配物流訂單建立
require '../lib/AllPay.Logistics.Integration.php';
try {
    $AL = new AllpayLogistics();
    $AL->HashKey = '5294y06JbISpM5x9';
    $AL->HashIV = 'v77hoKGq4kWxNNIS';
    $AL->Send = array('MerchantID' => '2000132', 'MerchantTradeNo' => 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' => 'http://www.sample.com.tw/ServerReplyURL.php', 'ClientReplyURL' => 'http://www.sample.com.tw/ClientReplyURL.php', 'LogisticsC2CReplyURL' => 'http://www.sample.com.tw/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);
    $Result = $AL->CreateShippingOrder('物流訂單建立', '_blank');
    echo $Result;
} catch (Exception $e) {
    echo $e->getMessage();
}
<?php 
// 列印繳款單(統一超商C2C)
require '../lib/AllPay.Logistics.Integration.php';
try {
    $AL = new AllpayLogistics();
    $AL->HashKey = 'XBERn1YOvpM9nfZc';
    $AL->HashIV = 'h1ONHk4P4yqbl5LK';
    $AL->Send = array('MerchantID' => '2000933', 'AllPayLogisticsID' => '11808', 'CVSPaymentNo' => 'F0015102', 'CVSValidationNo' => '4130', 'PlatformID' => '');
    $Result = $AL->PrintUnimartC2CBill('列印繳款單(統一超商C2C)');
    echo $Result;
} catch (Exception $e) {
    echo $e->getMessage();
}
<?php 
// 取消訂單(統一超商C2C)
require '../lib/AllPay.Logistics.Integration.php';
try {
    $AL = new AllpayLogistics();
    $AL->HashKey = 'XBERn1YOvpM9nfZc';
    $AL->HashIV = 'h1ONHk4P4yqbl5LK';
    $AL->Send = array('MerchantID' => '2000933', 'AllPayLogisticsID' => '11796', 'CVSPaymentNo' => 'F0015091', 'CVSValidationNo' => '3207', 'PlatformID' => '');
    $Result = $AL->CancelUnimartLogisticsOrder();
    echo '<pre>' . print_r($Result, true) . '</pre>';
} catch (Exception $e) {
    echo $e->getMessage();
}
<?php 
// 宅配逆物流訂單建立
require '../lib/AllPay.Logistics.Integration.php';
try {
    $AL = new AllpayLogistics();
    $AL->HashKey = '5294y06JbISpM5x9';
    $AL->HashIV = 'v77hoKGq4kWxNNIS';
    $AL->Send = array('MerchantID' => '2000132', 'AllPayLogisticsID' => '11759', 'SenderName' => '歐付寶(寄)', 'SenderPhone' => '0226550115', 'SenderCellPhone' => '0910303216', 'SenderZipCode' => '11560', 'SenderAddress' => '台北市南港區三重路19-2號5樓D棟', 'ReceiverName' => '歐付寶(收)', 'ReceiverPhone' => '0226550116', 'ReceiverCellPhone' => '0910303217', 'ReceiverEmail' => '*****@*****.**', 'ReceiverZipCode' => '11560', 'ReceiverAddress' => '台北市南港區三重路19-2號5樓D棟', 'ServerReplyURL' => 'http://www.sample.com.tw/ServerReplyURL.php', 'PlatformID' => '');
    $Result = $AL->CreateHomeReturnOrder();
    echo '<pre>' . print_r($Result, true) . '</pre>';
} catch (Exception $e) {
    echo $e->getMessage();
}
Ejemplo n.º 11
0
<?php 
// 全家列印小白單(全家超商C2C)
require 'AllPay.Logistics.Integration.php';
try {
    $AL = new AllpayLogistics();
    $AL->HashKey = 'XBERn1YOvpM9nfZc';
    $AL->HashIV = 'h1ONHk4P4yqbl5LK';
    $AL->Send = array('MerchantID' => '2000933', 'AllPayLogisticsID' => '11810', 'CVSPaymentNo' => '05902347158', 'PlatformID' => '');
    // PrintFamilyC2CBill(Button名稱, Form target)
    $html = $AL->PrintFamilyC2CBill('全家列印小白單(全家超商C2C)');
    echo $html;
} catch (Exception $e) {
    echo $e->getMessage();
}
Ejemplo n.º 12
0
<?php 
// 產生托運單(宅配)/一段標(超商取貨)
require '../lib/AllPay.Logistics.Integration.php';
try {
    $AL = new AllpayLogistics();
    $AL->HashKey = '5294y06JbISpM5x9';
    $AL->HashIV = 'v77hoKGq4kWxNNIS';
    $AL->Send = array('MerchantID' => '2000132', 'AllPayLogisticsID' => '11807', 'PlatformID' => '');
    $Result = $AL->PrintTradeDoc('產生托運單/一段標');
    echo $Result;
} catch (Exception $e) {
    echo $e->getMessage();
}
Ejemplo n.º 13
0
<?php 
// 產生托運單(宅配)/一段標(超商取貨)
require 'AllPay.Logistics.Integration.php';
try {
    $AL = new AllpayLogistics();
    $AL->HashKey = '5294y06JbISpM5x9';
    $AL->HashIV = 'v77hoKGq4kWxNNIS';
    $AL->Send = array('MerchantID' => '2000132', 'AllPayLogisticsID' => '14559', 'PlatformID' => '');
    // PrintTradeDoc(Button名稱, Form target)
    $html = $AL->PrintTradeDoc('產生托運單/一段標');
    echo $html;
} catch (Exception $e) {
    echo $e->getMessage();
}
<?php 
// 廠商修改物流資訊(統一超商B2C)
require 'AllPay.Logistics.Integration.php';
try {
    $AL = new AllpayLogistics();
    $AL->HashKey = '5294y06JbISpM5x9';
    $AL->HashIV = 'v77hoKGq4kWxNNIS';
    $AL->Send = array('MerchantID' => '2000132', 'AllPayLogisticsID' => '15627', 'ShipmentDate' => date('Y/m/d', strtotime('+1 day')), 'ReceiverStoreID' => '991182', 'PlatformID' => '');
    // UpdateUnimartLogisticsInfo()
    $Result = $AL->UpdateUnimartLogisticsInfo();
    echo '<pre>' . print_r($Result, true) . '</pre>';
} catch (Exception $e) {
    echo $e->getMessage();
}
<?php 
// 全家列印小白單(全家超商C2C)
require '../lib/AllPay.Logistics.Integration.php';
try {
    $AL = new AllpayLogistics();
    $AL->HashKey = 'XBERn1YOvpM9nfZc';
    $AL->HashIV = 'h1ONHk4P4yqbl5LK';
    $AL->Send = array('MerchantID' => '2000933', 'AllPayLogisticsID' => '11810', 'CVSPaymentNo' => '05902347158', 'PlatformID' => '');
    $Result = $AL->PrintFamilyC2CBill('全家列印小白單(全家超商C2C)');
    echo $Result;
} catch (Exception $e) {
    echo $e->getMessage();
}
<?php 
// 更新門市(統一超商C2C)
require '../lib/AllPay.Logistics.Integration.php';
try {
    $AL = new AllpayLogistics();
    $AL->HashKey = 'XBERn1YOvpM9nfZc';
    $AL->HashIV = 'h1ONHk4P4yqbl5LK';
    $AL->Send = array('MerchantID' => '2000933', 'AllPayLogisticsID' => '11796', 'CVSPaymentNo' => 'F0015091', 'CVSValidationNo' => '3207', 'StoreType' => StoreType::RECIVE_STORE, 'ReceiverStoreID' => '991183', 'PlatformID' => '');
    $Result = $AL->UpdateUnimartStore();
    echo '<pre>' . print_r($Result, true) . '</pre>';
} catch (Exception $e) {
    echo $e->getMessage();
}
<?php 
// 全家逆物流核帳(全家超商B2C)
require '../lib/AllPay.Logistics.Integration.php';
try {
    $AL = new AllpayLogistics();
    $AL->HashKey = '5294y06JbISpM5x9';
    $AL->HashIV = 'v77hoKGq4kWxNNIS';
    $AL->Send = array('MerchantID' => '2000132', 'RtnMerchantTradeNo' => '1507031406014', 'PlatformID' => '');
    $Result = $AL->CheckFamilyB2CLogistics();
    echo '<pre>' . print_r($Result, true) . '</pre>';
} catch (Exception $e) {
    echo $e->getMessage();
}
Ejemplo n.º 18
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();
}
Ejemplo n.º 19
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::CVS, 'LogisticsSubType' => LogisticsSubType::UNIMART, 'GoodsAmount' => 1500, 'CollectionAmount' => 10, 'IsCollection' => IsCollection::YES, 'GoodsName' => '測試商品A#測試商品B', 'SenderName' => '歐付寶(寄)', 'SenderPhone' => '0226550115', 'SenderCellPhone' => '0911222333', 'ReceiverName' => '歐付寶(收)', 'ReceiverPhone' => '0226550115', 'ReceiverCellPhone' => '0933222111', 'ReceiverEmail' => '*****@*****.**', 'TradeDesc' => '測試交易敘述', 'ServerReplyURL' => HOME_URL . '/ServerReplyURL.php', 'ClientReplyURL' => HOME_URL . '/ClientReplyURL.php', 'LogisticsC2CReplyURL' => HOME_URL . '/LogisticsC2CReplyURL.php', 'Remark' => '測試備註', 'PlatformID' => '');
    $AL->SendExtend = array('ReceiverStoreID' => '991182', 'ReturnStoreID' => '991182');
    // CreateShippingOrder(Button名稱, Form target)
    $html = $AL->CreateShippingOrder('超商取貨物流訂單建立');
    echo $html;
} catch (Exception $e) {
    echo $e->getMessage();
}
Ejemplo n.º 20
0
<?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();
}
    $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);