Code Duplication    Length = 23-25 lines in 2 locations

src/Bridge/Ecpay/Sdk/ECPay.Logistics.Integration.php 2 locations

@@ 1316-1338 (lines=23) @@
1313
         * @return		string
1314
         * @version		1.0.1012
1315
         */
1316
        public function PrintTradeDoc($ButtonDesc = '產生托運單/一段標', $Target = '_blank')
1317
        {
1318
1319
            // 參數初始化
1320
            $ParamList = [
1321
                'MerchantID' => '',
1322
                'AllPayLogisticsID' => '',
1323
                'PlatformID' => '',
1324
            ];
1325
            $this->PostParams = $this->GetPostParams($this->Send, $ParamList);
1326
1327
            // 參數檢查
1328
            $this->ValidateHashKey();
1329
            $this->ValidateHashIV();
1330
            $this->ValidateID('MerchantID', $this->PostParams['MerchantID'], 10);
1331
            $this->ServiceURL = $this->GetURL('PRINT_TRADE_DOC');
1332
            $this->ValidateID('PlatformID', $this->PostParams['PlatformID'], 10, true);
1333
1334
            // 產生 CheckMacValue
1335
            $this->PostParams['CheckMacValue'] = ECPay_CheckMacValue::generate($this->PostParams, $this->HashKey, $this->HashIV);
1336
1337
            return $this->GenPostHTML($ButtonDesc, $Target);
1338
        }
1339
1340
        /**
1341
         *  列印繳款單(統一超商C2C).
@@ 1463-1487 (lines=25) @@
1460
         * @return		string
1461
         * @version		1.0.1012
1462
         */
1463
        public function CreateTestData($ButtonDesc = '產生 B2C 測標資料', $Target = '_blank')
1464
        {
1465
1466
            // 參數初始化
1467
            $ParamList = [
1468
                'MerchantID' => '',
1469
                'ClientReplyURL' => '',
1470
                'LogisticsSubType' => '',
1471
                'PlatformID' => '',
1472
            ];
1473
            $this->PostParams = $this->GetPostParams($this->Send, $ParamList);
1474
1475
            // 參數檢查
1476
            $this->ValidateHashKey();
1477
            $this->ValidateHashIV();
1478
            $this->ValidateID('MerchantID', $this->PostParams['MerchantID'], 10);
1479
            $this->ServiceURL = $this->GetURL('CREATE_TEST_DATA');
1480
            $this->ValidateLogisticsSubType();
1481
            $this->ValidateID('PlatformID', $this->PostParams['PlatformID'], 10, true);
1482
1483
            // 產生 CheckMacValue
1484
            $this->PostParams['CheckMacValue'] = ECPay_CheckMacValue::generate($this->PostParams, $this->HashKey, $this->HashIV);
1485
1486
            return $this->GenPostHTML($ButtonDesc, $Target);
1487
        }
1488
1489
        /**
1490
         *  Hash Key 檢查.