Code Duplication    Length = 8-9 lines in 2 locations

sdk/ECPay.Payment.Integration.php 2 locations

@@ 938-945 (lines=8) @@
935
            }
936
        }
937
        // 捐贈註記 Donation(預設為No)
938
        if (! array_key_exists('Donation', $arExtend)) {
939
            $arExtend['Donation'] = ECPay_Donation::No;
940
        } else {
941
            //若有帶統一編號,不可捐贈
942
            if (strlen($arExtend['CustomerIdentifier']) > 0 && $arExtend['Donation'] != ECPay_Donation::No) {
943
                array_push($arErrors, 'Donation should be No.');
944
            }
945
        }
946
947
        // 列印註記Print(預設為No)
948
        if (! array_key_exists('Print', $arExtend)) {
@@ 1066-1074 (lines=9) @@
1063
            $arExtend['LoveCode'] = '';
1064
        }
1065
        // 捐贈註記為捐贈(Yes)時,參數長度固定3~7碼,請設定全數字或第1碼大小寫「X」,後2~6碼全數字
1066
        if ($arExtend['Donation'] == ECPay_Donation::Yes) {
1067
            if (! preg_match('/^([xX]{1}[0-9]{2,6}|[0-9]{3,7})$/', $arExtend['LoveCode'])) {
1068
                array_push($arErrors, 'Invalid LoveCode.');
1069
            }
1070
        } else {
1071
            if (strlen($arExtend['LoveCode']) > 0) {
1072
                array_push($arErrors, 'Please remove LoveCode.');
1073
            }
1074
        }
1075
1076
        //備註 InvoiceRemark(UrlEncode, 預設為空字串)
1077
        if (! array_key_exists('InvoiceRemark', $arExtend)) {