Code Duplication    Length = 5-5 lines in 2 locations

sdk/ECPay.Logistics.Integration.php 2 locations

@@ 458-462 (lines=5) @@
455
            $this->ValidateID('PlatformID', $this->PostParams['PlatformID'], 10, true);
456
457
            // 物流類型(LogisticsType)為宅配(Home)且溫層(Temperature)為冷凍(0003)時,規格(Specification)不可為 150cm(0004)
458
            if ($this->PostParams['LogisticsType'] == LogisticsType::HOME and $this->PostParams['Temperature'] == Temperature::FREEZE) {
459
                if ($this->PostParams['Specification'] == Specification::CM_150) {
460
                    throw new Exception('Specification could not be 150cm(0004) when LogisticsType is Home and Temperature is FREEZE(0003).');
461
                }
462
            }
463
464
            // 產生 CheckMacValue
465
            $this->PostParams['CheckMacValue'] = ECPay_CheckMacValue::generate($this->PostParams, $this->HashKey, $this->HashIV);
@@ 648-652 (lines=5) @@
645
            $this->ValidateID('PlatformID', $this->PostParams['PlatformID'], 10, true);
646
647
            // 物流類型(LogisticsType)為宅配(Home)且溫層(Temperature)為冷凍(0003)時,規格(Specification)不可為 150cm(0004)
648
            if ($this->PostParams['LogisticsType'] == LogisticsType::HOME and $this->PostParams['Temperature'] == Temperature::FREEZE) {
649
                if ($this->PostParams['Specification'] == Specification::CM_150) {
650
                    throw new Exception('Specification could not be 0004 when LogisticsType is Home and Temperature is 0003.');
651
                }
652
            }
653
654
            // 產生 CheckMacValue
655
            $this->PostParams['CheckMacValue'] = ECPay_CheckMacValue::generate($this->PostParams, $this->HashKey, $this->HashIV);