Code Duplication    Length = 5-6 lines in 2 locations

sdk/ECPay.Payment.Integration.php 2 locations

@@ 922-927 (lines=6) @@
919
        // 載具類別CarrierType(預設為None)
920
        if (! array_key_exists('CarrierType', $arExtend)) {
921
            $arExtend['CarrierType'] = ECPay_CarrierType::None;
922
        } else {
923
            //有設定統一編號的話,載具參數必須是空字串
924
            if (strlen($arExtend['CustomerIdentifier']) > 0 && $arExtend['CarrierType'] != ECPay_CarrierType::None) {
925
                array_push($arErrors, 'CarrierType should be None.');
926
            }
927
        }
928
929
        // 客戶代號CustomerID(預設為空字串)
930
        if (! array_key_exists('CustomerID', $arExtend)) {
@@ 932-936 (lines=5) @@
929
        // 客戶代號CustomerID(預設為空字串)
930
        if (! array_key_exists('CustomerID', $arExtend)) {
931
            $arExtend['CustomerID'] = '';
932
        } else {
933
            if ($arExtend['CarrierType'] == ECPay_CarrierType::Member && strlen($arExtend['CustomerID'] == 0)) {
934
                array_push($arErrors, 'CustomerID is required.');
935
            }
936
        }
937
        // 捐贈註記 Donation(預設為No)
938
        if (! array_key_exists('Donation', $arExtend)) {
939
            $arExtend['Donation'] = ECPay_Donation::No;