prove_uru 0.1.0 → 0.1.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
data/VERSION CHANGED
@@ -1 +1 @@
1
- 0.1.0
1
+ 0.1.1
data/lib/prove_uru.rb CHANGED
@@ -9,11 +9,15 @@ require 'savon'
9
9
 
10
10
 
11
11
  module ProveUru
12
+ autoload :Authenticate, 'prove_uru/authenticate'
13
+ autoload :AuthenticationResult, 'prove_uru/authentication_result'
12
14
  autoload :ProfileList, 'prove_uru/profile_list'
13
15
  autoload :Profile, 'prove_uru/profile'
14
16
  autoload :FreeAddress, 'prove_uru/free_address'
15
17
  autoload :FixedAddress, 'prove_uru/fixed_address'
16
- autoload :
18
+ autoload :UkData, 'prove_uru/uk_data'
19
+ autoload :UkAddress, 'prove_uru/uk_address'
20
+ autoload :PersonalData, 'prove_uru/personal_data'
17
21
 
18
22
  XML_NAMESPACE = "https://www.prove-uru.co.uk/"
19
23
  TEST_BASE_URL = "https://pilot.prove-uru.co.uk:8443/"
@@ -6,19 +6,13 @@ class ProveUru::Authenticate
6
6
  soap.body = ProveUru.merge_prove_password_hash({
7
7
  "ProfileId" => profile_id,
8
8
  "UserData" => {
9
- "Basic" => user_data.to_prove_hash()
9
+ "Basic" => user_data.to_prove_hash,
10
+ "UKData" => uk_data.to_prove_hash
10
11
  }
11
12
  })
12
13
  end
13
14
 
14
- list = Array.new
15
-
16
15
  response = response.to_hash
17
- response[:get_profiles_response][:get_profiles_result][:uru_profile5].each do |p|
18
- puts p
19
- list << ::ProveUru::Profile.new(p)
20
- end
21
-
22
- list
16
+ ::ProveUru::AuthenticationResult.new(response[:authenticate_by_profile_response][:authenticate_by_profile_result])
23
17
  end
24
18
  end
@@ -0,0 +1,49 @@
1
+
2
+ class ProveUru::AuthenticationResult
3
+ ATTRIBUTES = [
4
+ :authentication_id, :timestamp, :no_retry, :user_breakpoint, :authentication_count,
5
+ :profile_id, :profile_name, :profile_version, :profile_revision, :profile_state,
6
+ :result_codes, :score, :band_text
7
+ ].freeze
8
+
9
+ ATTRIBUTES.each do |attr|
10
+ attr_accessor attr
11
+ end
12
+
13
+ def initialize(args = nil)
14
+ ATTRIBUTES.each do |a|
15
+ if (args.key?(a))
16
+ instance_variable_set("@#{a}", args[a])
17
+ end
18
+ end
19
+ end
20
+
21
+ def inspect
22
+ ATTRIBUTES.inject({ }) do |h, attr|
23
+ h[attr] = instance_variable_get("@#{attr}")
24
+ h
25
+ end
26
+ end
27
+
28
+ end
29
+
30
+ # {
31
+ # :authenticate_by_profile_response=>{
32
+ # :authenticate_by_profile_result=>{
33
+ # :authentication_id=>"db6d46ed-e44d-4f96-a101-f81252d54fa3",
34
+ # :timestamp=>nil, :no_retry=>nil, :user_breakpoint=>"6", :authentication_count=>"15",
35
+ # :profile_id=>"6e7c1e73-3471-4777-ae35-24283761a4da", :profile_name=>"Core KYC Check", :profile_version=>"1", :profile_revision=>"0", :profile_state=>"PS_EFF",
36
+ # :result_codes=>{
37
+ # :item_check=>[
38
+ # {:type=>"Standard", :name=>"Mortality", :description=>"Provides checking of a name at an address against the \"Halo Register\" data.", :comment=>{:result_code=>[{:description=>"No middle initial specified by user.", :@code=>"101"}, {:description=>"No/insufficient details supplied by user for address #2", :@code=>"112"}, {:description=>"No/insufficient details supplied by user for address #3", :@code=>"113"}, {:description=>"No/insufficient details supplied by user for address #4", :@code=>"114"}]}, :match=>{:result_code=>{:description=>"Halo source indicates this person is not deceased at address #1", :@code=>"1071"}}, :@id=>"10"},
39
+ # {:type=>"ElectoralRoll", :name=>"Electoral Roll (Edited) / PAF", :description=>"Provides authentication of name and address including 5 year history and date of birth.", :comment=>{:result_code=>[{:description=>"No middle initial specified by user.", :@code=>"101"}, {:description=>"First year of residence for address #1 not supplied by user.", :@code=>"151"}, {:description=>"Last year of residence for address #1 not supplied by user. Applying default.", :@code=>"161"}, {:description=>"No date of birth is available on the electoral roll at address #1", :@code=>"131"}, {:description=>"No/insufficient details supplied by user for address #2", :@code=>"112"}, {:description=>"No/insufficient details supplied by user for address #3", :@code=>"113"}, {:description=>"No/insufficient details supplied by user for address #4", :@code=>"114"}]}, :match=>{:result_code=>[{:description=>"Address #1 details are valid", :@code=>"1001"}, {:description=>"Surname details matched address #1", :@code=>"1011"}]}, :warning=>{:result_code=>{:description=>"Forename alias matched address #1", :@code=>"4091"}}, :@id=>"1"},
40
+ # {:type=>["Telephone", "URUTelephoneCheckResultCodes"], :name=>"Land Telephone", :description=>"Provides authentication against land telephone number and ex-directory status.", :comment=>{:result_code=>{:description=>"Execution of this item check was ignored (profile conditions were not met).", :@code=>"2"}}, :@id=>"6"},
41
+ # {:type=>"CallID", :name=>"CallID (Money Laundering)", :description=>"Provides authentication of name, address and date of birth against CallID for a Money Laundering Check.", :comment=>{:result_code=>{:description=>"Execution of this item check was ignored (profile conditions were not met).", :@code=>"2"}}, :@id=>"55"}
42
+ # ]
43
+ # },
44
+ # :score=>"1011",
45
+ # :band_text=>"3. PASS Age & KYC"
46
+ # },
47
+ # :@xmlns=>"https://www.prove-uru.co.uk/"
48
+ # }
49
+ # }
@@ -3,15 +3,15 @@ class ProveUru::FixedAddress
3
3
 
