telleroo 0.1.0 → 0.2.0

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
- SHA1:
3
- metadata.gz: e58a73456b50f8d6c1baa85d5d3908491edb20ef
4
- data.tar.gz: 3c67b94c2c312a133e542c032f63af145264187a
2
+ SHA256:
3
+ metadata.gz: 822e7df84cfa60455ed322f8f676ef9b7e9a23e1844da61b70bc5b15f6b45cc0
4
+ data.tar.gz: 0a29766d648b6326bf08a6fa202262514bd04afdcd0f9f98486e1ef3089eada0
5
5
  SHA512:
6
- metadata.gz: e36502edacc356742e3bdd7dec3bf479e070bb863c834a2a7a5441a9979962c5c38259617e6afb381de112959c0fd1f4099bff1843b3e2b429e885427b918789
7
- data.tar.gz: eadbe341d18c934bee16e03385055a9a93e0b4683c94a7b6fd137995dd9e16e64cb5f67a8c9291b1f8143f0a7e60478793d4030c4fbb7d5ac7816192937ec4bc
6
+ metadata.gz: c2ce25fecbe902c5dd30d8fadd3a2e9ce5f35e7c11309466ee492db7ecdcd1533447ec3243a46abb5ad77df46b4d7063e99b1d72d2d5ccd419a82df7fc397ae2
7
+ data.tar.gz: c0cd651ab2767fc1e9331bf7383375840e2a601d458875277ef413c8d168959e39b3700300510fbc8f3cafd7e601c800bd2dcff45ee9f824e4ec1a57d232ce01
data/README.md CHANGED
@@ -22,24 +22,32 @@ Or install it yourself as:
22
22
 
23
23
  `Telleroo::Client` can be configured from an initializer:
24
24
 
25
- ```
26
-
27
- Telleroo.configure do |config|
28
- config.authorization_token = "YOUR_AUTH_TOKEN"
29
- config.endpoint = 'https://sandbox.telleroo.com'
30
- end
31
-
25
+ ```ruby
26
+ Telleroo.configure do |config|
27
+ config.authorization_token = "YOUR_AUTH_TOKEN"
28
+ config.endpoint = 'https://sandbox.telleroo.com'
29
+ end
32
30
  ```
33
31
 
34
32
  or by passing an options block to `Telleroo::Client.new`
35
33
 
36
- ```
37
-
34
+ ```ruby
38
35
  client = Telleroo::Client.new do |config|
39
36
  config.authorization_token = "YOUR_AUTH_TOKEN"
40
37
  config.endpoint = 'https://sandbox.telleroo.com'
41
38
  end
39
+ ```
40
+
41
+ The `http_adapter` option can be used to set the underlying HTTP adapter for Faraday:
42
42
 
43
+ ```ruby
44
+ config.http_adapter = :typhoeus
45
+ ```
46
+
47
+ Use an array to pass further options to the HTTP adapter itself:
48
+
49
+ ```ruby
50
+ config.http_adapter = [:typhoeus, timeout_ms: 100]
43
51
  ```
44
52
 
45
53
  ## Usage
@@ -49,7 +57,8 @@ After configuring a `client`, the following calls are available to you:
49
57
  **List Accounts**
50
58
 
51
59
  Retrieves all bank accounts assigned to your company
52
- ```
60
+
61
+ ```ruby
53
62
  client.accounts()
54
63
 
55
64
  ```
@@ -57,7 +66,8 @@ client.accounts()
57
66
  **List Recipients**
58
67
 
59
68
  Retrieves all recipients under your company.
60
- ```
69
+
70
+ ```ruby
61
71
  client.recipients()
62
72
 
63
73
  ```
@@ -66,7 +76,7 @@ client.recipients()
66
76
 
67
77
  Retrieves a single recipient given a recipient_id.
68
78
 
69
- ```
79
+ ```ruby
70
80
  client.get_recipient("ff17b231-2bc4-485e-967e-231867e15fd6")
71
81
 
72
82
  ```
@@ -77,21 +87,22 @@ Creates a single recipient.
77
87
 
78
88
  Note: `GBP` Recipients require `account_no` and `sort_code` passed in `options` while `EUR` require `iban` and `bic`.
79
89
 
80
- ```
81
- client.create_recipient(name: 'Nick Lloyd',
82
- currency_code: 'GBP',
83
- options: {
84
- account_no: '72345678',
85
- sort_code: '623456'
86
- }
87
- )
90
+ ```ruby
91
+ client.create_recipient(
92
+ name: 'Nick Lloyd',
93
+ currency_code: 'GBP',
94
+ options: {
95
+ account_no: '72345678',
96
+ sort_code: '623456'
97
+ }
98
+ )
88
99
  ```
