Skip to content

Commit

Permalink
updated default values for proof_type parameter
Browse files Browse the repository at this point in the history
  • Loading branch information
Richa Verma authored and Richa Verma committed Feb 14, 2019
1 parent 1af3f65 commit 3acb48f
Show file tree
Hide file tree
Showing 4 changed files with 15 additions and 15 deletions.
6 changes: 3 additions & 3 deletions lib/plivo/resources/addresses.rb
Original file line number Diff line number Diff line change
Expand Up @@ -74,10 +74,10 @@ def update(options = nil)
if options[:country_iso] == 'ES'
valid_param?(:proof_type, options[:proof_type], [String, Symbol], false, ['NIF', 'NIE', 'DNI'])
else
valid_param?(:proof_type, options[:proof_type], [String, Symbol], false, ['national_id', 'passport', 'business_id'])
valid_param?(:proof_type, options[:proof_type], [String, Symbol], false, ['NATIONAL_ID_CARD', 'PASSPORT', 'BUSINESS_REGISTRATION', 'any'])
end
else
valid_param?(:proof_type, options[:proof_type], [String, Symbol], false, ['NIF', 'NIE', 'DNI', 'national_id', 'passport', 'business_id'])
valid_param?(:proof_type, options[:proof_type], [String, Symbol], false, ['NIF', 'NIE', 'DNI', 'NATIONAL_ID_CARD', 'PASSPORT', 'BUSINESS_REGISTRATION', 'any'])
end
params[:proof_type] = options[:proof_type]
end
Expand Down Expand Up @@ -265,7 +265,7 @@ def create(phone_number_country, number_type, salutation, first_name, last_name,
if country_iso == 'ES'
valid_param?(:proof_type, options[:proof_type], [String, Symbol], false, ['NIF', 'NIE', 'DNI'])
else
valid_param?(:proof_type, options[:proof_type], [String, Symbol], false, ['national_id', 'passport', 'business_id'])
valid_param?(:proof_type, options[:proof_type], [String, Symbol], false, ['NATIONAL_ID_CARD', 'PASSPORT', 'BUSINESS_REGISTRATION', 'any'])
end
params[:proof_type] = options[:proof_type]
end
Expand Down
4 changes: 2 additions & 2 deletions lib/plivo/resources/identities.rb
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ def update(options = nil)
if options[:country_iso] == 'ES'
valid_param?(:proof_type, options[:proof_type], [String, Symbol], false, ['NIF', 'NIE', 'DNI'])
else
valid_param?(:proof_type, options[:proof_type], [String, Symbol], false, ['national_id', 'passport', 'business_id'])
valid_param?(:proof_type, options[:proof_type], [String, Symbol], false, ['NATIONAL_ID_CARD', 'PASSPORT', 'BUSINESS_REGISTRATION', 'any'])
end
else
valid_param?(:proof_type, options[:proof_type], [String, Symbol], false, ['NIF', 'NIE', 'DNI', 'national_id', 'passport', 'business_id'])
Expand Down Expand Up @@ -279,7 +279,7 @@ def create(phone_number_country, number_type, salutation, first_name, last_name,
params[:street_code] = options[:street_code]
params[:municipal_code] = options[:municipal_code]
else
valid_param?(:proof_type, proof_type, [String, Symbol], true, ['national_id', 'passport', 'business_id'])
valid_param?(:proof_type, proof_type, [String, Symbol], true, ['NATIONAL_ID_CARD', 'PASSPORT', 'BUSINESS_REGISTRATION', 'any'])
params[:proof_type] = proof_type
end

Expand Down
10 changes: 5 additions & 5 deletions spec/resource_addresses_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ def to_json_list(list_object)
'US',
{
callback_url: 'https://callback.url',
proof_type: 'passport'
proof_type: 'PASSPORT'
}
))))
.to eql(JSON.parse(contents).reject { |_, v| v.nil? })
Expand All @@ -89,7 +89,7 @@ def to_json_list(list_object)
postal_code: '12345',
country_iso: 'US',
callback_url: 'https://callback.url',
proof_type: 'passport'
proof_type: 'PASSPORT'
})
end

Expand All @@ -107,7 +107,7 @@ def to_json_list(list_object)
'ES',
{
callback_url: 'https://callback.url',
proof_type: 'passport'
proof_type: 'PASSPORT'
}
)}.to raise_error(Plivo::Exceptions::InvalidRequestError)
end
Expand All @@ -128,7 +128,7 @@ def to_json_list(list_object)
'US',
{
callback_url: 'https://callback.url',
proof_type: 'passport'
proof_type: 'PASSPORT'
}
)}.to raise_error(Plivo::Exceptions::InvalidRequestError)
compare_requests(uri: '/v1/Account/MAXXXXXXXXXXXXXXXXXX/Verification/Address/',
Expand All @@ -146,7 +146,7 @@ def to_json_list(list_object)
postal_code: '12345',
country_iso: 'US',
callback_url: 'https://callback.url',
proof_type: 'passport'
proof_type: 'PASSPORT'
})
end
end
Expand Down
10 changes: 5 additions & 5 deletions spec/resource_identities_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ def to_json_list(list_object)
'NY',
'12345',
'US',
'passport',
'PASSPORT',
'123456',
'US',
{
Expand All @@ -91,7 +91,7 @@ def to_json_list(list_object)
region: 'NY',
postal_code: '12345',
country_iso: 'US',
proof_type: 'passport',
proof_type: 'PASSPORT',
id_number: '123456',
nationality: 'US',
callback_url: 'https://callback.url',
Expand All @@ -112,7 +112,7 @@ def to_json_list(list_object)
'NY',
'12345',
'ES',
'passport',
'PASSPORT',
'123456',
'ES',
{
Expand All @@ -137,7 +137,7 @@ def to_json_list(list_object)
'NY',
'12345',
'US',
'passport',
'PASSPORT',
'123456',
'US',
{
Expand All @@ -160,7 +160,7 @@ def to_json_list(list_object)
region: 'NY',
postal_code: '12345',
country_iso: 'US',
proof_type: 'passport',
proof_type: 'PASSPORT',
id_number: '123456',
nationality: 'US',
callback_url: 'https://callback.url',
Expand Down

0 comments on commit 3acb48f

Please sign in to comment.