mini_defender 0.4.0 → 0.5.0

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: fe54cbe51ddd477ec4d061e9d5f9a6aa0732021800ecbff7aef6f3baeb7325d6
4
- data.tar.gz: a8186c65527cf020fb6f8433740a9c026e032cc440ed12c5823261217287c099
3
+ metadata.gz: ce828ce2c5bbb54c61b4251dbb22c7a2c47c454d8e2c40200e87def85331960b
4
+ data.tar.gz: 5e68bda0f0104af4d084458191a59626e29323b07cb738959784d723e44e670a
5
5
  SHA512:
6
- metadata.gz: a74aa29990ce862b5c08fa03d2f0e90cd418dd90be39865894dc730883486afe49656c37d336992595c60f8db4140ca6e305083ef351ef23024c38d3227f596c
7
- data.tar.gz: 925d4433c41784ff0dce20dbc5ffed0f76766ec481fc9d4856b4099fe5b28e6ef41943b3a56bb9b0ef3d34842df37c828bb69713c6973c730a3d7f46e61a996d
6
+ metadata.gz: 3e77385c0db7fb62dd8b4cce604919fd9d0d0ae5e0fad90edf4d891f63d256cb99a9a07321114688168a2e899c7dc177d9f92e61f6b3eaa063217d2a079d73a7
7
+ data.tar.gz: efc638b587907dd095dc31ad90a87396e778f1eb147f48010664b6a39f11117286f1f2d342cd62900c851eddb081c39ecadbac1faada9ec0cf6541227091820d
data/Gemfile CHANGED
@@ -1,10 +1,8 @@
1
1
  # frozen_string_literal: true
2
2
 
3
- source "https://rubygems.org"
3
+ source 'https://rubygems.org'
4
4
 
5
- # Specify your gem's dependencies in mini_defender.gemspec
6
5
  gemspec
7
6
 
8
- gem "rake", "~> 13.0"
9
-
10
- gem "minitest", "~> 5.0"
7
+ gem 'rake', '~> 13.0'
8
+ gem 'minitest', '~> 5.0'
@@ -4,10 +4,21 @@ class Hash
4
4
  def expand
5
5
  expanded = {}
6
6
 
7
- reject{ |_, v| v.is_a?(Hash) || v.is_a?(Array) }.each do |k, v|
7
+ each do |k, v|
8
8
  keys = k.split('.')
9
9
  node = expanded
10
- node = (node[keys.shift] ||= {}) while keys.length > 1
10
+
11
+ while keys.length > 1
12
+ next_key = keys.shift
13
+ next_node = (node[next_key] ||= {})
14
+
15
+ if next_node.is_a?(Array)
16
+ node[next_key] = next_node = next_node.each_with_index.to_h { |value, index| [index.to_s, value] }
17
+ end
18
+
19
+ node = next_node
20
+ end
21
+
11
22
  node[keys.shift] = v
12
23
  end
13
24
 
@@ -61,6 +61,12 @@ class MiniDefender::Rule
61
61
  value
62
62
  end
63
63
 
64
+ # This method is used to change the value
65
+ # regardless if coercion is required
66
+ def force_coerce?
67
+ false
68
+ end
69
+
64
70
  # @param [Object] attribute
65
71
  # @param [Object] value
66
72
  # @param [MiniDefender::Validator] validator
@@ -5,6 +5,22 @@ class MiniDefender::Rules::Array < MiniDefender::Rule
5
5
  'array'
6
6
  end
7
7
 
8
+ def initialize(data_mode = 'none')
9
+ @data_mode = data_mode
10
+ end
11
+
12
+ def self.make(args)
13
+ new(args[0] || 'none')
14
+ end
15
+
16
+ def coerce(value)
17
+ @data_mode == 'all' ? value : []
18
+ end
19
+
20
+ def force_coerce?
21
+ true
22
+ end
23
+
8
24
  def passes?(attribute, value, validator)
9
25
  value.is_a?(Array)
10
26
  end
@@ -1,6 +1,6 @@
1
1
  # frozen_string_literal: true
2
2
 
3
- require 'countries'
3
+ require 'money'
4
4
 
5
5
  class MiniDefender::Rules::Currency < MiniDefender::Rule
6
6
  CURRENCIES = Money::Currency.map(&:iso_code).map(&:upcase).uniq
@@ -5,11 +5,60 @@ class MiniDefender::Rules::Hash < MiniDefender::Rule
5
5
  'hash'
6
6
  end
7
7
 
8
+ def initialize(data_mode = 'none', key_type = 'any', value_type = 'any')
9
+ @data_mode = data_mode
10
+ @key_type = key_type
11
+ @value_type = value_type
12
+ end
13
+
14
+ def self.make(args)
15
+ new(
16
+ args[0] || 'none',
17
+ args[1] || 'any',
18
+ args[2] || 'any',
19
+ )
20
+ end
21
+
22
+ def coerce(value)
23
+ @data_mode == 'all' ? value : {}
24
+ end
25
+
26
+ def force_coerce?
27
+ true
28
+ end
29
+
8
30
  def passes?(attribute, value, validator)
9
- value.is_a?(Hash)
31
+ passes = value.is_a?(Hash)
32
+
33
+ if @key_type == 'string'
34
+ passes &= value.all? { |k, _| k.is_a?(String) }
35
+ end
36
+
37
+ case @value_type
38
+ when 'string'
39
+ passes &= value.all? { |_, v| v.is_a?(String) }
40
+ when 'integer'
41
+ passes &= value.all? { |_, v| v.is_a?(Integer) }
42
+ when 'float'
43
+ passes &= value.all? { |_, v| v.is_a?(Float) }
44
+ else
45
+ # None
46
+ end
47
+
48
+ passes
10
49
  end
11
50
 
12
51
  def message(attribute, value, validator)
13
- "The field must be an object."
52
+ additional = ''
53
+
54
+ if @key_type != 'any'
55
+ additional += ", key must be #{@key_type}"
56
+ end
57
+
58
+ if @value_type != 'any'
59
+ additional += ", value must be #{@value_type}"
60
+ end
61
+
62
+ "The field must be an object#{additional}."
14
63
  end
15
64
  end
