transferwise 0.2.1 → 0.2.2

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: b02b49aa7d241e4ba86ad56ffce5716ff084bf23
4
- data.tar.gz: fba62012647b5b077fddaf5606a434a37fdabb11
3
+ metadata.gz: ab064fb21125ffbf947f8ea73060265c335fe089
4
+ data.tar.gz: c25dc8712bd5a14f0971c884fe46d372a7d0027b
5
5
  SHA512:
6
- metadata.gz: 051bfc3e2dcba85abe8b8e7bd2498a275307658c032e4ca9a0bb40c8cf8c53430468220c59de1c6d30d820d9747e6264b9c217200bb63d303739b62ae59dbddb
7
- data.tar.gz: 8732d089498a9ca5f94561cc156cca5a02a5d7d180fe897b93c8df366c38919fba28bfacede288bec43d91a079817b5c999d48652a3d7ea76374021d3efd93f5
6
+ metadata.gz: 8a76cfca3728b41b7c8689f0895f515facfdb3df2e8631aa5b7059d699d22d2a9e33735f668d45114d639738275d784c56b7a4d9fe2fc71e09b569d00b658687
7
+ data.tar.gz: 9af83e425156e4ced88cc2ba8344b2555e7d628c366eaeb893659e81d40237a2b1036ff1dff6b8174e5f32c7c7ac0f01d814ee94d4fdeb9b66e3e30febe9afa7
data/lib/transferwise.rb CHANGED
@@ -38,5 +38,11 @@ module Transferwise
38
38
  test_url = 'https://api.sandbox.transferwise.tech'
39
39
  @api_base ||= mode == 'live' ? live_url : test_url
40
40
  end
41
+
42
+ def authorization_base
43
+ live_url = 'https://api.transferwise.com'
44
+ test_url = 'https://sandbox.transferwise.tech'
45
+ @authorization_base ||= mode == 'live' ? live_url : test_url
46
+ end
41
47
  end
42
48
  end
@@ -16,11 +16,21 @@ module Transferwise
16
16
  }
17
17
  )
18
18
  end
19
+
20
+ def authorize_client
21
+ @authorize_client ||= ::OAuth2::Client.new(
22
+ @client_id,
23
+ @client_secret,
24
+ { site: TransferWise.authorization_base,
25
+ auth_scheme: :basic_auth
26
+ }
27
+ )
28
+ end
19
29
 
20
30
  # Get the url to redirect a user to, pass the redirect_url you want the user
21
31
  # to be redirected back to.
22
32
  def authorize_url(redirect_url)
23
- client.auth_code.authorize_url({redirect_uri: redirect_url})
33
+ authorize_client.auth_code.authorize_url({redirect_uri: redirect_url})
24
34
  end
25
35
 
26
36
  # Get the access token. You must pass the exact same redirect_url passed
@@ -1,3 +1,3 @@
1
1
  module Transferwise
2
- VERSION = "0.2.1"
2
+ VERSION = "0.2.2"
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: transferwise
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.1
4
+ version: 0.2.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Harshvardhan Parihar