bloom_remit_client 0.5.0 → 0.6.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 +4 -4
- data/CHANGELOG.md +7 -0
- data/README.md +1 -1
- data/lib/bloom_remit_client/client.rb +3 -2
- data/lib/bloom_remit_client/concerns/has_base_authentification.rb +2 -1
- data/lib/bloom_remit_client/requests/base.rb +1 -1
- data/lib/bloom_remit_client/version.rb +1 -1
- data/lib/bloom_remit_client.rb +6 -3
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 95d75896514499a9ed04e5ce11fd4f456669e518
|
4
|
+
data.tar.gz: b045e5dd7adf94cc9f8932d2c1961fa16f0fa907
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 4531d4b578608cbdb0cc6c080ef2963a67d21bde7c24091a8763f04f66030d261a52c1f5eb8df2e548fc873fb4cbb705edad1bd547f2c43dd9306ff666ef256b
|
7
|
+
data.tar.gz: b6ec98c01559adb3bc7aea1242ec4cd7c5bd5b9c23752374e25d783fc4570218c0d14cba0de49c977d279fb7a537b59d8d642dba396543fc793b1104b24920f9
|
data/CHANGELOG.md
CHANGED
@@ -2,6 +2,13 @@
|
|
2
2
|
All notable changes to this project will be documented in this file.
|
3
3
|
This project adheres to [Semantic Versioning](http://semver.org/).
|
4
4
|
|
5
|
+
## [0.6.0] - 2016-09-15
|
6
|
+
### Changed
|
7
|
+
- Default to staging URL
|
8
|
+
|
9
|
+
### Fixed
|
10
|
+
- Make more threadsafe by passing host into client instantiation
|
11
|
+
|
5
12
|
## [0.5.0] - 2016-09-15
|
6
13
|
### Changed
|
7
14
|
- Structure of files to more easily add new endpoints
|
data/README.md
CHANGED
@@ -34,7 +34,7 @@ To make testing easier, you may `require 'bloom_remit_client/factories'` in your
|
|
34
34
|
|
35
35
|
## Contributing
|
36
36
|
|
37
|
-
Bug reports and pull requests are welcome on GitHub
|
37
|
+
Bug reports and pull requests are welcome on [GitHub](https://github.com/imacchiato/bloom_remit_client-ruby). This project is intended to be a safe, welcoming space for collaboration, and contributors are expected to adhere to the [Contributor Covenant](http://contributor-covenant.org) code of conduct.
|
38
38
|
|
39
39
|
## License
|
40
40
|
|
@@ -7,8 +7,9 @@ module BloomRemitClient
|
|
7
7
|
attribute :api_token, String
|
8
8
|
attribute :api_secret, String
|
9
9
|
attribute :agent_id, String
|
10
|
+
attribute :host, String
|
10
11
|
|
11
|
-
validates :api_token, :api_secret, presence: true
|
12
|
+
validates :api_token, :api_secret, :host, presence: true
|
12
13
|
|
13
14
|
# GET
|
14
15
|
# /api/v1/partners/:api_token/credits
|
@@ -86,7 +87,7 @@ module BloomRemitClient
|
|
86
87
|
|
87
88
|
# Should overwrite any other `:api_token`, `:api_secret`
|
88
89
|
def access_params
|
89
|
-
@access_params ||= attributes.slice(:api_token, :api_secret)
|
90
|
+
@access_params ||= attributes.slice(:host, :api_token, :api_secret)
|
90
91
|
end
|
91
92
|
|
92
93
|
def default_params
|
@@ -6,8 +6,9 @@ module BloomRemitClient
|
|
6
6
|
base.class_eval do
|
7
7
|
attribute :api_token, String
|
8
8
|
attribute :api_secret, String
|
9
|
+
attribute :host, String
|
9
10
|
|
10
|
-
validates :api_token, :api_secret, presence: true
|
11
|
+
validates :api_token, :api_secret, :host, presence: true
|
11
12
|
end
|
12
13
|
end
|
13
14
|
end
|
data/lib/bloom_remit_client.rb
CHANGED
@@ -42,15 +42,18 @@ module BloomRemitClient
|
|
42
42
|
attr_accessor :sandbox
|
43
43
|
attr_writer :host
|
44
44
|
|
45
|
-
def new(
|
46
|
-
|
45
|
+
def new(args)
|
46
|
+
client_args = args
|
47
|
+
client_args[:host] ||= self.host
|
48
|
+
client = Client.new(client_args)
|
47
49
|
raise ArgumentError, client.errors.full_messages if client.invalid?
|
48
50
|
client
|
49
51
|
end
|
50
52
|
|
51
53
|
def host
|
52
54
|
return @host if @host
|
53
|
-
sandbox
|
55
|
+
return STAGING if sandbox.nil? || sandbox
|
56
|
+
PRODUCTION
|
54
57
|
end
|
55
58
|
end
|
56
59
|
end
|