lenddo 1.1.3 → 1.2.0

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.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 53a8fa67f549872fde38091a5553585e3740db1a
4
- data.tar.gz: 318f18a7060190cdd3ad8e5212ff8efbaab41907
3
+ metadata.gz: 350b88ad9104210e08000ba8a4700b61b9c3e1d0
4
+ data.tar.gz: f796abd968e770e39eeabfc9f0a6ea1bf4a87f3a
5
5
  SHA512:
6
- metadata.gz: 2afab5758c917506e1db8a749c7c396433918b846e41a5e3730502183d8fcb63a8cbe0055c229493951a2674b7bdca4204abaeffa0d2fc7b69ebf8bc8dffd03e
7
- data.tar.gz: 523539827e2a35fd1ef8e90a14bacfe0ad4955305e5ec8186baf393074b960cff7221ba4a0f2aa035b7e2e011392f149ba5757599cd6a08d1655673fa27e9e50
6
+ metadata.gz: c9e89869897a649b4d0d9cd27fc064452b89a2edf834e2a758d82aca0924af00c256db2d1081eb1a978e85d3b7f002e78609898674c1d4d8f838d1b5fd3cb845
7
+ data.tar.gz: 4b7db1ce4b0dfe63a4c7291bb9d7d6339aac41866d08d1677ce0a6873348aec2f54ba56d951b370dfc54a74d913237601ff2862332fab58d696f852fcaa93abf
data/README.md CHANGED
@@ -68,6 +68,14 @@ To retrieve the decision you'll need the application ID and the partner script I
68
68
 
69
69
  Lenddo::ServiceClient.application_decision(@application_id, @partnerscript_id)
70
70
 
71
+ ### Get MobileData
72
+
73
+ If you want to retrieve the mobile data stream from your partner script ID you can use this method.
74
+
75
+ require 'lenddo/service_client'
76
+
77
+ Lenddo::ServiceClient.mobile_data(@partnerscript_id)
78
+
71
79
  ### Send Extra Application Data
72
80
 
73
81
  If you're sending extra information with your application you can use this method to submit it. Extra Application Data may be used to enhance the model performance based on data you may already have about a user.
@@ -21,7 +21,7 @@ Gem::Specification.new do |spec|
21
21
  spec.require_paths = ["lib"]
22
22
 
23
23
  spec.add_development_dependency "bundler", "~> 1.14"
24
- spec.add_development_dependency "curb", "~> 0.9.3"
24
+ spec.add_development_dependency "curb", "~> 0.9.4"
25
25
  spec.add_development_dependency "json", "~> 1.8"
26
26
  spec.add_development_dependency "rake", "~> 10.0"
27
27
  spec.add_development_dependency "rspec", "~> 3.0"
