13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
|
# File 'lib/util/validation/card.rb', line 13
def self.list(data)
if data.key?('card_brand')
allowed_brand_values = ['Visa', 'Mastercard', 'Amex', 'Diners']
Helpers.validate_value(data[:card_brand], allowed_brand_values)
end
if data.key?('card_type')
allowed_card_type_values = ['credito', 'debito', 'internacional']
Helpers.validate_value(data[:card_type], allowed_card_type_values)
end
if data.key?('creation_date_from') && data.key?('creation_date_to')
Helpers.validate_date_filter(data[:creation_date_from], data[:creation_date_to])
end
if data.key?('country_code')
Helpers.validate_value(data[:country_code], get_country_codes)
end
end
|