instant_quote 1.7.12 → 1.7.15

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 88caccebb747d80f197829c25840cce9b4054997d369f40ab65289ed9a0c3087
4
- data.tar.gz: fd170005234dee4fe283b54d11fda513266aa3e72fb887fbb1ff6abb01f162ec
3
+ metadata.gz: b1b05b02c1df2b97fce31987bfe3da27ed8d7841c076c91a1069fbcbe481e8c3
4
+ data.tar.gz: 7ef4d600af1809fe432efed7dd47e65930542aff5e8f56eb714e287c15a780d3
5
5
  SHA512:
6
- metadata.gz: 05db08e6e683a3a72a4a2956a39b6a12cc6b1da15fab7bf4b9e75af8ff40683790cee177139f30270b1eb51563a24f6c7ea3492e4c3484491285625a4823acf6
7
- data.tar.gz: f2882bcbea35d55f7ebaf2523ec42f26d275c762e344ccb6adda3ac7410966acad8bc65f4333c62ecf3e0cf4b978a8ff35469364035666e7742247d8e8961930
6
+ metadata.gz: dad097b417294de34157be0fa948c0c764b8803f92355f20638bfda15226956cf378ddd21c8699ee35c987149dd95cfdbb27d9be00cdd3b1371a36473d6e43b9
7
+ data.tar.gz: e8a410b995f7b3a3e98003e2fc4e6570c6d324688e14218b9f551099e0f1ae75a3a405cb93ec9a01121de1c05baf59e4352e4a165bc35d4acf188d20ddbb32e8
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- instant_quote (1.7.12)
4
+ instant_quote (1.7.15)
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.3.2)
16
+ activesupport (6.1.5)
17
17
  concurrent-ruby (~> 1.0, >= 1.0.2)
18
18
  i18n (>= 1.6, < 2)
19
19
  minitest (>= 5.1)
@@ -36,23 +36,33 @@ GEM
36
36
  diff-lcs (1.4.4)
37
37
  docile (1.3.5)
38
38
  dotenv (2.7.6)
39
- faraday (1.4.2)
39
+ faraday (1.10.0)
40
40
  faraday-em_http (~> 1.0)
41
41
  faraday-em_synchrony (~> 1.0)
42
42
  faraday-excon (~> 1.1)
43
+ faraday-httpclient (~> 1.0)
44
+ faraday-multipart (~> 1.0)
43
45
  faraday-net_http (~> 1.0)
44
- faraday-net_http_persistent (~> 1.1)
45
- multipart-post (>= 1.2, < 3)
46
+ faraday-net_http_persistent (~> 1.0)
47
+ faraday-patron (~> 1.0)
48
+ faraday-rack (~> 1.0)
49
+ faraday-retry (~> 1.0)
46
50
  ruby2_keywords (>= 0.0.4)
47
51
  faraday-em_http (1.0.0)
48
52
  faraday-em_synchrony (1.0.0)
49
53
  faraday-excon (1.1.0)
54
+ faraday-httpclient (1.0.1)
55
+ faraday-multipart (1.0.3)
56
+ multipart-post (>= 1.2, < 3)
50
57
  faraday-net_http (1.0.1)
51
- faraday-net_http_persistent (1.1.0)
52
- faraday_middleware (1.0.0)
58
+ faraday-net_http_persistent (1.2.0)
59
+ faraday-patron (1.0.0)
60
+ faraday-rack (1.0.0)
61
+ faraday-retry (1.0.3)
62
+ faraday_middleware (1.2.0)
53
63
  faraday (~> 1.0)
54
64
  hashdiff (1.0.1)
55
- i18n (1.8.10)
65
+ i18n (1.10.0)
56
66
  concurrent-ruby (~> 1.0)
57
67
  iwoca (1.0.0)
58
68
  addressable
@@ -61,7 +71,7 @@ GEM
61
71
  multi_json
62
72
  rainbow
63
73
  method_source (1.0.0)
64
- minitest (5.14.4)
74
+ minitest (5.15.0)
65
75
  money (6.16.0)
66
76
  i18n (>= 0.6.4, <= 2)
67
77
  multi_json (1.15.0)
@@ -75,7 +85,7 @@ GEM
75
85
  parallel (1.20.1)
76
86
  parser (3.0.0.0)
77
87
  ast (~> 2.4.1)
78
- phonelib (0.6.50)
88
+ phonelib (0.6.57)
79
89
  pry (0.13.1)