89
100
 
90
101
  **Delete Recipient**
91
102
 
92
103
  Retrieves a single recipient given a recipient_id.
93
104
 
94
- ```
105
+ ```ruby
95
106
  client.delete_recipient("ff17b231-2bc4-485e-967e-231867e15fd6")
96
107
 
97
108
  ```
@@ -100,36 +111,36 @@ client.delete_recipient("ff17b231-2bc4-485e-967e-231867e15fd6")
100
111
 
101
112
  Triggers an instantaneous bank transfer to a existing recipient from your account. [See docs](http://docs.telleroo.com/#bank-transfers-to-recipient-id) for additional available params to pass into options.
102
113
 
103
- ```
114
+ ```ruby
104
115
  client.create_transfer(
105
- account_id: 'a6a2b79c-33b5-4ed5-90fd-bfb8f1d4085a',
106
- currency_code: 'GBP',
107
- amount: 10000,
108
- recipient_id: 'ff17b231-2bc4-485e-967e-231867e15fd6',
109
- idempotent_key: 'abcd-123456789-efgh',
110
- options: {
111
- reference: 'foobar'
112
- }
113
- )
116
+ account_id: 'a6a2b79c-33b5-4ed5-90fd-bfb8f1d4085a',
117
+ currency_code: 'GBP',
118
+ amount: 10000,
119
+ recipient_id: 'ff17b231-2bc4-485e-967e-231867e15fd6',
120
+ idempotent_key: 'abcd-123456789-efgh',
121
+ options: {
122
+ reference: 'foobar'
123
+ }
124
+ )
114
125
  ```
115
126
 
116
127
  **Create an Adhoc Bank Transfer**
117
128
 
118
129
  Send all params required to both create a Recipient and transfer funds in a single call.
119
130
 
120
- ```
121
- client.create_adhoc_transfer({
122
- account_id: 'a6a2b77c-33b5-4ed5-90fd-bfb8f1d4085a',
123
- currency_code: 'GBP',
124
- amount: 10000,
125
- recipient_name: 'Rick Floyd',
126
- account_no: 12345678,
127
- sort_code: 665544,
128
- idempotent_key: 'abcd-123456789-efgh',
129
- reference: 'foo',
130
- tag: 'bar',
131
- reconciliation: 'baz'
132
- })
131
+ ```ruby
132
+ client.create_adhoc_transfer(
133
+ account_id: 'a6a2b77c-33b5-4ed5-90fd-bfb8f1d4085a',
134
+ currency_code: 'GBP',
135
+ amount: 10000,
136
+ recipient_name: 'Rick Floyd',
137
+ account_no: 12345678,
138
+ sort_code: 665544,
139
+ idempotent_key: 'abcd-123456789-efgh',
140
+ reference: 'foo',
141
+ tag: 'bar',
142
+ reconciliation: 'baz'
143
+ )
133
144
 
134
145
  ```
135
146
 
@@ -137,12 +148,12 @@ client.create_adhoc_transfer({
137
148
 
138
149
  Returns all activity on a specified bank account. [See docs](http://docs.telleroo.com/#transactions-list) for additional available params to pass into options.
139
150
 
140
- ```
151
+ ```ruby
141
152
  client.transactions(
142
- account_id: 'a6a2b77c-33b5-4ed5-90fd-bfb8f1d4085a',
143
- start_date: '09-06-2017',
144
- end_date: '09-07-2017'
145
- )
153
+ account_id: 'a6a2b77c-33b5-4ed5-90fd-bfb8f1d4085a',
154
+ start_date: '09-06-2017',
155
+ end_date: '09-07-2017'
156
+ )
146
157
 
147
158
  ```
148
159
 