@@ -0,0 +1,61 @@
1
+ module Lenddo
2
+ class NetworkService
3
+ def mobile_data(partnerscript_id)
4
+ response = signed_request(
5
+ method: "GET",
6
+ host: Lenddo.configuration.network_service,
7
+ path: "/MobileData",
8
+ params: {
9
+ partner_script_id: partnerscript_id
10
+ }
11
+ )
12
+ JSON.parse(response.body)
13
+ end
14
+
15
+ def extra_application_data(application_id, partnerscript_id, extra_data)
16
+ response = signed_request(
17
+ method: "POST",
18
+ host: Lenddo.configuration.network_service,
19
+ path: "/ExtraApplicationData",
20
+ params: {
21
+ application_id: application_id,
22
+ partner_script_id: partnerscript_id,
23
+ extra_data: extra_data
24
+ }.to_json
25
+ )
26
+ JSON.parse(response.body)
27
+ end
28
+
29
+ def partner_token(application_id, provider, token_data, oauth_key, oauth_secret)
30
+ response = signed_request(
31
+ method: "POST",
32
+ host: Lenddo.configuration.network_service,
33
+ path: "/PartnerToken",
34
+ params: {
35
+ token_data: {
36
+ key: oauth_key,
37
+ secret: oauth_secret
38
+ }.merge!(token_data),
39
+ provider: provider,
40
+ client_id: application_id
41
+ }.to_json
42
+ )
43
+ JSON.parse(response.body)
44
+ end
45
+
46
+ def commit_partner_job(partnerscript_id, application_id, profile_ids, verification)
47
+ response = signed_request(
48
+ method: "POST",
49
+ host: Lenddo.configuration.network_service,
50
+ path: "/CommitPartnerJob",
51
+ params: {
52
+ client_id: application_id,
53
+ profile_ids: profile_ids,
54
+ partner_script_id: partnerscript_id,
55
+ verification_data: verification
56
+ }.to_json
57
+ )
58
+ JSON.parse(response.body)
59
+ end
60
+ end
61
+ end
@@ -0,0 +1,51 @@
1
+ module Lenddo
2
+ class ScoreService
3
+ def application_score(application_id, partnerscript_id)
4
+ response = signed_request(
5
+ method: "GET",
6
+ host: Lenddo.configuration.score_service,
7
+ path: "/ClientScore/#{application_id}",
8
+ params: {
9
+ partner_script_id: partnerscript_id
10
+ }
11
+ )
12
+ JSON.parse(response.body)
13
+ end
14
+
15
+ def application_multiple_scores(application_id, partnerscript_id)
16
+ response = signed_request(
17
+ method: "GET",
18
+ host: Lenddo.configuration.score_service,
19
+ path: "/ApplicationMultipleScores/#{application_id}",
20
+ params: {
21
+ partner_script_id: partnerscript_id
22
+ }
23
+ )
24
+ JSON.parse(response.body)
25
+ end
26
+
27
+ def application_verification(application_id, partnerscript_id)
28
+ response = signed_request(
29
+ method: "GET",
30
+ host: Lenddo.configuration.score_service,
31
+ path: "/ClientVerification/#{application_id}",
32
+ params: {
33
+ partner_script_id: partnerscript_id
34
+ }
35
+ )
36
+ JSON.parse(response.body)
37
+ end
38
+
39
+ def application_decision(application_id, partnerscript_id)
40
+ response = signed_request(
41
+ method: "GET",
42
+ host: Lenddo.configuration.score_service,
43
+ path: "/ApplicationDecision/#{application_id}",
44
+ params: {
45
+ partner_script_id: partnerscript_id
46
+ }
47
+ )
48
+ JSON.parse(response.body)
49
+ end
50
+ end
51
+ end
@@ -1,6 +1,6 @@
1
1
  require "lenddo"
2
2
  require "lenddo/authentication"
3
- require "lenddo/service_client/score_service"
3
+ require "lenddo/score_service/self"
4
4
 
5
5
  include Lenddo::Authentication
6
6
 
@@ -36,6 +36,13 @@ module Lenddo
36
36
  @score_service ||= ScoreService.new
37
37
  @score_service.application_decision(application_id, partnerscript_id)
38
38
  end
39
+
40
+ # Get mobile data using the partner_script_id
41
+ # @param string partnerscript_id
42
+ def mobile_data(partnerscript_id)
43
+ @network_service ||= NetworkService.new
44
+ @network_service.mobile_data(partnerscript_id)
45
+ end
39
46
  end
40
47
  end
41
48
  end
@@ -1,5 +1,5 @@
1
1
  module Lenddo
2
2
  def self.version
3
- "1.1.3"
3
+ "1.2.0"
4
4
  end
5
5
  end
@@ -1,6 +1,6 @@
1
1
  require "lenddo"
2
2
  require "lenddo/authentication"
3
- require "lenddo/white_label_client/network_service"
3
+ require "lenddo/network_service/self"
4
4
 
5
5
  include Lenddo::Authentication
6
6
 
@@ -15,7 +15,7 @@ module Lenddo
15
15
  def extra_application_data(application_id, partnerscript_id, extra_data = {})
16
16
  @network_service ||= NetworkService.new
17
17
 
18
- if extra_data.class != Hash
18
+ if !extra_data.is_a?(Hash)
19
19
  raise ArgumentError.new("@extra_data must be a Hash.")
20
20
  else
21
21
  @network_service.extra_application_data(application_id, partnerscript_id, extra_data)
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: lenddo
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.1.3
4
+ version: 1.2.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - arjay salvadora
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2018-01-10 00:00:00.000000000 Z
11
+ date: 2018-01-17 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler
@@ -30,14 +30,14 @@ dependencies:
30
30
  requirements:
31
31
  - - "~>"
32
32
  - !ruby/object:Gem::Version
33
- version: 0.9.3
33
+ version: 0.9.4
34
34
  type: :development
35
35
  prerelease: false
36
36
  version_requirements: !ruby/object:Gem::Requirement
37
37
  requirements:
38
38
  - - "~>"
39
39
  - !ruby/object:Gem::Version
