instant_quote 1.6.2 → 1.7.3
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/Gemfile.lock +3 -3
- data/lib/instant_quote/adapter.rb +9 -9
- data/lib/instant_quote/adapter_finder.rb +1 -1
- data/lib/instant_quote/adapters/capital_on_tap.rb +2 -2
- data/lib/instant_quote/adapters/iwoca.rb +3 -3
- data/lib/instant_quote/adapters/optimum.rb +2 -2
- data/lib/instant_quote/adapters/youlend.rb +2 -2
- data/lib/instant_quote/decision_parsers/youlend.rb +16 -4
- data/lib/instant_quote/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: f9a1202f635271c79343dd62421fb3b5e25c070fb6c9946e4a6b576a7924edc3
|
4
|
+
data.tar.gz: 39d9952984651ed93a4fed738be8bafbebe0529a3c271eaa349a8c744eae30de
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: a637cffbc3e704ea920c76bc8ef4a0beccfde26dee3380537f4e19aee9df8c385e90db683d950f1e82751622a13e6bb98eb742614299e9a6e6f8ae079b694aae
|
7
|
+
data.tar.gz: 6db6c7751b03f95e2ff1045e5cf8c309490d9d169fd472cb665b6a549659b19e4f59e1981f8ff1be2469b67108698ec240ff1241db977cd02ed8c59daa15063d
|
data/Gemfile.lock
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
PATH
|
2
2
|
remote: .
|
3
3
|
specs:
|
4
|
-
instant_quote (1.
|
4
|
+
instant_quote (1.7.3)
|
5
5
|
activesupport
|
6
6
|
capital_on_tap
|
7
7
|
iwoca
|
@@ -13,7 +13,7 @@ PATH
|
|
13
13
|
GEM
|
14
14
|
remote: https://rubygems.org/
|
15
15
|
specs:
|
16
|
-
activesupport (6.1.
|
16
|
+
activesupport (6.1.3)
|
17
17
|
concurrent-ruby (~> 1.0, >= 1.0.2)
|
18
18
|
i18n (>= 1.6, < 2)
|
19
19
|
minitest (>= 5.1)
|
@@ -44,7 +44,7 @@ GEM
|
|
44
44
|
faraday_middleware (1.0.0)
|
45
45
|
faraday (~> 1.0)
|
46
46
|
hashdiff (1.0.1)
|
47
|
-
i18n (1.8.
|
47
|
+
i18n (1.8.9)
|
48
48
|
concurrent-ruby (~> 1.0)
|
49
49
|
iwoca (1.0.0)
|
50
50
|
addressable
|
@@ -23,41 +23,41 @@ module InstantQuote
|
|
23
23
|
new.get_link(connection)
|
24
24
|
end
|
25
25
|
|
26
|
-
def self.get_quote(params, connection
|
26
|
+
def self.get_quote(params, connection)
|
27
27
|
new.get_quote(params, connection)
|
28
28
|
end
|
29
29
|
|
30
|
-
def self.get_status(application_id, connection
|
30
|
+
def self.get_status(application_id, connection)
|
31
31
|
new.get_status(application_id, connection)
|
32
32
|
end
|
33
33
|
|
34
|
-
def self.get_preapproval(params, connection
|
34
|
+
def self.get_preapproval(params, connection)
|
35
35
|
new.get_preapproval(params, connection)
|
36
36
|
end
|
37
37
|
|
38
|
-
def self.get_approval(application_id, connection
|
38
|
+
def self.get_approval(application_id, connection)
|
39
39
|
new.get_approval(application_id, connection)
|
40
40
|
end
|
41
41
|
|
42
|
-
def get_link(
|
42
|
+
def get_link(_connection)
|
43
43
|
raise NotImplementedError, "You must implement '#{self.class.name}#get_link'"
|
44
44
|
end
|
45
45
|
|
46
|
-
def get_quote(_params, _connection
|
46
|
+
def get_quote(_params, _connection)
|
47
47
|
raise NotImplementedError, "You must implement '#{self.class.name}#get_quote'"
|
48
48
|
end
|
49
49
|
|
50
|
-
def get_status(_application_id, _connection
|
50
|
+
def get_status(_application_id, _connection)
|
51
51
|
raise NotImplementedError, "You must implement '#{self.class.name}#get_status'"
|
52
52
|
end
|
53
53
|
|
54
54
|
# Default for pre approval will be true, override it in the adapter class if needed.
|
55
|
-
def get_preapproval(_params, _connection
|
55
|
+
def get_preapproval(_params, _connection)
|
56
56
|
true
|
57
57
|
end
|
58
58
|
|
59
59
|
# Default for approval will be true, override it in the adapter class if needed.
|
60
|
-
def get_approval(_application_id, _connection
|
60
|
+
def get_approval(_application_id, _connection)
|
61
61
|
true
|
62
62
|
end
|
63
63
|
end
|
@@ -70,7 +70,7 @@ module InstantQuote
|
|
70
70
|
# rubocop:enable Layout/LineLength
|
71
71
|
|
72
72
|
# Creates the quote with the information from instant connection
|
73
|
-
def get_quote(params)
|
73
|
+
def get_quote(params, _connection)
|
74
74
|
response = ::CapitalOnTap::Application.create(params)
|
75
75
|
|
76
76
|
# CoT responses can be 200 OK but still have an error!
|
@@ -94,7 +94,7 @@ module InstantQuote
|
|
94
94
|
# :links=>{:self=>'/api/v1/Applications/B247T62', :parent=>nil},
|
95
95
|
# :metaData=>{}
|
96
96
|
# }
|
97
|
-
def get_status(application_id)
|
97
|
+
def get_status(application_id, _connection)
|
98
98
|
response = ::CapitalOnTap::Application.status(application_id)
|
99
99
|
|
100
100
|
raise_error(response) unless response.success?
|
@@ -58,7 +58,7 @@ module InstantQuote
|
|
58
58
|
]
|
59
59
|
|
60
60
|
# Creates the iwoca customer and returns the state key from the response.
|
61
|
-
def get_quote(params)
|
61
|
+
def get_quote(params, _connection)
|
62
62
|
response = ::Iwoca::Quote.create_customer(params)
|
63
63
|
|
64
64
|
return response.data[:state_key] if response.success?
|
@@ -67,7 +67,7 @@ module InstantQuote
|
|
67
67
|
end
|
68
68
|
|
69
69
|
# Get the current status for the created customer.
|
70
|
-
def get_status(state_key)
|
70
|
+
def get_status(state_key, _connection)
|
71
71
|
response = ::Iwoca::Quote.credit_facility_status(state_key)
|
72
72
|
|
73
73
|
raise_error(response) unless response.success?
|
@@ -86,7 +86,7 @@ module InstantQuote
|
|
86
86
|
raise_error(response)
|
87
87
|
end
|
88
88
|
|
89
|
-
def get_approval(state_key)
|
89
|
+
def get_approval(state_key, _connection)
|
90
90
|
response = ::Iwoca::Quote.approval(state_key)
|
91
91
|
response.success?
|
92
92
|
end
|
@@ -96,7 +96,7 @@ module InstantQuote
|
|
96
96
|
}
|
97
97
|
]
|
98
98
|
|
99
|
-
def get_quote(params)
|
99
|
+
def get_quote(params, _connection)
|
100
100
|
response = ::Optimum::Decision.create(params)
|
101
101
|
|
102
102
|
return response.data[:opportunityId] if response.success?
|
@@ -104,7 +104,7 @@ module InstantQuote
|
|
104
104
|
raise_error(response)
|
105
105
|
end
|
106
106
|
|
107
|
-
def get_status(application_id)
|
107
|
+
def get_status(application_id, _connection)
|
108
108
|
response = ::Optimum::Decision.update(application_id)
|
109
109
|
|
110
110
|
raise_error(response) unless response.success?
|
@@ -9,7 +9,7 @@ module InstantQuote
|
|
9
9
|
additional_fields [
|
10
10
|
{
|
11
11
|
name: 'monthly_card_revenue',
|
12
|
-
label: 'Avg. monthly
|
12
|
+
label: 'Avg. monthly card revenue',
|
13
13
|
required: true,
|
14
14
|
type: 'money'
|
15
15
|
},
|
@@ -21,7 +21,7 @@ module InstantQuote
|
|
21
21
|
},
|
22
22
|
{
|
23
23
|
name: 'applicant_consent',
|
24
|
-
label: 'Yes, I give my consent for my data to be shared',
|
24
|
+
label: 'Yes, I give my consent for my data to be shared with YouLend',
|
25
25
|
required: true,
|
26
26
|
type: 'checkbox'
|
27
27
|
}
|
@@ -18,18 +18,24 @@ module InstantQuote
|
|
18
18
|
# }
|
19
19
|
class Youlend < DecisionParser
|
20
20
|
def approved?
|
21
|
-
status_hash[:loanOptions].any?
|
21
|
+
status_hash[:loanOptions].any? && first_option
|
22
22
|
end
|
23
23
|
|
24
24
|
def declined?
|
25
|
-
|
25
|
+
!approved?
|
26
26
|
end
|
27
27
|
|
28
28
|
def sweep
|
29
|
-
first_option[:
|
29
|
+
first_option[:sweep]
|
30
|
+
end
|
31
|
+
|
32
|
+
def status
|
33
|
+
approved? ? 'approved' : 'declined'
|
30
34
|
end
|
31
35
|
|
32
36
|
def fee
|
37
|
+
return 0.0 unless first_option
|
38
|
+
|
33
39
|
fee = first_option[:fee].to_f
|
34
40
|
|
35
41
|
Money.new(fee * 100).format
|
@@ -47,6 +53,8 @@ module InstantQuote
|
|
47
53
|
Money.new(amount * 100).format
|
48
54
|
end
|
49
55
|
|
56
|
+
alias amount funded_amount
|
57
|
+
|
50
58
|
private
|
51
59
|
|
52
60
|
def first_option
|
@@ -54,7 +62,11 @@ module InstantQuote
|
|
54
62
|
end
|
55
63
|
|
56
64
|
def status_hash
|
57
|
-
|
65
|
+
default = { loanOptions: [] }
|
66
|
+
|
67
|
+
return default unless data && !data.empty?
|
68
|
+
|
69
|
+
data
|
58
70
|
end
|
59
71
|
end
|
60
72
|
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: instant_quote
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.
|
4
|
+
version: 1.7.3
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- rikas
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2021-02-
|
11
|
+
date: 2021-02-20 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|