@@ -0,0 +1,1003 @@
1
+ # frozen_string_literal: true
2
+
3
+ class MiniDefender::Rules::MerchantCategoryCode < MiniDefender::Rule
4
+ MERCHANT_CATEGORIES = {
5
+ '0742' => 'Veterinary Services',
6
+ '0763' => 'Agricultural Co-operatives',
7
+ '0780' => 'Horticultural Services, Landscaping Services',
8
+ '1520' => 'General Contractors-Residential and Commercial',
9
+ '1711' => 'Air Conditioning Contractors – Sales and Installation, Heating Contractors – Sales, Service, Installation',
10
+ '1731' => 'Electrical Contractors',
11
+ '1740' => 'Insulation – Contractors, Masonry, Stonework Contractors, Plastering Contractors, Stonework and Masonry Contractors, Tile Settings Contractors',
12
+ '1750' => 'Carpentry Contractors',
13
+ '1761' => 'Roofing – Contractors, Sheet Metal Work – Contractors, Siding – Contractors',
14
+ '1771' => 'Contractors – Concrete Work',
15
+ '1799' => 'Contractors – Special Trade, Not Elsewhere Classified',
16
+ '2741' => 'Miscellaneous Publishing and Printing',
17
+ '2791' => 'Typesetting, Plate Making, & Related Services',
18
+ '2842' => 'Specialty Cleaning, Polishing, and Sanitation Preparations',
19
+ '3000' => 'UNITED AIRLINES',
20
+ '3001' => 'AMERICAN AIRLINES',
21
+ '3002' => 'PAN AMERICAN',
22
+ '3003' => 'Airlines',
23
+ '3004' => 'TRANS WORLD AIRLINES',
24
+ '3005' => 'BRITISH AIRWAYS',
25
+ '3006' => 'JAPAN AIRLINES',
26
+ '3007' => 'AIR FRANCE',
27
+ '3008' => 'LUFTHANSA',
28
+ '3009' => 'AIR CANADA',
29
+ '3010' => 'KLM (ROYAL DUTCH AIRLINES)',
30
+ '3011' => 'AEORFLOT',
31
+ '3012' => 'QANTAS',
32
+ '3013' => 'ALITALIA',
33
+ '3014' => 'SAUDIA ARABIAN AIRLINES',
34
+ '3015' => 'SWISSAIR',
35
+ '3016' => 'SAS',
36
+ '3017' => 'SOUTH AFRICAN AIRWAYS',
37
+ '3018' => 'VARIG (BRAZIL)',
38
+ '3019' => 'Airlines',
39
+ '3020' => 'AIR-INDIA',
40
+ '3021' => 'AIR ALGERIE',
41
+ '3022' => 'PHILIPPINE AIRLINES',
42
+ '3023' => 'MEXICANA',
43
+ '3024' => 'PAKISTAN INTERNATIONAL',
44
+ '3025' => 'AIR NEW ZEALAND',
45
+ '3026' => 'Airlines',
46
+ '3027' => 'UTA/INTERAIR',
47
+ '3028' => 'AIR MALTA',
48
+ '3029' => 'SABENA',
49
+ '3030' => 'AEROLINEAS ARGENTINAS',
50
+ '3031' => 'OLYMPIC AIRWAYS',
51
+ '3032' => 'EL AL',
52
+ '3033' => 'ANSETT AIRLINES',
53
+ '3034' => 'AUSTRAINLIAN AIRLINES',
54
+ '3035' => 'TAP (PORTUGAL)',
55
+ '3036' => 'VASP (BRAZIL)',
56
+ '3037' => 'EGYPTAIR',
57
+ '3038' => 'KUWAIT AIRLINES',
58
+ '3039' => 'AVIANCA',
59
+ '3040' => 'GULF AIR (BAHRAIN)',
60
+ '3041' => 'BALKAN-BULGARIAN AIRLINES',
61
+ '3042' => 'FINNAIR',
62
+ '3043' => 'AER LINGUS',
63
+ '3044' => 'AIR LANKA',
64
+ '3045' => 'NIGERIA AIRWAYS',
65
+ '3046' => 'CRUZEIRO DO SUL (BRAZIJ)',
66
+ '3047' => 'THY (TURKEY)',
67
+ '3048' => 'ROYAL AIR MAROC',
68
+ '3049' => 'TUNIS AIR',
69
+ '3050' => 'ICELANDAIR',
70
+ '3051' => 'AUSTRIAN AIRLINES',
71
+ '3052' => 'LANCHILE',
72
+ '3053' => 'AVIACO (SPAIN)',
73
+ '3054' => 'LADECO (CHILE)',
74
+ '3055' => 'LAB (BOLIVIA)',
75
+ '3056' => 'QUEBECAIRE',
76
+ '3057' => 'EASTWEST AIRLINES (AUSTRALIA)',
77
+ '3058' => 'DELTA',
78
+ '3059' => 'Airlines',
79
+ '3060' => 'NORTHWEST',
80
+ '3061' => 'CONTINENTAL',
81
+ '3062' => 'WESTERN',
82
+ '3063' => 'US AIR',
83
+ '3064' => 'Airlines',
84
+ '3065' => 'AIRINTER',
85
+ '3066' => 'SOUTHWEST',
86
+ '3067' => 'Airlines',
87
+ '3068' => 'Airlines',
88
+ '3069' => 'SUN COUNTRY AIRLINES',
89
+ '3070' => 'Airlines',
90
+ '3071' => 'AIR BRITISH COLUBIA',
91
+ '3072' => 'Airlines',
92
+ '3073' => 'Airlines',
93
+ '3074' => 'Airlines',
94
+ '3075' => 'SINGAPORE AIRLINES',
95
+ '3076' => 'AEROMEXICO',
96
+ '3077' => 'THAI AIRWAYS',
97
+ '3078' => 'CHINA AIRLINES',
98
+ '3079' => 'Airlines',
99
+ '3080' => 'Airlines',
100
+ '3081' => 'NORDAIR',
101
+ '3082' => 'KOREAN AIRLINES',
102
+ '3083' => 'AIR AFRIGUE',
103
+ '3084' => 'EVA AIRLINES',
104
+ '3085' => 'MIDWEST EXPRESS AIRLINES, INC.',
105
+ '3086' => 'Airlines',
106
+ '3087' => 'METRO AIRLINES',
107
+ '3088' => 'CROATIA AIRLINES',
108
+ '3089' => 'TRANSAERO',
109
+ '3090' => 'Airlines',
110
+ '3091' => 'Airlines',
111
+ '3092' => 'Airlines',
112
+ '3093' => 'Airlines',
113
+ '3094' => 'ZAMBIA AIRWAYS',
114
+ '3095' => 'Airlines',
115
+ '3096' => 'AIR ZIMBABWE',
116
+ '3097' => 'Airlines',
117
+ '3098' => 'Airlines',
118
+ '3099' => 'CATHAY PACIFIC',
119
+ '3100' => 'MALAYSIAN AIRLINE SYSTEM',
120
+ '3101' => 'Airlines',
121
+ '3102' => 'IBERIA',
122
+ '3103' => 'GARUDA (INDONESIA)',
123
+ '3104' => 'Airlines',
124
+ '3105' => 'Airlines',
125
+ '3106' => 'BRAATHENS S.A.F.E. (NORWAY)',
126
+ '3107' => 'Airlines',
127
+ '3108' => 'Airlines',
128
+ '3109' => 'Airlines',
129
+ '3110' => 'WINGS AIRWAYS',
130
+ '3111' => 'BRITISH MIDLAND',
131
+ '3112' => 'WINDWARD ISLAND',
132
+ '3113' => 'Airlines',
133
+ '3114' => 'Airlines',
134
+ '3115' => 'Airlines',
135
+ '3116' => 'Airlines',
136
+ '3117' => 'VIASA',
137
+ '3118' => 'VALLEY AIRLINES',
138
+ '3119' => 'Airlines',
139
+ '3120' => 'Airlines',
140
+ '3121' => 'Airlines',
141
+ '3122' => 'Airlines',
142
+ '3123' => 'Airlines',
143
+ '3124' => 'Airlines',
144
+ '3125' => 'TAN',
145
+ '3126' => 'TALAIR',
146
+ '3127' => 'TACA INTERNATIONAL',
147
+ '3128' => 'Airlines',
148
+ '3129' => 'SURINAM AIRWAYS',
149
+ '3130' => 'SUN WORLD INTERNATIONAL',
150
+ '3131' => 'Airlines',
151
+ '3132' => 'Airlines',
152
+ '3133' => 'SUNBELT AIRLINES',
153
+ '3134' => 'Airlines',
154
+ '3135' => 'SUDAN AIRWAYS',
155
+ '3136' => 'Airlines',
156
+ '3137' => 'SINGLETON',
157
+ '3138' => 'SIMMONS AIRLINES',
158
+ '3139' => 'Airlines',
159
+ '3140' => 'Airlines',
160
+ '3141' => 'Airlines',
161
+ '3142' => 'Airlines',
162
+ '3143' => 'SCENIC AIRLINES',
163
+ '3144' => 'VIRGIN ATLANTIC',
164
+ '3145' => 'SAN JUAN AIRLINES',
165
+ '3146' => 'LUXAIR',
166
+ '3147' => 'Airlines',
167
+ '3148' => 'Airlines',
168
+ '3149' => 'Airlines',
169
+ '3150' => 'Airlines',
170
+ '3151' => 'AIR ZAIRE',
171
+ '3152' => 'Airlines',
172
+ '3153' => 'Airlines',
173
+ '3154' => 'PRINCEVILLE',
174
+ '3155' => 'Airlines',
175
+ '3156' => 'Airlines',
176
+ '3157' => 'Airlines',
177
+ '3158' => 'Airlines',
178
+ '3159' => 'PBA',
179
+ '3160' => 'Airlines',
180
+ '3161' => 'ALL NIPPON AIRWAYS',
181
+ '3162' => 'Airlines',
182
+ '3163' => 'Airlines',
183
+ '3164' => 'NORONTAIR',
184
+ '3165' => 'NEW YORK HELICOPTER',
185
+ '3166' => 'Airlines',
186
+ '3167' => 'Airlines',
187
+ '3168' => 'Airlines',
188
+ '3169' => 'Airlines',
189
+ '3170' => 'NOUNT COOK',
190
+ '3171' => 'CANADIAN AIRLINES INTERNATIONAL',
191
+ '3172' => 'NATIONAIR',
192
+ '3173' => 'Airlines',
193
+ '3174' => 'Airlines',
194
+ '3175' => 'Airlines',
195
+ '3176' => 'METROFLIGHT AIRLINES',
196
+ '3177' => 'Airlines',
197
+ '3178' => 'MESA AIR',
198
+ '3179' => 'Airlines',
199
+ '3180' => 'Airlines',
200
+ '3181' => 'MALEV',
201
+ '3182' => 'LOT (POLAND)',
202
+ '3183' => 'Airlines',
203
+ '3184' => 'LIAT',
204
+ '3185' => 'LAV (VENEZUELA)',
205
+ '3186' => 'LAP (PARAGUAY)',
206
+ '3187' => 'LACSA (COSTA RICA)',
207
+ '3188' => 'Airlines',
208
+ '3189' => 'Airlines',
209
+ '3190' => 'JUGOSLAV AIR',
210
+ '3191' => 'ISLAND AIRLINES',
211
+ '3192' => 'IRAN AIR',
212
+ '3193' => 'INDIAN AIRLINES',
213
+ '3194' => 'Airlines',
214
+ '3195' => 'Airlines',
215
+ '3196' => 'HAWAIIAN AIR',
216
+ '3197' => 'HAVASU AIRLINES',
217
+ '3198' => 'Airlines',
218
+ '3199' => 'Airlines',
219
+ '3200' => 'FUYANA AIRWAYS',
220
+ '3201' => 'Airlines',
221
+ '3202' => 'Airlines',
222
+ '3203' => 'GOLDEN PACIFIC AIR',
223
+ '3204' => 'FREEDOM AIR',
224
+ '3205' => 'Airlines',
225
+ '3206' => 'Airlines',
226
+ '3207' => 'Airlines',
227
+ '3208' => 'Airlines',
228
+ '3209' => 'Airlines',
229
+ '3210' => 'Airlines',
230
+ '3211' => 'Airlines',
231
+ '3212' => 'DOMINICANA',
232
+ '3213' => 'Airlines',
233
+ '3214' => 'Airlines',
234
+ '3215' => 'DAN AIR SERVICES',
235
+ '3216' => 'CUMBERLAND AIRLINES',
236
+ '3217' => 'CSA',
237
+ '3218' => 'CROWN AIR',
238
+ '3219' => 'COPA',
239
+ '3220' => 'COMPANIA FAUCETT',
240
+ '3221' => 'TRANSPORTES AEROS MILITARES ECCUATORANOS',
241
+ '3222' => 'COMMAND AIRWAYS',
242
+ '3223' => 'COMAIR',
243
+ '3224' => 'Airlines',
244
+ '3225' => 'Airlines',
245
+ '3226' => 'Airlines',
246
+ '3227' => 'Airlines',
247
+ '3228' => 'CAYMAN AIRWAYS',
248
+ '3229' => 'SAETA SOCIAEDAD ECUATORIANOS DE TRANSPORTES AEREOS',
249
+ '3230' => 'Airlines',
250
+ '3231' => 'SASHA SERVICIO AERO DE HONDURAS',
251
+ '3232' => 'Airlines',
252
+ '3233' => 'CAPITOL AIR',
253
+ '3234' => 'BWIA',
254
+ '3235' => 'BROKWAY AIR',
255
+ '3236' => 'Airlines',
256
+ '3237' => 'Airlines',
257
+ '3238' => 'BEMIDJI AIRLINES',
258
+ '3239' => 'BAR HARBOR AIRLINES',
259
+ '3240' => 'BAHAMASAIR',
260
+ '3241' => 'AVIATECA (GUATEMALA)',
261
+ '3242' => 'AVENSA',
262
+ '3243' => 'AUSTRIAN AIR SERVICE',
263
+ '3244' => 'Airlines',
264
+ '3245' => 'Airlines',
265
+ '3246' => 'Airlines',
266
+ '3247' => 'Airlines',
267
+ '3248' => 'Airlines',
268
+ '3249' => 'Airlines',
269
+ '3250' => 'Airlines',
270
+ '3251' => 'ALOHA AIRLINES',
271
+ '3252' => 'ALM',
272
+ '3253' => 'AMERICA WEST',
273
+ '3254' => 'TRUMP AIRLINE',
274
+ '3255' => 'Airlines',
275
+ '3256' => 'ALASKA AIRLINES',
276
+ '3257' => 'Airlines',
277
+ '3258' => 'Airlines',
278
+ '3259' => 'AMERICAN TRANS AIR',
279
+ '3260' => 'Airlines',
280
+ '3261' => 'AIR CHINA',
281
+ '3262' => 'RENO AIR, INC.',
282
+ '3263' => 'Airlines',
283
+ '3264' => 'Airlines',
284
+ '3265' => 'Airlines',
285
+ '3266' => 'AIR SEYCHELLES',
286
+ '3267' => 'AIR PANAMA',
287
+ '3268' => 'Airlines',
288
+ '3269' => 'Airlines',
289
+ '3270' => 'Airlines',
290
+ '3271' => 'Airlines',
291
+ '3272' => 'Airlines',
292
+ '3273' => 'Airlines',
293
+ '3274' => 'Airlines',
294
+ '3275' => 'Airlines',
295
+ '3276' => 'Airlines',
296
+ '3277' => 'Airlines',
297
+ '3278' => 'Airlines',
298
+ '3279' => 'Airlines',
299
+ '3280' => 'AIR JAMAICA',
300
+ '3281' => 'Airlines',
301
+ '3282' => 'AIR DJIBOUTI',
302
+ '3283' => 'Airlines',
303
+ '3284' => 'AERO VIRGIN ISLANDS',
304
+ '3285' => 'AERO PERU',
305
+ '3286' => 'AEROLINEAS NICARAGUENSIS',
306
+ '3287' => 'AERO COACH AVAIATION',
307
+ '3288' => 'Airlines',
308
+ '3289' => 'Airlines',
309
+ '3290' => 'Airlines',
310
+ '3291' => 'ARIANA AFGHAN',
311
+ '3292' => 'CYPRUS AIRWAYS',
312
+ '3293' => 'ECUATORIANA',
313
+ '3294' => 'ETHIOPIAN AIRLINES',
314
+ '3295' => 'KENYA AIRLINES',
315
+ '3296' => 'Airlines',
316
+ '3297' => 'Airlines',
317
+ '3298' => 'AIR MAURITIUS',
318
+ '3299' => 'WIDERO’S FLYVESELSKAP',
319
+ '3351' => 'AFFILIATED AUTO RENTAL',
320
+ '3352' => 'AMERICAN INTL RENT-A-CAR',
321
+ '3353' => 'BROOKS RENT-A-CAR',
322
+ '3354' => 'ACTION AUTO RENTAL',
323
+ '3355' => 'Car Rental',
324
+ '3356' => 'Car Rental',
325
+ '3357' => 'HERTZ RENT-A-CAR',
326
+ '3358' => 'Car Rental',
327
+ '3359' => 'PAYLESS CAR RENTAL',
328
+ '3360' => 'SNAPPY CAR RENTAL',
329
+ '3361' => 'AIRWAYS RENT-A-CAR',
330
+ '3362' => 'ALTRA AUTO RENTAL',
331
+ '3363' => 'Car Rental',
332
+ '3364' => 'AGENCY RENT-A-CAR',
333
+ '3365' => 'Car Rental',
334
+ '3366' => 'BUDGET RENT-A-CAR',
335
+ '3367' => 'Car Rental',
336
+ '3368' => 'HOLIDAY RENT-A-WRECK',
337
+ '3369' => 'Car Rental',
338
+ '3370' => 'RENT-A-WRECK',
339
+ '3371' => 'Car Rental',
340
+ '3372' => 'Car Rental',
341
+ '3373' => 'Car Rental',
342
+ '3374' => 'Car Rental',
343
+ '3375' => 'Car Rental',
344
+ '3376' => 'AJAX RENT-A-CAR',
345
+ '3377' => 'Car Rental',
346
+ '3378' => 'Car Rental',
347
+ '3379' => 'Car Rental',
348
+ '3380' => 'Car Rental',
349
+ '3381' => 'EUROP CAR',
350
+ '3382' => 'Car Rental',
351
+ '3383' => 'Car Rental',
352
+ '3384' => 'Car Rental',
353
+ '3385' => 'TROPICAL RENT-A-CAR',
354
+ '3386' => 'SHOWCASE RENTAL CARS',
355
+ '3387' => 'ALAMO RENT-A-CAR',
356
+ '3388' => 'Car Rental',
357
+ '3389' => 'AVIS RENT-A-CAR',
358
+ '3390' => 'DOLLAR RENT-A-CAR',
359
+ '3391' => 'EUROPE BY CAR',
360
+ '3392' => 'Car Rental',
361
+ '3393' => 'NATIONAL CAR RENTAL',
362
+ '3394' => 'KEMWELL GROUP RENT-A-CAR',
363
+ '3395' => 'THRIFTY RENT-A-CAR',
364
+ '3396' => 'TILDEN TENT-A-CAR',
365
+ '3397' => 'Car Rental',
366
+ '3398' => 'ECONO-CAR RENT-A-CAR',
367
+ '3399' => 'Car Rental',
368
+ '3400' => 'AUTO HOST COST CAR RENTALS',
369
+ '3401' => 'Car Rental',
370
+ '3402' => 'Car Rental',
371
+ '3403' => 'Car Rental',
372
+ '3404' => 'Car Rental',
373
+ '3405' => 'ENTERPRISE RENT-A-CAR',
374
+ '3406' => 'Car Rental',
375
+ '3407' => 'Car Rental',
376
+ '3408' => 'Car Rental',
377
+ '3409' => 'GENERAL RENT-A-CAR',
378
+ '3410' => 'Car Rental',
379
+ '3411' => 'Car Rental',
380
+ '3412' => 'A-1 RENT-A-CAR',
381
+ '3413' => 'Car Rental',
382
+ '3414' => 'GODFREY NATL RENT-A-CAR',
383
+ '3415' => 'Car Rental',
384
+ '3416' => 'Car Rental',
385
+ '3417' => 'Car Rental',
386
+ '3418' => 'Car Rental',
387
+ '3419' => 'ALPHA RENT-A-CAR',
388
+ '3420' => 'ANSA INTL RENT-A-CAR',
389
+ '3421' => 'ALLSTAE RENT-A-CAR',
390
+ '3422' => 'Car Rental',
391
+ '3423' => 'AVCAR RENT-A-CAR',
392
+ '3424' => 'Car Rental',
393
+ '3425' => 'AUTOMATE RENT-A-CAR',
394
+ '3426' => 'Car Rental',
395
+ '3427' => 'AVON RENT-A-CAR',
396
+ '3428' => 'CAREY RENT-A-CAR',
397
+ '3429' => 'INSURANCE RENT-A-CAR',
398
+ '3430' => 'MAJOR RENT-A-CAR',
399
+ '3431' => 'REPLACEMENT RENT-A-CAR',
400
+ '3432' => 'RESERVE RENT-A-CAR',
401
+ '3433' => 'UGLY DUCKLING RENT-A-CAR',
402
+ '3434' => 'USA RENT-A-CAR',
403
+ '3435' => 'VALUE RENT-A-CAR',
404
+ '3436' => 'AUTOHANSA RENT-A-CAR',
405
+ '3437' => 'CITE RENT-A-CAR',
406
+ '3438' => 'INTERENT RENT-A-CAR',
407
+ '3439' => 'MILLEVILLE RENT-A-CAR',
408
+ '3440' => 'VIA ROUTE RENT-A-CAR',
409
+ '3441' => 'Car Rental',
410
+ '3501' => 'HOLIDAY INNS, HOLIDAY INN EXPRESS',
411
+ '3502' => 'BEST WESTERN HOTELS',
412
+ '3503' => 'SHERATON HOTELS',
413
+ '3504' => 'HILTON HOTELS',
414
+ '3505' => 'FORTE HOTELS',
415
+ '3506' => 'GOLDEN TULIP HOTELS',
416
+ '3507' => 'FRIENDSHIP INNS',
417
+ '3508' => 'QUALITY INNS, QUALITY SUITES',
418
+ '3509' => 'MARRIOTT HOTELS',
419
+ '3510' => 'DAYS INN, DAYSTOP',
420
+ '3511' => 'ARABELLA HOTELS',
421
+ '3512' => 'INTER-CONTINENTAL HOTELS',
422
+ '3513' => 'WESTIN HOTELS',
423
+ '3514' => 'Hotels/Motels/Inns/Resorts',
424
+ '3515' => 'RODEWAY INNS',
425
+ '3516' => 'LA QUINTA MOTOR INNS',
426
+ '3517' => 'AMERICANA HOTELS',
427
+ '3518' => 'SOL HOTELS',
428
+ '3519' => 'PULLMAN INTERNATIONAL HOTELS',
429
+ '3520' => 'MERIDIEN HOTELS',
430
+ '3521' => 'CREST HOTELS (see FORTE HOTELS)',
431
+ '3522' => 'TOKYO HOTEL',
432
+ '3523' => 'PENNSULA HOTEL',
433
+ '3524' => 'WELCOMGROUP HOTELS',
434
+ '3525' => 'DUNFEY HOTELS',
435
+ '3526' => 'Hotels/Motels/Inns/Resorts',
436
+ '3527' => 'DOWNTOWNER-PASSPORT HOTEL',
437
+ '3528' => 'RED LION HOTELS, RED LION INNS',
438
+ '3529' => 'CP HOTELS',
439
+ '3530' => 'RENAISSANCE HOTELS, STOUFFER HOTELS',
440
+ '3531' => 'ASTIR HOTELS',
441
+ '3532' => 'SUN ROUTE HOTELS',
442
+ '3533' => 'HOTEL IBIS',
443
+ '3534' => 'SOUTHERN PACIFIC HOTELS',
444
+ '3535' => 'HILTON INTERNATIONAL',
445
+ '3536' => 'AMFAC HOTELS',
446
+ '3537' => 'ANA HOTEL',
447
+ '3538' => 'CONCORDE HOTELS',
448
+ '3539' => 'Hotels/Motels/Inns/Resorts',
449
+ '3540' => 'IBEROTEL HOTELS',
450
+ '3541' => 'HOTEL OKURA',
451
+ '3542' => 'ROYAL HOTELS',
452
+ '3543' => 'FOUR SEASONS HOTELS',
453
+ '3544' => 'CIGA HOTELS',
454
+ '3545' => 'SHANGRI-LA INTERNATIONAL',
455
+ '3546' => 'Hotels/Motels/Inns/Resorts',
456
+ '3547' => 'Hotels/Motels/Inns/Resorts',
457
+ '3548' => 'HOTELES MELIA',
458
+ '3549' => 'AUBERGE DES GOVERNEURS',
459
+ '3550' => 'REGAL 8 INNS',
460
+ '3551' => 'Hotels/Motels/Inns/Resorts',
461
+ '3552' => 'COAST HOTELS',
462
+ '3553' => 'PARK INNS INTERNATIONAL',
463
+ '3554' => 'Hotels/Motels/Inns/Resorts',
464
+ '3555' => 'Hotels/Motels/Inns/Resorts',
465
+ '3556' => 'Hotels/Motels/Inns/Resorts',
466
+ '3557' => 'Hotels/Motels/Inns/Resorts',
467
+ '3558' => 'JOLLY HOTELS',
468
+ '3559' => 'Hotels/Motels/Inns/Resorts',
469
+ '3560' => 'Hotels/Motels/Inns/Resorts',
470
+ '3561' => 'Hotels/Motels/Inns/Resorts',
471
+ '3562' => 'COMFORT INNS',
472
+ '3563' => 'JOURNEY’S END MOTLS',
473
+ '3564' => 'Hotels/Motels/Inns/Resorts',
474
+ '3565' => 'RELAX INNS',
475
+ '3566' => 'Hotels/Motels/Inns/Resorts',
476
+ '3567' => 'Hotels/Motels/Inns/Resorts',
477
+ '3568' => 'LADBROKE HOTELS',
478
+ '3569' => 'Hotels/Motels/Inns/Resorts',
479
+ '3570' => 'FORUM HOTELS',
480
+ '3571' => 'Hotels/Motels/Inns/Resorts',
481
+ '3572' => 'MIYAKO HOTELS',
482
+ '3573' => 'SANDMAN HOTELS',
483
+ '3574' => 'VENTURE INNS',
484
+ '3575' => 'VAGABOND HOTELS',
485
+ '3576' => 'Hotels/Motels/Inns/Resorts',
486
+ '3577' => 'MANDARIN ORIENTAL HOTEL',
487
+ '3578' => 'Hotels/Motels/Inns/Resorts',
488
+ '3579' => 'HOTEL MERCURE',
489
+ '3580' => 'Hotels/Motels/Inns/Resorts',
490
+ '3581' => 'DELTA HOTEL',
491
+ '3582' => 'Hotels/Motels/Inns/Resorts',
492
+ '3583' => 'SAS HOTELS',
493
+ '3584' => 'PRINCESS HOTELS INTERNATIONAL',
494
+ '3585' => 'HUNGAR HOTELS',
495
+ '3586' => 'SOKOS HOTELS',
496
+ '3587' => 'DORAL HOTELS',
497
+ '3588' => 'HELMSLEY HOTELS',
498
+ '3589' => 'Hotels/Motels/Inns/Resorts',
499
+ '3590' => 'FAIRMONT HOTELS',
500
+ '3591' => 'SONESTA HOTELS',
501
+ '3592' => 'OMNI HOTELS',
502
+ '3593' => 'CUNARD HOTELS',
503
+ '3594' => 'Hotels/Motels/Inns/Resorts',
504
+ '3595' => 'HOSPITALITY INTERNATIONAL',
505
+ '3596' => 'Hotels/Motels/Inns/Resorts',
506
+ '3597' => 'Hotels/Motels/Inns/Resorts',
507
+ '3598' => 'REGENT INTERNATIONAL HOTELS',
508
+ '3599' => 'PANNONIA HOTELS',
509
+ '3600' => 'Hotels/Motels/Inns/Resorts',
510
+ '3601' => 'Hotels/Motels/Inns/Resorts',
511
+ '3602' => 'Hotels/Motels/Inns/Resorts',
512
+ '3603' => 'NOAH’S HOTELS',
513
+ '3604' => 'Hotels/Motels/Inns/Resorts',
514
+ '3605' => 'Hotels/Motels/Inns/Resorts',
515
+ '3606' => 'Hotels/Motels/Inns/Resorts',
516
+ '3607' => 'Hotels/Motels/Inns/Resorts',
517
+ '3608' => 'Hotels/Motels/Inns/Resorts',
518
+ '3609' => 'Hotels/Motels/Inns/Resorts',
519
+ '3610' => 'Hotels/Motels/Inns/Resorts',
520
+ '3611' => 'Hotels/Motels/Inns/Resorts',
521
+ '3612' => 'MOVENPICK HOTELS',
522
+ '3613' => 'Hotels/Motels/Inns/Resorts',
523
+ '3614' => 'Hotels/Motels/Inns/Resorts',
524
+ '3615' => 'TRAVELODGE',
525
+ '3616' => 'Hotels/Motels/Inns/Resorts',
526
+ '3617' => 'Hotels/Motels/Inns/Resorts',
527
+ '3618' => 'Hotels/Motels/Inns/Resorts',
528
+ '3619' => 'Hotels/Motels/Inns/Resorts',
529
+ '3620' => 'TELFORD INTERNATIONAL',
530
+ '3621' => 'Hotels/Motels/Inns/Resorts',
531
+ '3622' => 'MERLIN HOTELS',
532
+ '3623' => 'DORINT HOTELS',
533
+ '3624' => 'Hotels/Motels/Inns/Resorts',
534
+ '3625' => 'HOTLE UNIVERSALE',
535
+ '3626' => 'PRINCE HOTELS',
536
+ '3627' => 'Hotels/Motels/Inns/Resorts',
537
+ '3628' => 'Hotels/Motels/Inns/Resorts',
538
+ '3629' => 'DAN HOTELS',
539
+ '3630' => 'Hotels/Motels/Inns/Resorts',
540
+ '3631' => 'Hotels/Motels/Inns/Resorts',
541
+ '3632' => 'Hotels/Motels/Inns/Resorts',
542
+ '3633' => 'RANK HOTELS',
543
+ '3634' => 'SWISSOTEL',
544
+ '3635' => 'RESO HOTELS',
545
+ '3636' => 'SAROVA HOTELS',
546
+ '3637' => 'RAMADA INNS, RAMADA LIMITED',
547
+ '3638' => 'HO JO INN, HOWARD JOHNSON',
548
+ '3639' => 'MOUNT CHARLOTTE THISTLE',
549
+ '3640' => 'HYATT HOTEL',
550
+ '3641' => 'SOFITEL HOTELS',
551
+ '3642' => 'NOVOTEL HOTELS',
552
+ '3643' => 'STEIGENBERGER HOTELS',
553
+ '3644' => 'ECONO LODGES',
554
+ '3645' => 'QUEENS MOAT HOUSES',
555
+ '3646' => 'SWALLOW HOTELS',
556
+ '3647' => 'HUSA HOTELS',
557
+ '3648' => 'DE VERE HOTELS',
558
+ '3649' => 'RADISSON HOTELS',
559
+ '3650' => 'RED ROOK INNS',
560
+ '3651' => 'IMPERIAL LONDON HOTEL',
561
+ '3652' => 'EMBASSY HOTELS',
562
+ '3653' => 'PENTA HOTELS',
563
+ '3654' => 'LOEWS HOTELS',
564
+ '3655' => 'SCANDIC HOTELS',
565
+ '3656' => 'SARA HOTELS',
566
+ '3657' => 'OBEROI HOTELS',
567
+ '3658' => 'OTANI HOTELS',
568
+ '3659' => 'TAJ HOTELS INTERNATIONAL',
569
+ '3660' => 'KNIGHTS INNS',
570
+ '3661' => 'METROPOLE HOTELS',
571
+ '3662' => 'Hotels/Motels/Inns/Resorts',
572
+ '3663' => 'HOTELES EL PRESIDENTS',
573
+ '3664' => 'FLAG INN',
574
+ '3665' => 'HAMPTON INNS',
575
+ '3666' => 'STAKIS HOTELS',
576
+ '3667' => 'Hotels/Motels/Inns/Resorts',
577
+ '3668' => 'MARITIM HOTELS',
578
+ '3669' => 'Hotels/Motels/Inns/Resorts',
579
+ '3670' => 'ARCARD HOTELS',
580
+ '3671' => 'ARCTIA HOTELS',
581
+ '3672' => 'CAMPANIEL HOTELS',
582
+ '3673' => 'IBUSZ HOTELS',
583
+ '3674' => 'RANTASIPI HOTELS',
584
+ '3675' => 'INTERHOTEL CEDOK',
585
+ '3676' => 'Hotels/Motels/Inns/Resorts',
586
+ '3677' => 'CLIMAT DE FRANCE HOTELS',
587
+ '3678' => 'CUMULUS HOTELS',
588
+ '3679' => 'DANUBIUS HOTEL',
589
+ '3680' => 'Hotels/Motels/Inns/Resorts',
590
+ '3681' => 'ADAMS MARK HOTELS',
591
+ '3682' => 'ALLSTAR INNS',
592
+ '3683' => 'Hotels/Motels/Inns/Resorts',
593
+ '3684' => 'BUDGET HOST INNS',
594
+ '3685' => 'BUDGETEL HOTELS',
595
+ '3686' => 'SUISSE CHALETS',
596
+ '3687' => 'CLARION HOTELS',
597
+ '3688' => 'COMPRI HOTELS',
598
+ '3689' => 'CONSORT HOTELS',
599
+ '3690' => 'COURTYARD BY MARRIOTT',
600
+ '3691' => 'DILLION INNS',
601
+ '3692' => 'DOUBLETREE HOTELS',
602
+ '3693' => 'DRURY INNS',
603
+ '3694' => 'ECONOMY INNS OF AMERICA',
604
+ '3695' => 'EMBASSY SUITES',
605
+ '3696' => 'EXEL INNS',
606
+ '3697' => 'FARFIELD HOTELS',
607
+ '3698' => 'HARLEY HOTELS',
608
+ '3699' => 'MIDWAY MOTOR LODGE',
609
+ '3700' => 'MOTEL 6',
610
+ '3701' => 'GUEST QUARTERS (Formally PICKETT SUITE HOTELS)',
611
+ '3702' => 'THE REGISTRY HOTELS',
612
+ '3703' => 'RESIDENCE INNS',
613
+ '3704' => 'ROYCE HOTELS',
614
+ '3705' => 'SANDMAN INNS',
615
+ '3706' => 'SHILO INNS',
616
+ '3707' => 'SHONEY’S INNS',
617
+ '3708' => 'Hotels/Motels/Inns/Resorts',
618
+ '3709' => 'SUPER8 MOTELS',
619
+ '3710' => 'THE RITZ CARLTON HOTELS',
620
+ '3711' => 'FLAG INNS (AUSRALIA)',
621
+ '3712' => 'GOLDEN CHAIN HOTEL',
622
+ '3713' => 'QUALITY PACIFIC HOTEL',
623
+ '3714' => 'FOUR SEASONS HOTEL (AUSTRALIA)',
624
+ '3715' => 'FARIFIELD INN',
625
+ '3716' => 'CARLTON HOTELS',
626
+ '3717' => 'CITY LODGE HOTELS',
627
+ '3718' => 'KAROS HOTELS',
628
+ '3719' => 'PROTEA HOTELS',
629
+ '3720' => 'SOUTHERN SUN HOTELS',
630
+ '3721' => 'HILTON CONRAD',
631
+ '3722' => 'WYNDHAM HOTEL AND RESORTS',
632
+ '3723' => 'RICA HOTELS',
633
+ '3724' => 'INER NOR HOTELS',
634
+ '3725' => 'SEAINES PLANATION',
635
+ '3726' => 'RIO SUITES',
636
+ '3727' => 'BROADMOOR HOTEL',
637
+ '3728' => 'BALLY’S HOTEL AND CASINO',
638
+ '3729' => 'JOHN ASCUAGA’S NUGGET',
639
+ '3730' => 'MGM GRAND HOTEL',
640
+ '3731' => 'HARRAH’S HOTELS AND CASINOS',
641
+ '3732' => 'OPRYLAND HOTEL',
642
+ '3733' => 'BOCA RATON RESORT',
643
+ '3734' => 'HARVEY/BRISTOL HOTELS',
644
+ '3735' => 'Hotels/Motels/Inns/Resorts',
645
+ '3736' => 'COLORADO BELLE/EDGEWATER RESORT',
646
+ '3737' => 'RIVIERA HOTEL AND CASINO',
647
+ '3738' => 'TROPICANA RESORT AND CASINO',
648
+ '3739' => 'WOODSIDE HOTELS AND RESORTS',
649
+ '3740' => 'TOWNPLACE SUITES',
650
+ '3741' => 'MILLENIUM BROADWAY HOTEL',
651
+ '3742' => 'CLUB MED',
652
+ '3743' => 'BILTMORE HOTEL AND SUITES',
653
+ '3744' => 'CAREFREE RESORTS',
654
+ '3745' => 'ST. REGIS HOTEL',
655
+ '3746' => 'THE ELIOT HOTEL',
656
+ '3747' => 'CLUBCORP/CLUB RESORTS',
657
+ '3748' => 'WELESLEY INNS',
658
+ '3749' => 'THE BEVERLY HILLS HOTEL',
659
+ '3750' => 'CROWNE PLAZA HOTELS',
660
+ '3751' => 'HOMEWOOD SUITES',
661
+ '3752' => 'PEABODY HOTELS',
662
+ '3753' => 'GREENBRIAH RESORTS',
663
+ '3754' => 'AMELIA ISLAND PLANATION',
664
+ '3755' => 'THE HOMESTEAD',
665
+ '3756' => 'SOUTH SEAS RESORTS',
666
+ '3757' => 'Hotels/Motels/Inns/Resorts',
667
+ '3758' => 'Hotels/Motels/Inns/Resorts',
668
+ '3759' => 'Hotels/Motels/Inns/Resorts',
669
+ '3760' => 'Hotels/Motels/Inns/Resorts',
670
+ '3761' => 'Hotels/Motels/Inns/Resorts',
671
+ '3762' => 'Hotels/Motels/Inns/Resorts',
672
+ '3763' => 'Hotels/Motels/Inns/Resorts',
673
+ '3764' => 'Hotels/Motels/Inns/Resorts',
674
+ '3765' => 'Hotels/Motels/Inns/Resorts',
675
+ '3766' => 'Hotels/Motels/Inns/Resorts',
676
+ '3767' => 'Hotels/Motels/Inns/Resorts',
677
+ '3768' => 'Hotels/Motels/Inns/Resorts',
678
+ '3769' => 'Hotels/Motels/Inns/Resorts',
679
+ '3770' => 'Hotels/Motels/Inns/Resorts',
680
+ '3771' => 'Hotels/Motels/Inns/Resorts',
681
+ '3772' => 'Hotels/Motels/Inns/Resorts',
682
+ '3773' => 'Hotels/Motels/Inns/Resorts',
683
+ '3774' => 'Hotels/Motels/Inns/Resorts',
684
+ '3775' => 'Hotels/Motels/Inns/Resorts',
685
+ '3776' => 'Hotels/Motels/Inns/Resorts',
686
+ '3777' => 'Hotels/Motels/Inns/Resorts',
687
+ '3778' => 'Hotels/Motels/Inns/Resorts',
688
+ '3779' => 'Hotels/Motels/Inns/Resorts',
689
+ '3780' => 'Hotels/Motels/Inns/Resorts',
690
+ '3781' => 'Hotels/Motels/Inns/Resorts',
691
+ '3782' => 'Hotels/Motels/Inns/Resorts',
692
+ '3783' => 'Hotels/Motels/Inns/Resorts',
693
+ '3784' => 'Hotels/Motels/Inns/Resorts',
694
+ '3785' => 'Hotels/Motels/Inns/Resorts',
695
+ '3786' => 'Hotels/Motels/Inns/Resorts',
696
+ '3787' => 'Hotels/Motels/Inns/Resorts',
697
+ '3788' => 'Hotels/Motels/Inns/Resorts',
698
+ '3789' => 'Hotels/Motels/Inns/Resorts',
699
+ '3790' => 'Hotels/Motels/Inns/Resorts',
700
+ '3816' => 'Home2Suites',
701
+ '3835' => '* MASTERS ECONOMY INNS',
702
+ '4011' => 'Railroads',
703
+ '4111' => 'Local/Suburban Commuter Passenger Transportation – Railroads, Feries, Local Water Transportation.',
704
+ '4112' => 'Passenger Railways',
705
+ '4119' => 'Ambulance Services',
706
+ '4121' => 'Taxicabs and Limousines',
707
+ '4131' => 'Bus Lines, Including Charters, Tour Buses',
708
+ '4214' => 'Motor Freight Carriers, Moving and Storage Companies, Trucking – Local/Long Distance, Delivery Services – Local',
709
+ '4215' => 'Courier Services – Air or Ground, Freight forwarders',
710
+ '4225' => 'Public warehousing, Storage',
711
+ '4411' => 'Cruise and Steamship Lines',
712
+ '4457' => 'Boat Rentals and Leases',
713
+ '4468' => 'Marinas, Marine Service, and Supplies',
714
+ '4511' => 'Airlines, Air Carriers (not listed elsewhere)',
715
+ '4582' => 'Airports, Airport Terminals, Flying Fields',
716
+ '4722' => 'Travel Agencies and Tour Operations',
717
+ '4723' => 'Package Tour Operators (For use in Germany only)',
718
+ '4784' => 'Toll and Bridge Fees',
719
+ '4789' => 'Transportation Services, Not elsewhere classified)',
720
+ '4812' => 'Telecommunications Equipment including telephone sales',
721
+ '4814' => 'Fax services, Telecommunication Services',
722
+ '4815' => 'VisaPhone',
723
+ '4816' => 'Computer Network Services',
724
+ '4821' => 'Telegraph services',
725
+ '4829' => 'Money Orders – Wire Transfer',
726
+ '4899' => 'Cable and other pay television (previously Cable Services)',
727
+ '4900' => 'Electric, Gas, Sanitary and Water Utilities',
728
+ '5013' => 'Motor vehicle supplies and new parts',
729
+ '5021' => 'Office and Commercial Furniture',
730
+ '5039' => 'Construction Materials, Not Elsewhere Classified',
731
+ '5044' => 'Office, Photographic, Photocopy, and Microfilm Equipment',
732
+ '5045' => 'Computers, Computer Peripheral Equipment, Software',
733
+ '5046' => 'Commercial Equipment, Not Elsewhere Classified',
734
+ '5047' => 'Medical, Dental Ophthalmic, Hospital Equipment and Supplies',
735
+ '5051' => 'Metal Service Centers and Offices',
736
+ '5065' => 'Electrical Parts and Equipment',
737
+ '5072' => 'Hardware Equipment and Supplies',
738
+ '5074' => 'Plumbing and Heating Equipment and Supplies',
739
+ '5085' => 'Industrial Supplies, Not Elsewhere Classified',
740
+ '5094' => 'Precious Stones and Metals, Watches and Jewelry',
741
+ '5099' => 'Durable Goods, Not Elsewhere Classified',
742
+ '5111' => 'Stationery, Office Supplies, Printing, and Writing Paper',
743
+ '5122' => 'Drugs, Drug Proprietors, and Druggist’s Sundries',
744
+ '5131' => 'Piece Goods, Notions, and Other Dry Goods',
745
+ '5137' => 'Men’s Women’s and Children’s Uniforms and Commercial Clothing',
746
+ '5139' => 'Commercial Footwear',
747
+ '5169' => 'Chemicals and Allied Products, Not Elsewhere Classified',
748
+ '5172' => 'Petroleum and Petroleum Products',
749
+ '5192' => 'Books, Periodicals, and Newspapers',
750
+ '5193' => 'Florists’ Supplies, Nursery Stock and Flowers',
751
+ '5198' => 'Paints, Varnishes, and Supplies',
752
+ '5199' => 'Non-durable Goods, Not Elsewhere Classified',
753
+ '5200' => 'Home Supply Warehouse Stores',
754
+ '5211' => 'Lumber and Building Materials Stores',
755
+ '5231' => 'Glass, Paint, and Wallpaper Stores',
756
+ '5251' => 'Hardware Stores',
757
+ '5261' => 'Nurseries – Lawn and Garden Supply Store',
758
+ '5271' => 'Mobile Home Dealers',
759
+ '5300' => 'Wholesale Clubs',
760
+ '5309' => 'Duty Free Store',
761
+ '5310' => 'Discount Stores',
762
+ '5311' => 'Department Stores',
763
+ '5331' => 'Variety Stores',
764
+ '5399' => 'Misc. General Merchandise',
765
+ '5411' => 'Grocery Stores, Supermarkets',
766
+ '5422' => 'Meat Provisioners – Freezer and Locker',
767
+ '5441' => 'Candy, Nut, and Confectionery Stores',
768
+ '5451' => 'Dairy Products Stores',
769
+ '5462' => 'Bakeries',
770
+ '5499' => 'Misc. Food Stores – Convenience Stores and Specialty Markets',
771
+ '5511' => 'Car and Truck Dealers (New and Used) Sales, Service, Repairs, Parts, and Leasing',
772
+ '5521' => 'Automobile and Truck Dealers (Used Only)',
773
+ '5531' => 'Automobile Supply Stores',
774
+ '5532' => 'Automotive Tire Stores',
775
+ '5533' => 'Automotive Parts, Accessories Stores',
776
+ '5541' => 'Service Stations (with or without ancillary services)',
777
+ '5542' => 'Automated Fuel Dispensers',
778
+ '5551' => 'Boat Dealers',
779
+ '5561' => 'Recreational and Utility Trailers, Camp Dealers',
780
+ '5571' => 'Motorcycle Dealers',
781
+ '5592' => 'Motor Home Dealers',
782
+ '5598' => 'Snowmobile Dealers',
783
+ '5599' => 'Miscellaneous Auto Dealers ',
784
+ '5611' => 'Men’s and Boy’s Clothing and Accessories Stores',
785
+ '5621' => 'Women’s Ready-to-Wear Stores',
786
+ '5631' => 'Women’s Accessory and Specialty Shops',
787
+ '5641' => 'Children’s and Infant’s Wear Stores',
788
+ '5651' => 'Family Clothing Stores',
789
+ '5655' => 'Sports Apparel, Riding Apparel Stores',
790
+ '5661' => 'Shoe Stores',
791
+ '5681' => 'Furriers and Fur Shops',
792
+ '5691' => 'Men’s and Women’s Clothing Stores',
793
+ '5697' => 'Tailors, Seamstress, Mending, and Alterations',
794
+ '5698' => 'Wig and Toupee Stores',
795
+ '5699' => 'Miscellaneous Apparel and Accessory Shops',
796
+ '5712' => 'Furniture, Home Furnishings, and Equipment Stores, ExceptAppliances',
797
+ '5713' => 'Floor Covering Stores',
798
+ '5714' => 'Drapery, Window Covering and Upholstery Stores',
799
+ '5718' => 'Fireplace, Fireplace Screens, and Accessories Stores',
800
+ '5719' => 'Miscellaneous Home Furnishing Specialty Stores',
801
+ '5722' => 'Household Appliance Stores',
802
+ '5732' => 'Electronic Sales',
803
+ '5733' => 'Music Stores, Musical Instruments, Piano Sheet Music',
804
+ '5734' => 'Computer Software Stores',
805
+ '5735' => 'Record Shops',
806
+ '5811' => 'Caterers',
807
+ '5812' => 'Eating places and Restaurants',
808
+ '5813' => 'Drinking Places (Alcoholic Beverages), Bars, Taverns, Cocktail lounges, Nightclubs and Discotheques',
809
+ '5814' => 'Fast Food Restaurants',
810
+ '5815' => 'Digital Goods: Media, Books, Movies, Music',
811
+ '5816' => 'Digital Goods: Games',
812
+ '5817' => 'Digital Goods: Applications (Excludes Games)',
813
+ '5818' => 'Digital Goods: Large Digital Goods Merchant',
814
+ '5832' => 'Antique Shops – Sales, Repairs, and Restoration Services',
815
+ '5912' => 'Drug Stores and Pharmacies',
816
+ '5921' => 'Package Stores – Beer, Wine, and Liquor',
817
+ '5931' => 'Used Merchandise and Secondhand Stores',
818
+ '5932' => 'Antique Shops',
819
+ '5933' => 'Pawn Shops and Salvage Yards',
820
+ '5935' => 'Wrecking and Salvage Yards',
821
+ '5937' => 'Antique Reproductions',
822
+ '5940' => 'Bicycle Shops – Sales and Service',
823
+ '5941' => 'Sporting Goods Stores',
824
+ '5942' => 'Book Stores',
825
+ '5943' => 'Stationery Stores, Office and School Supply Stores',
826
+ '5944' => 'Watch, Clock, Jewelry, and Silverware Stores',
827
+ '5945' => 'Hobby, Toy, and Game Shops',
828
+ '5946' => 'Camera and Photographic Supply Stores',
829
+ '5947' => 'Card Shops, Gift, Novelty, and Souvenir Shops',
830
+ '5948' => 'Leather Goods Stores',
831
+ '5949' => 'Sewing, Needle, Fabric, and Price Goods Stores',
832
+ '5950' => 'Glassware/Crystal Stores',
833
+ '5960' => 'Direct Marketing- Insurance Service',
834
+ '5961' => 'Mail Order Houses Including Catalog Order Stores, Book/Record Clubs (No longer permitted for U.S. original presentments)',
835
+ '5962' => 'Direct Marketing – Travel Related Arrangements Services',
836
+ '5963' => 'Door-to-Door Sales',
837
+ '5964' => 'Direct Marketing – Catalog Merchant',
838
+ '5965' => 'Direct Marketing – Catalog and Catalog and Retail Merchant',
839
+ '5966' => 'Direct Marketing- Outbound Telemarketing Merchant',
840
+ '5967' => 'Direct Marketing – Inbound Teleservices Merchant',
841
+ '5968' => 'Direct Marketing – Continuity/Subscription Merchant',
842
+ '5969' => 'Direct Marketing – Not Elsewhere Classified',
843
+ '5970' => 'Artist’s Supply and Craft Shops',
844
+ '5971' => 'Art Dealers and Galleries',
845
+ '5972' => 'Stamp and Coin Stores – Philatelic and Numismatic Supplies',
846
+ '5973' => 'Religious Goods Stores',
847
+ '5975' => 'Hearing Aids – Sales, Service, and Supply Stores',
848
+ '5976' => 'Orthopedic Goods Prosthetic Devices',
849
+ '5977' => 'Cosmetic Stores',
850
+ '5978' => 'Typewriter Stores – Sales, Rental, Service',
851
+ '5983' => 'Fuel – Fuel Oil, Wood, Coal, Liquefied Petroleum',
852
+ '5992' => 'Florists',
853
+ '5993' => 'Cigar Stores and Stands',
854
+ '5994' => 'News Dealers and Newsstands',
855
+ '5995' => 'Pet Shops, Pet Foods, and Supplies Stores',
856
+ '5996' => 'Swimming Pools – Sales, Service, and Supplies',
857
+ '5997' => 'Electric Razor Stores – Sales and Service',
858
+ '5998' => 'Tent and Awning Shops',
859
+ '5999' => 'Miscellaneous and Specialty Retail Stores',
860
+ '6010' => 'Financial Institutions – Manual Cash Disbursements',
861
+ '6011' => 'Financial Institutions – Manual Cash Disbursements',
862
+ '6012' => 'Financial Institutions – Merchandise and Services',
863
+ '6051' => 'Non-Financial Institutions – Foreign Currency, Money Orders (not wire transfer) and Travelers Cheques',
864
+ '6211' => 'Security Brokers/Dealers',
865
+ '6300' => 'Insurance Sales, Underwriting, and Premiums',
866
+ '6381' => 'Insurance Premiums, (no longer valid for first presentment work)',
867
+ '6399' => 'Insurance, Not Elsewhere Classified (no longer valid forfirst presentment work)',
868
+ '6513' => 'Real Estate Agents and Managers - Rentals',
869
+ '7011' => 'Lodging – Hotels, Motels, Resorts, Central Reservation Services (not elsewhere classified)',
870
+ '7012' => 'Timeshares',
871
+ '7032' => 'Sporting and Recreational Camps',
872
+ '7033' => 'Trailer Parks and Camp Grounds',
873
+ '7210' => 'Laundry, Cleaning, and Garment Services',
874
+ '7211' => 'Laundry – Family and Commercial',
875
+ '7216' => 'Dry Cleaners',
876
+ '7217' => 'Carpet and Upholstery Cleaning',
877
+ '7221' => 'Photographic Studios',
878
+ '7230' => 'Barber and Beauty Shops',
879
+ '7251' => 'Shop Repair Shops and Shoe Shine Parlors, and Hat Cleaning Shops',
880
+ '7261' => 'Funeral Service and Crematories',
881
+ '7273' => 'Dating and Escort Services',
882
+ '7276' => 'Tax Preparation Service',
883
+ '7277' => 'Counseling Service – Debt, Marriage, Personal',
884
+ '7278' => 'Buying/Shopping Services, Clubs',
885
+ '7296' => 'Clothing Rental – Costumes, Formal Wear, Uniforms',
886
+ '7297' => 'Massage Parlors',
887
+ '7298' => 'Health and Beauty Shops',
888
+ '7299' => 'Miscellaneous Personal Services (not elsewhere classifies)',
889
+ '7311' => 'Advertising Services',
890
+ '7321' => 'Consumer Credit Reporting Agencies',
891
+ '7332' => 'Blueprinting and Photocopying Services',
892
+ '7333' => 'Commercial Photography, Art and Graphics',
893
+ '7338' => 'Quick Copy, Reproduction and Blueprinting Services',
894
+ '7339' => 'Stenographic and Secretarial Support Services',
895
+ '7342' => 'Exterminating and Disinfecting Services',
896
+ '7349' => 'Cleaning and Maintenance, Janitorial Services',
897
+ '7361' => 'Employment Agencies, Temporary Help Services',
898
+ '7372' => 'Computer Programming, Integrated Systems Design and Data Processing Services',
899
+ '7375' => 'Information Retrieval Services',
900
+ '7379' => 'Computer Maintenance and Repair Services, Not Elsewhere Classified',
901
+ '7392' => 'Management, Consulting, and Public Relations Services',
902
+ '7393' => 'Protective and Security Services – Including Armored Carsand Guard Dogs',
903
+ '7394' => 'Equipment Rental and Leasing Services, Tool Rental, Furniture Rental, and Appliance Rental',
904
+ '7395' => 'Photofinishing Laboratories, Photo Developing',
905
+ '7399' => 'Business Services, Not Elsewhere Classified',
906
+ '7511' => 'Truck Stop',
907
+ '7512' => 'Car Rental Companies (Not Listed Below)',
908
+ '7513' => 'Truck and Utility Trailer Rentals',
909
+ '7519' => 'Motor Home and Recreational Vehicle Rentals',
910
+ '7523' => 'Automobile Parking Lots and Garages',
911
+ '7531' => 'Automotive Body Repair Shops',
912
+ '7534' => 'Tire Re-treading and Repair Shops',
913
+ '7535' => 'Paint Shops – Automotive',
914
+ '7538' => 'Automotive Service Shops',
915
+ '7542' => 'Car Washes',
916
+ '7549' => 'Towing Services',
917
+ '7622' => 'Radio Repair Shops',
918
+ '7623' => 'Air Conditioning and Refrigeration Repair Shops',
919
+ '7629' => 'Electrical And Small Appliance Repair Shops',
920
+ '7631' => 'Watch, Clock, and Jewelry Repair',
921
+ '7641' => 'Furniture, Furniture Repair, and Furniture Refinishing',
922
+ '7692' => 'Welding Repair',
923
+ '7699' => 'Repair Shops and Related Services –Miscellaneous',
924
+ '7800' => 'Government-Owned Lotteries',
925
+ '7801' => 'Government-Licensed On-Line Casinos (On-Line Gambling)',
926
+ '7802' => 'Government-Licensed Horse/Dog Racing',
927
+ '7829' => 'Motion Pictures and Video Tape Production and Distribution',
928
+ '7832' => 'Motion Picture Theaters',
929
+ '7841' => 'Video Tape Rental Stores',
930
+ '7911' => 'Dance Halls, Studios and Schools',
931
+ '7922' => 'Theatrical Producers (Except Motion Pictures), Ticket Agencies',
932
+ '7929' => 'Bands, Orchestras, and Miscellaneous Entertainers (Not Elsewhere Classified)',
933
+ '7932' => 'Billiard and Pool Establishments',
934
+ '7933' => 'Bowling Alleys',
935
+ '7941' => 'Commercial Sports, Athletic Fields, Professional Sport Clubs, and Sport Promoters',
936
+ '7991' => 'Tourist Attractions and Exhibits',
937
+ '7992' => 'Golf Courses – Public',
938
+ '7993' => 'Video Amusement Game Supplies',
939
+ '7994' => 'Video Game Arcades/Establishments',
940
+ '7995' => 'Betting (including Lottery Tickets, Casino Gaming Chips, Off-track Betting and Wagers at Race Tracks)',
941
+ '7996' => 'Amusement Parks, Carnivals, Circuses, Fortune Tellers',
942
+ '7997' => 'Membership Clubs (Sports, Recreation, Athletic), Country Clubs, and Private Golf Courses',
943
+ '7998' => 'Aquariums, Sea-aquariums, Dolphinariums',
944
+ '7999' => 'Recreation Services (Not Elsewhere Classified)',
945
+ '8011' => 'Doctors and Physicians (Not Elsewhere Classified)',
946
+ '8021' => 'Dentists and Orthodontists',
947
+ '8031' => 'Osteopaths',
948
+ '8041' => 'Chiropractors',
949
+ '8042' => 'Optometrists and Ophthalmologists',
950
+ '8043' => 'Opticians, Opticians Goods and Eyeglasses',
951
+ '8044' => 'Opticians, Optical Goods, and Eyeglasses (no longer validfor first presentments)',
952
+ '8049' => 'Podiatrists and Chiropodists',
953
+ '8050' => 'Nursing and Personal Care Facilities',
954
+ '8062' => 'Hospitals',
955
+ '8071' => 'Medical and Dental Laboratories',
956
+ '8099' => 'Medical Services and Health Practitioners (Not Elsewhere Classified)',
957
+ '8111' => 'Legal Services and Attorneys',
958
+ '8211' => 'Elementary and Secondary Schools',
959
+ '8220' => 'Colleges, Junior Colleges, Universities, and ProfessionalSchools',
960
+ '8241' => 'Correspondence Schools',
961
+ '8244' => 'Business and Secretarial Schools',
962
+ '8249' => 'Vocational Schools and Trade Schools',
963
+ '8299' => 'Schools and Educational Services (Not Elsewhere Classified)',
964
+ '8351' => 'Child Care Services',
965
+ '8398' => 'Charitable and Social Service Organizations',
966
+ '8641' => 'Civic, Fraternal, and Social Associations',
967
+ '8651' => 'Political Organizations',
968
+ '8661' => 'Religious Organizations',
969
+ '8675' => 'Automobile Associations',
970
+ '8699' => 'Membership Organizations (Not Elsewhere Classified)',
971
+ '8734' => 'Testing Laboratories (non-medical)',
972
+ '8911' => 'Architectural – Engineering and Surveying Services',
973
+ '8931' => 'Accounting, Auditing, and Bookkeeping Services',
974
+ '8999' => 'Professional Services (Not Elsewhere Defined)',
975
+ '9211' => 'Court Costs, including Alimony and Child Support',
976
+ '9222' => 'Fines',
977
+ '9223' => 'Bail and Bond Payments',
978
+ '9311' => 'Tax Payments',
979
+ '9399' => 'Government Services (Not Elsewhere Classified)',
980
+ '9402' => 'Postal Services – Government Only',
981
+ '9405' => 'Intra – Government Transactions',
982
+ '9700' => 'Automated Referral Service (For Visa Only)',
983
+ '9701' => 'Visa Credential Service (For Visa Only)',
984
+ '9702' => 'GCAS Emergency Services (For Visa Only)',
985
+ '9950' => 'Intra – Company Purchases (For Visa Only)'
986
+ }
987
+
988
+ def self.signature
989
+ 'mcc'
990
+ end
991
+
992
+ def coerce(value)
993
+ value.to_s
994
+ end
995
+
996
+ def passes?(attribute, value, validator)
997
+ MERCHANT_CATEGORIES.keys.include?(value.to_s)
998
+ end
999
+
1000
+ def message(attribute, value, validator)
1001
+ 'The value must be a valid merchant category code.'
1002
+ end
1003
+ end
@@ -6,14 +6,23 @@ module MiniDefender
6
6
  # @param [Hash] flat_data
