bloom_remit_client 0.6.0 → 0.7.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGELOG.md +5 -0
- data/lib/bloom_remit_client.rb +6 -8
- data/lib/bloom_remit_client/client.rb +9 -1
- data/lib/bloom_remit_client/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 381621671f656368bfb2b8976655091a1a3078e9
|
4
|
+
data.tar.gz: b9d06f402e637681cd3c2fafbf65d783dffb9e45
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 7455a4f09a719d55031b3d0632dd8bdd79aa94e21321b8f81cc6b40849ad99442c349f14c1df932a1e542dd1128e8a36b0064356520f30399829a7a424bec4b4
|
7
|
+
data.tar.gz: 41bca790360402850b7dbf130a3f752a03378269a4b5db08c4896e62daafb018cb61e6cf01b90cd25d5bceae3c26448d55341d78879286e358f2148f8f0ca2d6
|
data/CHANGELOG.md
CHANGED
@@ -2,6 +2,11 @@
|
|
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.7.0] - 2016-09-16
|
6
|
+
### Changed
|
7
|
+
- Heavy lifting of sandbox and host defaults fall on BloomRemitClient::Client
|
8
|
+
- Default sandbox is true. Must set to false to be on production mode
|
9
|
+
|
5
10
|
## [0.6.0] - 2016-09-15
|
6
11
|
### Changed
|
7
12
|
- Default to staging URL
|
data/lib/bloom_remit_client.rb
CHANGED
@@ -39,21 +39,19 @@ module BloomRemitClient
|
|
39
39
|
STAGING = 'bloomremit-staging.herokuapp.com'
|
40
40
|
|
41
41
|
class << self
|
42
|
+
attr_accessor :host
|
42
43
|
attr_accessor :sandbox
|
43
|
-
attr_writer :host
|
44
44
|
|
45
45
|
def new(args)
|
46
|
-
client_args =
|
47
|
-
client_args[:host]
|
46
|
+
client_args = {}
|
47
|
+
client_args[:host] = self.host if self.host.present?
|
48
|
+
client_args[:sandbox] = self.sandbox if self.sandbox.present?
|
49
|
+
client_args.merge!(args)
|
50
|
+
|
48
51
|
client = Client.new(client_args)
|
49
52
|
raise ArgumentError, client.errors.full_messages if client.invalid?
|
50
53
|
client
|
51
54
|
end
|
52
55
|
|
53
|
-
def host
|
54
|
-
return @host if @host
|
55
|
-
return STAGING if sandbox.nil? || sandbox
|
56
|
-
PRODUCTION
|
57
|
-
end
|
58
56
|
end
|
59
57
|
end
|
@@ -7,9 +7,11 @@ 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
|
+
attribute :host, String, lazy: true, default: :default_host
|
11
|
+
attribute :sandbox, Boolean, default: true
|
11
12
|
|
12
13
|
validates :api_token, :api_secret, :host, presence: true
|
14
|
+
validates :sandbox, inclusion: {in: [true, false]}
|
13
15
|
|
14
16
|
# GET
|
15
17
|
# /api/v1/partners/:api_token/credits
|
@@ -93,5 +95,11 @@ module BloomRemitClient
|
|
93
95
|
def default_params
|
94
96
|
@default_params ||= attributes.slice(:agent_id)
|
95
97
|
end
|
98
|
+
|
99
|
+
def default_host
|
100
|
+
return BloomRemitClient::STAGING if self.sandbox.nil? || self.sandbox
|
101
|
+
BloomRemitClient::PRODUCTION
|
102
|
+
end
|
103
|
+
|
96
104
|
end
|
97
105
|
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: bloom_remit_client
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.7.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Ramon Tayag
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2016-09-
|
11
|
+
date: 2016-09-16 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: activemodel
|