Code Duplication    Length = 7-8 lines in 2 locations

sdk/AllPay.Payment.Integration.php 2 locations

@@ 1235-1241 (lines=7) @@
1232
        }
1233
1234
        // 客戶代號CustomerID(預設為空字串)
1235
        if (! array_key_exists('CustomerID', $arExtend)) {
1236
            $arExtend['CustomerID'] = '';
1237
        } else {
1238
            if ($arExtend['CarruerType'] == CarruerType::Member && strlen($arExtend['CustomerID']) == 0) {
1239
                array_push($arErrors, 'CustomerID is required.');
1240
            }
1241
        }
1242
        // 捐贈註記 Donation(預設為No)
1243
        if (! array_key_exists('Donation', $arExtend)) {
1244
            $arExtend['Donation'] = Donation::No;
@@ 1243-1250 (lines=8) @@
1240
            }
1241
        }
1242
        // 捐贈註記 Donation(預設為No)
1243
        if (! array_key_exists('Donation', $arExtend)) {
1244
            $arExtend['Donation'] = Donation::No;
1245
        } else {
1246
            //若有帶統一編號,不可捐贈
1247
            if (strlen($arExtend['CustomerIdentifier']) > 0 && $arExtend['Donation'] != Donation::No) {
1248
                array_push($arErrors, 'Donation should be No.');
1249
            }
1250
        }
1251
1252
        // 列印註記Print(預設為No)
1253
        if (! array_key_exists('Print', $arExtend)) {