Exemplo n.º 1
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 
// 列印繳款單(統一超商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();
}
}
assert_have($sTest_Result, "allpayForm", $sTest_Subject);
unset($sHome_URL, $oA_L, $sTest_Subject, $sTest_Result);
/**
 * 列印統一繳款單(統一超商 C2C)(PrintUnimartC2CBill)
 */
$sTest_Subject = "allPay 列印統一繳款單(統一超商 C2C)(PrintUnimartC2CBill)";
$sTest_Result = "";
$sHome_URL = "http://www.sample.com.tw";
try {
    $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" => "11808", "CVSPaymentNo" => "F0015102", "CVSValidationNo" => "4130", "PlatformID" => "");
    // PrintUnimartC2CBill(Button 名稱, Form target)
    $sTest_Result = $oA_L->PrintUnimartC2CBill("列印統一繳款單(統一超商 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);
/**
 * 列印全家小白單(全家超商 C2C)(PrintFamilyC2CBill)
 */
$sTest_Subject = "allPay 列印全家小白單(全家超商 C2C)(PrintFamilyC2CBill)";
$sTest_Result = "";
$sHome_URL = "http://www.sample.com.tw";
try {
    $oA_L = new AllpayLogistics();
    $oA_L->HashKey = TestC2CMerchantInfo::HASH_KEY;