40
- version: 0.9.3
40
+ version: 0.9.4
41
41
  - !ruby/object:Gem::Dependency
42
42
  name: json
43
43
  requirement: !ruby/object:Gem::Requirement
@@ -102,11 +102,11 @@ files:
102
102
  - lib/lenddo/authentication.rb
103
103
  - lib/lenddo/configuration.rb
104
104
  - lib/lenddo/errors/configuration.rb
105
+ - lib/lenddo/network_service/self.rb
106
+ - lib/lenddo/score_service/self.rb
105
107
  - lib/lenddo/service_client.rb
106
- - lib/lenddo/service_client/score_service.rb
107
108
  - lib/lenddo/version.rb
108
109
  - lib/lenddo/white_label_client.rb
109
- - lib/lenddo/white_label_client/network_service.rb
110
110
  homepage: https://www.lenddo.com
111
111
  licenses: []
112
112
  metadata: {}
@@ -126,7 +126,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
126
126
  version: '0'
127
127
  requirements: []
128
128
  rubyforge_project:
129
- rubygems_version: 2.6.7
129
+ rubygems_version: 2.5.2
130
130
  signing_key:
131
131
  specification_version: 4
132
132
  summary: Lenddo's REST based services
@@ -1,53 +0,0 @@
1
- module Lenddo
2
- module ServiceClient
3
- class ScoreService
4
- def application_score(application_id, partnerscript_id)
5
- response = signed_request(
6
- method: "GET",
7
- host: Lenddo.configuration.score_service,
8
- path: "/ClientScore/#{application_id}",
9
- params: {
10
- partner_script_id: partnerscript_id
11
- }
12
- )
13
- JSON.parse(response.body)
14
- end
15
-
16
- def application_multiple_scores(application_id, partnerscript_id)
17
- response = signed_request(
18
- method: "GET",
19
- host: Lenddo.configuration.score_service,
20
- path: "/ApplicationMultipleScores/#{application_id}",
21
- params: {
22
- partner_script_id: partnerscript_id
23
- }
24
- )
25
- JSON.parse(response.body)
26
- end
27
-
28
- def application_verification(application_id, partnerscript_id)
29
- response = signed_request(
30
- method: "GET",
31
- host: Lenddo.configuration.score_service,
32
- path: "/ClientVerification/#{application_id}",
33
- params: {
34
- partner_script_id: partnerscript_id
35
- }
36
- )
37
- JSON.parse(response.body)
38
- end
39
-
40
- def application_decision(application_id, partnerscript_id)
41
- response = signed_request(
42
- method: "GET",
43
- host: Lenddo.configuration.score_service,
44
- path: "/ApplicationDecision/#{application_id}",
45
- params: {
46
- partner_script_id: partnerscript_id
47
- }
48
- )
49
- JSON.parse(response.body)
50
- end
51
- end
52
- end
53
- end
@@ -1,51 +0,0 @@
1
- module Lenddo
2
- module WhiteLabelClient
3
- class NetworkService
4
- def extra_application_data(application_id, partnerscript_id, extra_data)
5
- response = signed_request(
6
- method: "POST",
7
- host: Lenddo.configuration.network_service,
8
- path: "/ExtraApplicationData",
9
- params: {
10
- application_id: application_id,
11
- partner_script_id: partnerscript_id,
12
- extra_data: extra_data
13
- }.to_json
14
- )
15
- JSON.parse(response.body)
16
- end
17
-
18
- def partner_token(application_id, provider, token_data, oauth_key, oauth_secret)
19
- response = signed_request(
20
- method: "POST",
21
- host: Lenddo.configuration.network_service,
22
- path: "/PartnerToken",
23
- params: {
24
- token_data: {
25
- key: oauth_key,
26
- secret: oauth_secret
27
- }.merge!(token_data),
28
- provider: provider,
29
- client_id: application_id
30
- }.to_json
31
- )
32
- JSON.parse(response.body)
33
- end
34
-
35
- def commit_partner_job(partnerscript_id, application_id, profile_ids, verification)
36
- response = signed_request(
37
- method: "POST",
38
- host: Lenddo.configuration.network_service,
39
- path: "/CommitPartnerJob",
40
- params: {
41
- client_id: application_id,
42
- profile_ids: profile_ids,
43
- partner_script_id: partnerscript_id,
44
- verification_data: verification
45
- }.to_json
46
- )
47
- JSON.parse(response.body)
48
- end
49
- end
50
- end
51
- end