4
4
  def to_prove_hash
5
5
  {
6
- "Postcode" => :postcode,
7
- "BuildingName" => :building_name,
8
- "BuildingNo" => :building_no,
9
- "SubBuilding" =>:sub_building,
10
- "Organisation" =>:organisation,
11
- "Street" =>:street,
12
- "SubStreet" =>:sub_street,
13
- "Town" =>:town,
14
- "District" =>:district
6
+ "Postcode" => self.postcode,
7
+ "BuildingName" => self.building_name,
8
+ "BuildingNo" => self.building_no,
9
+ "SubBuilding" => self.sub_building,
10
+ "Organisation" => self.organisation,
11
+ "Street" => self.street,
12
+ "SubStreet" => self.sub_street,
13
+ "Town" => self.town,
14
+ "District" => self.district
15
15
  }
16
16
  end
17
17
 
@@ -3,15 +3,14 @@ class ProveUru::FreeAddress
3
3
 
4
4
  def to_prove_hash
5
5
  {
6
- "Line1" => :line_1,
7
- "Line2" => :line_2,
8
- "Line3" => :line_3,
9
- "Line4" => :line_4,
10
- "Line5" => :line_5,
11
- "Line6" => :line_6,
12
- "Line7" => :line_7,
13
- "Line8" => :line_8,
14
- "Line9" => :line_9
6
+ "Line1" => self.line_1,
7
+ "Line2" => self.line_2,
8
+ "Line3" => self.line_3,
9
+ "Line4" => self.line_4,
10
+ "Line5" => self.line_5,
11
+ "Line6" => self.line_6,
12
+ "Line7" => self.line_7,
13
+ "Line8" => self.line_8
15
14
  }
16
15
  end
17
16
 
@@ -1,5 +1,5 @@
1
1
  class ProveUru::PersonalData
2
- attr_accessor :title, :forename :middlename, :surname, :gender, :dob, :email
2
+ attr_accessor :title, :forename, :middlename, :surname, :gender, :dob, :email
3
3
 
4
4
  def to_prove_hash
5
5
  {
@@ -10,7 +10,6 @@ class ProveUru::ProfileList
10
10
 
11
11
  response = response.to_hash
12
12
  response[:get_profiles_response][:get_profiles_result][:uru_profile5].each do |p|
13
- puts p
14
13
  list << ::ProveUru::Profile.new(p)
15
14
  end
16
15
 
data/prove_uru.gemspec CHANGED
@@ -5,11 +5,11 @@
5
5
 
6
6
  Gem::Specification.new do |s|
7
7
  s.name = %q{prove_uru}
8
- s.version = "0.1.0"
8
+ s.version = "0.1.1"
9
9
 
10
10
  s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
11
11
  s.authors = [%q{Chris Norman}]
12
- s.date = %q{2011-07-30}
12
+ s.date = %q{2011-07-31}
13
13
  s.description = %q{ProveURU Gem}
14
14
  s.email = %q{chris@norman.me}
15
15
  s.extra_rdoc_files = [
@@ -26,6 +26,7 @@ Gem::Specification.new do |s|
26
26
  "VERSION",
27
27
  "lib/prove_uru.rb",
28
28
  "lib/prove_uru/authenticate.rb",
29
+ "lib/prove_uru/authentication_result.rb",
29
30
  "lib/prove_uru/fixed_address.rb",
30
31
  "lib/prove_uru/free_address.rb",
31
32
  "lib/prove_uru/personal_data.rb",
metadata CHANGED
@@ -2,7 +2,7 @@
2
2
  name: prove_uru
3
3
  version: !ruby/object:Gem::Version
4
4
  prerelease:
5
- version: 0.1.0
5
+ version: 0.1.1
6
6
  platform: ruby
7
7
  authors:
8
8
  - Chris Norman
@@ -10,7 +10,7 @@ autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
12
 
13
- date: 2011-07-30 00:00:00 Z
13
+ date: 2011-07-31 00:00:00 Z
14
14
  dependencies:
15
15
  - !ruby/object:Gem::Dependency
16
16
  name: savon
@@ -86,6 +86,7 @@ files:
86
86
  - VERSION
87
87
  - lib/prove_uru.rb
88
88
  - lib/prove_uru/authenticate.rb
89
+ - lib/prove_uru/authentication_result.rb
89
90
  - lib/prove_uru/fixed_address.rb
90
91
  - lib/prove_uru/free_address.rb
91
92
  - lib/prove_uru/personal_data.rb
@@ -110,7 +111,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
110
111
  requirements:
111
112
  - - ">="
112
113
  - !ruby/object:Gem::Version
113
- hash: 408874692366001324
114
+ hash: -4583447578522978161
114
115
  segments:
115
116
  - 0
116
117
  version: "0"