7
7
  # @return [Hash]
8
8
  def expand(rules, flat_data)
9
- rules
10
- .map { |k, v| [Regexp.compile('\A' + k.gsub(/\*/, '\d+') + '\Z'), v] }.to_h
11
- .map { |p, set|
12
- data_rules = flat_data.filter { |k, _| p.match? k }.map { |k, _| [k, set] }
13
- data_rules.length > 0 ? data_rules : [[p.source.gsub(/\\[AZ]/, '').gsub('\d+', '0'), set]]
14
- }
15
- .flatten(1)
16
- .to_h
9
+ result = {}
10
+
11
+ rules.each do |rule_key, rule_set|
12
+ unless rule_key.include?('*')
13
+ result[rule_key] = rule_set
14
+ next
15
+ end
16
+
17
+ k_pattern = Regexp.compile('\A' + rule_key.gsub(/\*/, '\d+') + '\Z')
18
+
19
+ flat_data.each do |value_key, _|
20
+ next unless k_pattern.match?(value_key)
21
+ result[value_key] = rule_set
22
+ end
23
+ end
24
+
25
+ result
17
26
  end
18
27
  end
19
28
  end
@@ -23,6 +23,7 @@ module MiniDefender
23
23
  [k, @factory.init_set(set)]
24
24
  end
