youlend 1.1.1 → 1.1.2

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: 753df522751bc4e37f063c0465712af287e0fbaeed9c0acff47f5aa32c4d0afe
4
- data.tar.gz: 2887079f70a94f202c181420f91fa488f052e09d91dba221f7eaa2154772e577
3
+ metadata.gz: 6c272f6f9bceb7ac698b4244aba6ff5b74718fa740e0d761f47b029c6862b34f
4
+ data.tar.gz: b161a2c0d8603d525176b433fd32f9c64656ad3d778a81c1445c2a8ccf807bdb
5
5
  SHA512:
6
- metadata.gz: 4cb5cd6c2ed7586afd475ca38394d4a4c7d0e74f2ccc4d29dcce5891a57cd88e9474824718de02a4620ee32e6019b5550678b6723b3c7936d14ba2c2287b6f48
7
- data.tar.gz: f20ec73ba109a0c15ea17d2004a760b60635ae7f4e8e63161a50ca074cfbeb5a1753e65dcdd39be251c32d0ee719553a1cbb2d6f61f5ef9489dff8b7fb21ed94
6
+ metadata.gz: 9f8ea959082e0510b50235dfd2dc5e4037d600b330153a75e7ba66e60193d826a7acb162697683050235d8ffcabd75f70496190b1e21a24331ac4c5180d622b3
7
+ data.tar.gz: 2b89bc6e6e7823b6d3ed5931038b32294f5827fb4adaee262d1f743bfd24c8bf8da4d1a062f6807503638cab3ae4029778edebf186b5d707a89fac14d6bbb5d3
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- youlend (1.1.1)
4
+ youlend (1.1.2)
5
5
  addressable
6
6
  faraday
7
7
  faraday_middleware
@@ -5,6 +5,11 @@ module Youlend
5
5
  attr_accessor :tokens, :client_id, :client_secret, :env
6
6
  attr_writer :debug
7
7
 
8
+ DOMAINS = {
9
+ production: 'https://youlend.com',
10
+ development: 'https://staging.youlend.com'
11
+ }.freeze
12
+
8
13
  API_DOMAINS = {
9
14
  production: 'https://youlendapi.com',
10
15
  development: 'https://staging.youlendapi.com'
@@ -13,7 +18,7 @@ module Youlend
13
18
  def initialize
14
19
  @tokens = { onboarding: '', prequalification: '' }
15
20
  @webhook_signature = ''
16
- @env = defined?(::Rails) ? ::Rails.env : :development
21
+ @env = defined?(::Rails) ? ::Rails.env.to_sym : :development
17
22
  @debug = false
18
23
  end
19
24
 
@@ -24,5 +29,9 @@ module Youlend
24
29
  def api_domain
25
30
  API_DOMAINS[@env.to_sym] || API_DOMAINS[:development]
26
31
  end
32
+
33
+ def domain
34
+ DOMAINS[@env.to_sym] || DOMAINS[:development]
35
+ end
27
36
  end
28
37
  end
@@ -40,6 +40,14 @@ module Youlend
40
40
  Response.new(http_response)
41
41
  end
42
42
 
43
+ def get(path, audience)
44
+ http_response = with_token_refresh(audience) do
45
+ adapter(audience).get(PathSanitizer.sanitize(path))
46
+ end
47
+
48
+ Response.new(http_response)
49
+ end
50
+
43
51
  private
44
52
 
45
53
  def log(text)
data/lib/youlend/lead.rb CHANGED
@@ -17,7 +17,14 @@ module Youlend
17
17
  end
18
18
 
19
19
  def self.details(lead_id)
20
- Youlend.connection.get("/onboarding/Leads/#{lead_id}/details", :onboarding)
20
+ Youlend.connection.get("/onboarding/Leads/#{lead_id}", :onboarding)
21
+ end
22
+
23
+ def self.onboard_link(lead_id, email_address)
24
+ domain = Youlend.configuration.domain
25
+
26
+ url = Addressable::Template.new("#{domain}/dashboard/youlendapisignup{?query*}")
27
+ url.expand(query: { emailAddress: email_address, leadId: lead_id}).to_s
21
28
  end
22
29
  end
23
30
  end
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Youlend
4
- VERSION = '1.1.1'
4
+ VERSION = '1.1.2'
5
5
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: youlend
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.1.1
4
+ version: 1.1.2
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-04 00:00:00.000000000 Z
11
+ date: 2021-02-05 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: addressable