currency_cloud 0.7 → 0.7.1
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 +4 -4
- data/README.md +2 -2
- data/lib/currency_cloud/request_handler.rb +1 -1
- data/lib/currency_cloud/session.rb +2 -2
- data/lib/currency_cloud/version.rb +1 -1
- data/spec/integration/authentication_spec.rb +3 -0
- metadata +3 -3
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA1:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 05d3528f511962b03532b5118e6aa1f12e93dee1
|
|
4
|
+
data.tar.gz: 90e96cf501b438ca7f3c93f4b20ee4ba0ac5a16c
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 8fada2f9e4281e22a143fbe0339f3b0d9379fc18195ac189524c3ea5ddd1ace4709601cb492174e0f6a19f39f902e0a640b50e684296ad2992e4845280cf3331
|
|
7
|
+
data.tar.gz: e2a7fd923bc03e71561a4e70efa055e1aac5226045d6ca1fd51091d7fa7b2cf56337ea5a43cd1da7ee66498c7cb6b0933bcffda41f3907dc0357f1d0485c0f66
|
data/README.md
CHANGED
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
# Currency Cloud
|
|
4
4
|
|
|
5
5
|
This is the official Ruby SDK for v2 of Currency Cloud's API. Additional documentation
|
|
6
|
-
for each API endpoint can be found at [connect.currencycloud.com][connect]
|
|
6
|
+
for each API endpoint can be found at [connect.currencycloud.com][connect]. If you have any queries or you require support, please contact our implementation team at implementation@currencycloud.com.
|
|
7
7
|
|
|
8
8
|
## Installation
|
|
9
9
|
|
|
@@ -150,4 +150,4 @@ Copyright (c) 2015 Currency Cloud. See [LICENSE][license] for details.
|
|
|
150
150
|
[httparty]: https://github.com/jnunemaker/httparty
|
|
151
151
|
[json]: https://github.com/intridea/multi_json
|
|
152
152
|
[semver]: http://semver.org/
|
|
153
|
-
[license]: LICENSE.md
|
|
153
|
+
[license]: LICENSE.md
|
|
@@ -27,12 +27,12 @@ module CurrencyCloud
|
|
|
27
27
|
should_retry = opts[:should_retry].nil? ? true : opts.delete(:should_retry)
|
|
28
28
|
|
|
29
29
|
params = process_params(params)
|
|
30
|
-
options = process_options(verb, opts)
|
|
31
30
|
full_url = build_url(route)
|
|
32
31
|
|
|
33
32
|
response = nil
|
|
34
33
|
retry_count = should_retry ? 0 : 2
|
|
35
34
|
while retry_count < 3
|
|
35
|
+
options = process_options(verb, opts)
|
|
36
36
|
response = yield(full_url, params, options)
|
|
37
37
|
break unless response.code == 401 && should_retry
|
|
38
38
|
session.reauthenticate
|
|
@@ -40,11 +40,11 @@ module CurrencyCloud
|
|
|
40
40
|
def authenticate
|
|
41
41
|
validate
|
|
42
42
|
params = {:login_id => login_id, :api_key => api_key}
|
|
43
|
-
@token = request.post('authenticate/api', params, :should_retry => false)['auth_token']
|
|
43
|
+
CurrencyCloud.token = @token = request.post('authenticate/api', params, :should_retry => false)['auth_token']
|
|
44
44
|
end
|
|
45
45
|
|
|
46
46
|
def reauthenticate
|
|
47
|
-
token = nil
|
|
47
|
+
CurrencyCloud.token = @token = nil
|
|
48
48
|
authenticate
|
|
49
49
|
end
|
|
50
50
|
|
|
@@ -33,5 +33,8 @@ describe 'Authentication', :vcr => true do
|
|
|
33
33
|
|
|
34
34
|
response = CurrencyCloud::Beneficiary.find
|
|
35
35
|
expect(response).to_not be_nil
|
|
36
|
+
|
|
37
|
+
#should have changed after reauthentication
|
|
38
|
+
expect(CurrencyCloud.token).to eq('038022bcd2f372cac7bab448db7b5c3b')
|
|
36
39
|
end
|
|
37
40
|
end
|
metadata
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: currency_cloud
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version:
|
|
4
|
+
version: 0.7.1
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- Liam McAndrew
|
|
@@ -9,7 +9,7 @@ authors:
|
|
|
9
9
|
autorequire:
|
|
10
10
|
bindir: bin
|
|
11
11
|
cert_chain: []
|
|
12
|
-
date: 2015-
|
|
12
|
+
date: 2015-06-30 00:00:00.000000000 Z
|
|
13
13
|
dependencies:
|
|
14
14
|
- !ruby/object:Gem::Dependency
|
|
15
15
|
name: httparty
|
|
@@ -204,7 +204,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
|
204
204
|
version: '0'
|
|
205
205
|
requirements: []
|
|
206
206
|
rubyforge_project:
|
|
207
|
-
rubygems_version: 2.4.
|
|
207
|
+
rubygems_version: 2.4.6
|
|
208
208
|
signing_key:
|
|
209
209
|
specification_version: 4
|
|
210
210
|
summary: Ruby SDK for the Currency Cloud API
|