25
25
 
26
+ # Set default values for missing data key compared to rules
26
27
  data_rules.each do |k, set|
27
28
  if !@data.key?(k) || @data[k].blank?
28
29
  set.filter{ |r| r.defaults?(self) }.each do |r|
@@ -51,18 +52,25 @@ module MiniDefender
51
52
  end
52
53
 
53
54
  value = coerced = @data[k]
55
+ force_coerce = false
56
+
54
57
  rule_set.each do |rule|
55
58
  next unless rule.active?(self)
56
59
 
57
60
  value_included &= !rule.excluded?(self)
58
61
 
59
- if rule.passes?(k, coerced, self)
62
+ if rule.passes?(k, value, self)
60
63
  coerced = rule.coerce(coerced)
64
+ force_coerce = rule.force_coerce?
61
65
  else
62
66
  @errors[k] << rule.error_message(k, value, self)
63
67
  end
64
68
  end
65
69
 
70
+ if force_coerce
71
+ value = coerced
72
+ end
73
+
66
74
  if @errors[k].empty? && value_included
67
75
  @validated[k] = value
68
76
  @coerced[k] = coerced
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module MiniDefender
4
- VERSION = "0.4.0"
4
+ VERSION = "0.5.0"
5
5
  end
@@ -14,8 +14,6 @@ Gem::Specification.new do |spec|
14
14
  spec.license = "MIT"
15
15
  spec.required_ruby_version = ">= 2.6.0"
16
16
 
17
- # spec.metadata["allowed_push_host"] = "TODO: Set to your gem server 'https://example.com'"
18
-
19
17
  spec.metadata["homepage_uri"] = spec.homepage
20
18
  spec.metadata["source_code_uri"] = spec.homepage
21
19
 
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: mini_defender
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.4.0
4
+ version: 0.5.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Ali Alhoshaiyan
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2023-10-28 00:00:00.000000000 Z
11
+ date: 2024-01-16 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: activesupport
@@ -161,6 +161,7 @@ files:
161
161
  - lib/mini_defender/rules/mac_address.rb
162
162
  - lib/mini_defender/rules/max.rb
163
163
  - lib/mini_defender/rules/max_digits.rb
164
+ - lib/mini_defender/rules/merchant_category_code.rb
164
165
  - lib/mini_defender/rules/mime_types.rb
165
166
  - lib/mini_defender/rules/min.rb
166
167
  - lib/mini_defender/rules/min_digits.rb