80
90
  coderay (~> 1.1)
81
91
  method_source (~> 1.0)
@@ -117,7 +127,7 @@ GEM
117
127
  rubocop (~> 1.0)
118
128
  rubocop-ast (>= 1.1.0)
119
129
  ruby-progressbar (1.11.0)
120
- ruby2_keywords (0.0.4)
130
+ ruby2_keywords (0.0.5)
121
131
  simplecov (0.21.2)
122
132
  docile (~> 1.1)
123
133
  simplecov-html (~> 0.11)
@@ -137,7 +147,7 @@ GEM
137
147
  faraday_middleware
138
148
  multi_json
139
149
  rainbow
140
- zeitwerk (2.4.2)
150
+ zeitwerk (2.5.4)
141
151
 
142
152
  PLATFORMS
143
153
  ruby
@@ -4,7 +4,7 @@ module InstantQuote
4
4
  class Adapter
5
5
  # This is one additional field that we always want to ask, since we're using it for phone
6
6
  # validating the applicant.
7
- DEFAULT_ADDIONAL_FIELDS = [
7
+ DEFAULT_ADDITIONAL_FIELDS = [
8
8
  {
9
9
  name: 'applicant_phone_number',
10
10
  label: 'Applicant mobile phone',
@@ -13,10 +13,11 @@ module InstantQuote
13
13
  ].freeze
14
14
 
15
15
  def self.additional_fields(fields = [])
16
- return (@additional_fields || DEFAULT_ADDIONAL_FIELDS) if fields.empty?
16
+ return (@additional_fields || DEFAULT_ADDITIONAL_FIELDS) if fields.empty?
17
17
 
18
- @additional_fields ||= DEFAULT_ADDIONAL_FIELDS
18
+ @additional_fields ||= DEFAULT_ADDITIONAL_FIELDS
19
19
  @additional_fields += fields
20
+ @additional_fields.uniq! { |f| f[:name] }
20
21
  end
21
22
 
22
23
  def self.get_link(connection)
@@ -34,6 +34,8 @@ module InstantQuote
34
34
  choices: {
35
35
  'Iwoca' => 'iwoca',
36
36
  'Iwoca CBILS' => 'iwoca_cbils',
37
+ 'Iwoca Recovery Loans' => 'iwoca_recovery_loans',
38
+ 'Iwoca Revenue Based Loans' => 'iwoca_revenue_based_loans',
37
39
  'Capital on tap' => 'capital_on_tap',
38
40
  'Optimum' => 'optimum',
39
41
  'Youlend' => 'youlend'
@@ -0,0 +1,26 @@
1
+ # frozen_string_literal: true
2
+
3
+ require 'iwoca'
4
+ require 'instant_quote/adapters/iwoca'
5
+ require 'instant_quote/decision_parsers/iwoca_recovery_loans'
6
+
7
+ module InstantQuote
8
+ module Adapters
9
+ class IwocaRecoveryLoans < Iwoca
10
+ additional_fields Iwoca.additional_fields
11
+
12
+ # As a result of this we are
13
+ # asking that you do not call the /approval_request/ endpoint after submitting
14
+ # your customer's data to /state/.
15
+ def get_approval(_state_key, _connection)
16
+ true
17
+ end
18
+
19
+ private
20
+
21
+ def decision_parser
22
+ DecisionParsers::IwocaRecoveryLoans
23
+ end
24
+ end
25
+ end
26
+ end
@@ -0,0 +1,26 @@
1
+ # frozen_string_literal: true
2
+
3
+ require 'iwoca'
4
+ require 'instant_quote/adapters/iwoca'
5
+ require 'instant_quote/decision_parsers/iwoca_revenue_based_loans'
6
+
7
+ module InstantQuote
8
+ module Adapters
9
+ class IwocaRevenueBasedLoans < Iwoca
10
+ additional_fields Iwoca.additional_fields
11
+
12
+ # As a result of this we are
13
+ # asking that you do not call the /approval_request/ endpoint after submitting
14
+ # your customer's data to /state/.
15
+ def get_approval(_state_key, _connection)
16
+ true
17
+ end
18
+
19
+ private
20
+
21
+ def decision_parser
22
+ DecisionParsers::IwocaRevenueBasedLoans
23
+ end
24
+ end
25
+ end
26
+ end
@@ -13,7 +13,7 @@ module InstantQuote
13
13
  product_name => {
14
14
  approval: {
15
15
  amount: (application.amount_pennies / 100),
16
- duration: 12,
16
+ duration: duration,
17
17
  detailed_purpose: application&.proceeds_purpose&.name
18
18
  }
19
19
  }
@@ -29,6 +29,10 @@ module InstantQuote
29
29
  :credit_facility
30
30
  end
31
31
 
32
+ def duration
33
+ 12
34
+ end
35
+
32
36
  # rubocop:disable Metrics/AbcSize
33
37
  def company_information
34
38
  information = {
@@ -0,0 +1,19 @@
1
+ # frozen_string_literal: true
2
+
3
+ require 'instant_quote/connection_translators/iwoca'
4
+
5
+ module InstantQuote
6
+ module ConnectionTranslators
7
+ class IwocaRecoveryLoans < Iwoca
8
+ private
9
+
10
+ def product_name
11
+ :recovery_loan
12
+ end
13
+
14
+ def duration
15
+ 60
16
+ end
17
+ end
18
+ end
19
+ end
@@ -0,0 +1,19 @@
1
+ # frozen_string_literal: true
2
+
3
+ require 'instant_quote/connection_translators/iwoca'
4
+
5
+ module InstantQuote
6
+ module ConnectionTranslators
7
+ class IwocaRevenueBasedLoans < Iwoca
8
+ private
9
+
10
+ def product_name
11
+ :merchant_cash_advance
12
+ end
13
+
14
+ def duration
15
+ 24
16
+ end
17
+ end
18
+ end
19
+ end
@@ -0,0 +1,10 @@
1
+ # frozen_string_literal: true
2
+
3
+ require 'instant_quote/decision_parsers/iwoca'
4
+
5
+ module InstantQuote
6
+ module DecisionParsers
7
+ class IwocaRecoveryLoans < Iwoca
8
+ end
9
+ end
10
+ end
@@ -0,0 +1,10 @@
1
+ # frozen_string_literal: true
2
+
3
+ require 'instant_quote/decision_parsers/iwoca'
4
+
5
+ module InstantQuote
6
+ module DecisionParsers
7
+ class IwocaRevenueBasedLoans < Iwoca
8
+ end
9
+ end
10
+ end
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module InstantQuote
4
- VERSION = '1.7.12'
4
+ VERSION = '1.7.15'
5
5
  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.7.12
4
+ version: 1.7.15
5
5
  platform: ruby
6
6
  authors:
7
7
  - rikas
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2021-06-07 00:00:00.000000000 Z
11
+ date: 2022-03-11 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler
@@ -274,6 +274,8 @@ files:
274
274
  - lib/instant_quote/adapters/fake.rb
275
275
  - lib/instant_quote/adapters/iwoca.rb
276
276
  - lib/instant_quote/adapters/iwoca_cbils.rb
277
+ - lib/instant_quote/adapters/iwoca_recovery_loans.rb
278
+ - lib/instant_quote/adapters/iwoca_revenue_based_loans.rb
277
279
  - lib/instant_quote/adapters/optimum.rb
278
280
  - lib/instant_quote/adapters/youlend.rb
279
281
  - lib/instant_quote/api_error.rb
@@ -282,6 +284,8 @@ files:
282
284
  - lib/instant_quote/connection_translators/fake.rb
283
285
  - lib/instant_quote/connection_translators/iwoca.rb
284
286
  - lib/instant_quote/connection_translators/iwoca_cbils.rb
287
+ - lib/instant_quote/connection_translators/iwoca_recovery_loans.rb
288
+ - lib/instant_quote/connection_translators/iwoca_revenue_based_loans.rb
285
289
  - lib/instant_quote/connection_translators/optimum.rb
286
290
  - lib/instant_quote/connection_translators/youlend.rb
287
291
  - lib/instant_quote/decision_parser.rb
@@ -289,6 +293,8 @@ files:
289
293
  - lib/instant_quote/decision_parsers/fake.rb
290
294
  - lib/instant_quote/decision_parsers/iwoca.rb
291
295
  - lib/instant_quote/decision_parsers/iwoca_cbils.rb
296
+ - lib/instant_quote/decision_parsers/iwoca_recovery_loans.rb
297
+ - lib/instant_quote/decision_parsers/iwoca_revenue_based_loans.rb
292
298
  - lib/instant_quote/decision_parsers/optimum.rb
293
299
  - lib/instant_quote/decision_parsers/youlend.rb
294
300
  - lib/instant_quote/version.rb