From 3acb48f0bd2f96637bb2d9c7226286aaa885acf2 Mon Sep 17 00:00:00 2001 From: Richa Verma Date: Thu, 14 Feb 2019 17:26:39 +0530 Subject: [PATCH] updated default values for proof_type parameter --- lib/plivo/resources/addresses.rb | 6 +++--- lib/plivo/resources/identities.rb | 4 ++-- spec/resource_addresses_spec.rb | 10 +++++----- spec/resource_identities_spec.rb | 10 +++++----- 4 files changed, 15 insertions(+), 15 deletions(-) diff --git a/lib/plivo/resources/addresses.rb b/lib/plivo/resources/addresses.rb index b5debd8c..e8ea3a39 100644 --- a/lib/plivo/resources/addresses.rb +++ b/lib/plivo/resources/addresses.rb @@ -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 @@ -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 diff --git a/lib/plivo/resources/identities.rb b/lib/plivo/resources/identities.rb index 87819a57..2f74ff89 100644 --- a/lib/plivo/resources/identities.rb +++ b/lib/plivo/resources/identities.rb @@ -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']) @@ -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 diff --git a/spec/resource_addresses_spec.rb b/spec/resource_addresses_spec.rb index b04d902b..3a15ca06 100644 --- a/spec/resource_addresses_spec.rb +++ b/spec/resource_addresses_spec.rb @@ -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? }) @@ -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 @@ -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 @@ -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/', @@ -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 diff --git a/spec/resource_identities_spec.rb b/spec/resource_identities_spec.rb index 318ea4fa..8f2dc641 100644 --- a/spec/resource_identities_spec.rb +++ b/spec/resource_identities_spec.rb @@ -67,7 +67,7 @@ def to_json_list(list_object) 'NY', '12345', 'US', - 'passport', + 'PASSPORT', '123456', 'US', { @@ -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', @@ -112,7 +112,7 @@ def to_json_list(list_object) 'NY', '12345', 'ES', - 'passport', + 'PASSPORT', '123456', 'ES', { @@ -137,7 +137,7 @@ def to_json_list(list_object) 'NY', '12345', 'US', - 'passport', + 'PASSPORT', '123456', 'US', { @@ -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',