@@ -150,8 +161,8 @@ client.transactions(
150
161
 
151
162
  Retrieves all relevant data of a single transaction including the transfer status.
152
163
 
153
- ```
154
- get_transaction(id)
164
+ ```ruby
165
+ client.get_transaction(id)
155
166
 
156
167
  ```
157
168
 
@@ -1,4 +1,5 @@
1
1
  require 'active_support/configurable'
2
+ require 'faraday'
2
3
 
3
4
  module Telleroo
4
5
  # Configuration.
@@ -7,11 +8,12 @@ module Telleroo
7
8
  # Telleroo.configure do |config|
8
9
  # config.authorization_token = 'deadbeef'
9
10
  # config.endpoint = 'https://sandbox.telleroo.com'
11
+ # config.http_adapter = :typhoeus
10
12
  # end
11
13
 
12
14
  class Configuration
13
15
  include ActiveSupport::Configurable
14
- VALID_CONFIG_KEYS = [:authorization_token, :endpoint].freeze
16
+ VALID_CONFIG_KEYS = [:authorization_token, :endpoint, :http_adapter].freeze
15
17
 
16
18
  config_accessor :authorization_token
17
19
 
@@ -19,6 +21,10 @@ module Telleroo
19
21
  'https://sandbox.telleroo.com'
20
22
  end
21
23
 
24
+ config_accessor :http_adapter do
25
+ Faraday.default_adapter
26
+ end
27
+
22
28
  # Return the configuration values set in this module
23
29
  def options
24
30
  Hash[
@@ -13,7 +13,7 @@ module Telleroo
13
13
  faraday.use Telleroo::Response::RaiseServerError
14
14
  faraday.headers['Authorization'] = @authorization_token
15
15
  faraday.headers['Content-Type'] = 'application/json'
16
- faraday.adapter Faraday.default_adapter
16
+ faraday.adapter *@http_adapter
17
17
  end
18
18
  end
19
19
  end
@@ -1,3 +1,3 @@
1
1
  module Telleroo
2
- VERSION = '0.1.0'.freeze
2
+ VERSION = '0.2.0'.freeze
3
3
  end
@@ -36,9 +36,9 @@ Gem::Specification.new do |spec|
36
36
  spec.add_dependency 'multi_json'
37
37
 
38
38
  spec.add_development_dependency 'bundler', '~> 1.14'
39
- spec.add_development_dependency 'rake', '~> 10.0'
39
+ spec.add_development_dependency 'rake', '~> 12.3'
40
40
  spec.add_development_dependency 'rspec', '~> 3.0'
41
- spec.add_development_dependency 'vcr', '~> 3.0'
41
+ spec.add_development_dependency 'vcr', '~> 4.0'
42
42
  spec.add_development_dependency 'webmock', '~> 3.0'
43
43
  spec.add_development_dependency 'guard'
44
44
  spec.add_development_dependency 'guard-rspec'
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: telleroo
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.0
4
+ version: 0.2.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Nick Lloyd
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2017-06-26 00:00:00.000000000 Z
11
+ date: 2018-11-29 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: activesupport
@@ -72,14 +72,14 @@ dependencies:
72
72
  requirements:
73
73
  - - "~>"
74
74
  - !ruby/object:Gem::Version
75
- version: '10.0'
75
+ version: '12.3'
76
76
  type: :development
77
77
  prerelease: false
78
78
  version_requirements: !ruby/object:Gem::Requirement
79
79
  requirements:
80
80
  - - "~>"
81
81
  - !ruby/object:Gem::Version
82
- version: '10.0'
82
+ version: '12.3'
83
83
  - !ruby/object:Gem::Dependency
84
84
  name: rspec
85
85
  requirement: !ruby/object:Gem::Requirement
@@ -100,14 +100,14 @@ dependencies:
100
100
  requirements:
101
101
  - - "~>"
102
102
  - !ruby/object:Gem::Version
103
- version: '3.0'
103
+ version: '4.0'
104
104
  type: :development
105
105
  prerelease: false
106
106
  version_requirements: !ruby/object:Gem::Requirement
107
107
  requirements:
108
108
  - - "~>"
109
109
  - !ruby/object:Gem::Version
110
- version: '3.0'
110
+ version: '4.0'
111
111
  - !ruby/object:Gem::Dependency
112
112
  name: webmock
113
113
  requirement: !ruby/object:Gem::Requirement
@@ -199,7 +199,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
199
199
  version: '0'
200
200
  requirements: []
201
201
  rubyforge_project:
202
- rubygems_version: 2.6.12
202
+ rubygems_version: 2.7.8
203
203
  signing_key:
204
204
  specification_version: 4
205
205
  summary: A Ruby interface to the Telleroo API.