bloom_remit_client 0.16.2 → 0.18.0

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: '004937907860669c021508a70c07195e00d0ca70dde5077b22528d25229a626e'
4
- data.tar.gz: 4e9ea25dd2e7ae3c18491eac7bea98b1a8fb75a42a71a41b8e57a4b78e6d4918
3
+ metadata.gz: a4f4ff66ac8ee1b8dc1a7aeeab7665e75e605bbe8a3a17c11b8a0f4118ae5062
4
+ data.tar.gz: b9f4a49ce06f28019207492a2592a7fa9fa6e604f5489ec1ca5d235fe2f22712
5
5
  SHA512:
6
- metadata.gz: 4b14558a559a026896d45a4c423d899f5f8e7f8eae1e1dd2ce6d8e86d88133ec1491d979f4db5ac91a6c5a8eac065929cdf0f36d195386e17fc1af536e2dd1ce
7
- data.tar.gz: 71aa7d7d1db260fb1eb02339d01231dc48a3b911be1898a0c3b3906ebe4af31170fad104835be3a5ab5f7ec24968eb57930c8949c9bc84d8735c4f0cd1370d1c
6
+ metadata.gz: 64ec567416a2f7166bc678046f5a5151d65b5243c8cf231d12bc8b1cbed9c7ff417baa17607075f7d9b3d88353de4dc62241c10a6f5d08d39b7968873ea406cf
7
+ data.tar.gz: 27bc88758fbfea05e6445c0a3d88cf70d60b755fe91480993d515eba4c1ac36a0bddb1d5eec6baf7e6904c261fab44b153e4bbff275f98a8fc9758c2f2b95696
data/CHANGELOG.md CHANGED
@@ -2,15 +2,35 @@
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.16.2] - 2020-01-26
5
+ ## [0.18.0] - 2021-03-10
6
+ ### Changed
7
+ - Pass `message_id` of 0 so it reads logs from the start on boot
8
+
9
+ ## [0.17.3] - 2021-02-19
10
+ ### Fixed
11
+ - Pass `Authorization` header to BloomRemit
12
+
13
+ ## [0.17.2] - 2021-02-11
14
+ ### Changed
15
+ - Update messagebus channel to `/v2/tx_events` (from `/v2/txns`)
16
+
17
+ ## [0.17.1] - 2021-02-03
18
+ ### Added
19
+ - Add `create_txn#errors` to easily access errors
20
+
21
+ ## [0.17.0] - 2021-02-01
22
+ ### Added
23
+ - `#get_deposit_targets` to list all deposit targets
24
+
25
+ ## [0.16.2] - 2021-01-26
6
26
  ### Changed
7
27
  - `CreateTxnPreviewResponse#errors` change from `Hash` to `Array`
8
28
 
9
- ## [0.16.1] - 2020-01-19
29
+ ## [0.16.1] - 2021-01-19
10
30
  ### Changed
11
31
  - Allow nil for both `partner_id` and `api_secret
12
32
 
13
- ## [0.16.0] - 2020-01-18
33
+ ## [0.16.0] - 2021-01-18
14
34
  ### Changed
15
35
  - Removed all API methods (complete overhaul)
16
36
 
@@ -8,13 +8,16 @@ require "bloom_remit_client/version"
8
8
  require "bloom_remit_client/client"
9
9
  require "bloom_remit_client/models/txn"
10
10
  require "bloom_remit_client/models/txn_preview"
11
+ require "bloom_remit_client/models/deposit_target"
11
12
  require "bloom_remit_client/requests"
12
13
  require "bloom_remit_client/requests/base_request"
13
14
  require "bloom_remit_client/requests/create_txn_request"
14
15
  require "bloom_remit_client/requests/create_txn_preview_request"
16
+ require "bloom_remit_client/requests/get_deposit_targets_request"
15
17
  require "bloom_remit_client/responses/base_response"
16
18
  require "bloom_remit_client/responses/create_txn_response"
17
19
  require "bloom_remit_client/responses/create_txn_preview_response"
20
+ require "bloom_remit_client/responses/get_deposit_targets_response"
18
21
 
19
22
  module BloomRemitClient
20
23
 
@@ -23,7 +26,7 @@ module BloomRemitClient
23
26
 
24
27
  include APIClientBase::Base.module
25
28
 
26
- TXN_UPDATES_CHANNEL = "/v2/txns".freeze
29
+ TXN_UPDATES_CHANNEL = "/v2/tx_events".freeze
27
30
 
28
31
  with_configuration do
29
32
  has :host, classes: String, default: STAGING
@@ -45,10 +48,13 @@ module BloomRemitClient
45
48
 
46
49
  MessageBusClientWorker.subscribe(configuration.host, {
47
50
  headers: {
48
- "HTTP_AUTHORIZATION" => "Basic #{token}"
51
+ "Authorization" => "Basic #{token}"
49
52
  },
50
53
  channels: {
51
- TXN_UPDATES_CHANNEL => { processor: configuration.on_txn_update },
54
+ TXN_UPDATES_CHANNEL => {
55
+ processor: configuration.on_txn_update,
56
+ message_id: 0,
57
+ },
52
58
  }
53
59
  })
54
60
  end
@@ -9,6 +9,7 @@ module BloomRemitClient
9
9
 
10
10
  api_action :create_txn
11
11
  api_action :create_txn_preview
12
+ api_action :get_deposit_targets
12
13
 
13
14
  def default_opts
14
15
  { host: host, partner_id: partner_id, api_secret: api_secret }
@@ -0,0 +1,23 @@
1
+ module BloomRemitClient
2
+ class DepositTarget
3
+
4
+ include Virtus.model
5
+
6
+ attribute :slug, String
7
+ attribute :name, String
8
+ attribute :active, Boolean
9
+ attribute :wait_time, String
10
+ attribute :support_line, String
11
+ attribute :sameday_cutoff, Integer
12
+ attribute :maximum, BigDecimal
13
+ attribute :availability, Array
14
+ attribute :availability_daynames, String
15
+ attribute :currencies, Array
16
+ attribute :required_fields, Array
17
+ attribute :type, String
18
+ attribute :iso_code, String
19
+ attribute :data, Hash
20
+ attribute :country, String
21
+
22
+ end
23
+ end
@@ -0,0 +1,13 @@
1
+ module BloomRemitClient
2
+ class GetDepositTargetsRequest < BaseRequest
3
+
4
+ def default_action
5
+ :get
6
+ end
7
+
8
+ def path
9
+ "/api/v1/strategies"
10
+ end
11
+
12
+ end
13
+ end
@@ -1,8 +1,13 @@
1
1
  module BloomRemitClient
2
2
  class CreateTxnResponse < BaseResponse
3
3
 
4
+ attribute :errors, Array, lazy: true, default: :default_errors
4
5
  attribute :txn, Txn, lazy: true, default: :default_txn
5
6
 
7
+ def default_errors
8
+ Array(parsed_body[:errors])
9
+ end
10
+
6
11
  def default_txn
7
12
  Txn.new(parsed_body[:txn])
8
13
  end
@@ -0,0 +1,14 @@
1
+ module BloomRemitClient
2
+ class GetDepositTargetsResponse < BaseResponse
3
+
4
+ attribute :deposit_targets, Array, lazy: true, default: :default_deposit_targets
5
+
6
+ def default_deposit_targets
7
+ JSON.parse(body).map do |deposit_target_hash|
8
+ hash = deposit_target_hash.with_indifferent_access
9
+ DepositTarget.new(hash)
10
+ end
11
+ end
12
+
13
+ end
14
+ end
@@ -1,3 +1,3 @@
1
1
  module BloomRemitClient
2
- VERSION = "0.16.2"
2
+ VERSION = "0.18.0"
3
3
  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.16.2
4
+ version: 0.18.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: 2021-01-26 00:00:00.000000000 Z
11
+ date: 2021-03-10 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: activesupport
@@ -204,15 +204,18 @@ files:
204
204
  - lib/bloom_remit_client/client.rb
205
205
  - lib/bloom_remit_client/coercers/indifferent_hash.rb
206
206
  - lib/bloom_remit_client/factories.rb
207
+ - lib/bloom_remit_client/models/deposit_target.rb
207
208
  - lib/bloom_remit_client/models/txn.rb
208
209
  - lib/bloom_remit_client/models/txn_preview.rb
209
210
  - lib/bloom_remit_client/requests.rb
210
211
  - lib/bloom_remit_client/requests/base_request.rb
211
212
  - lib/bloom_remit_client/requests/create_txn_preview_request.rb
212
213
  - lib/bloom_remit_client/requests/create_txn_request.rb
214
+ - lib/bloom_remit_client/requests/get_deposit_targets_request.rb
213
215
  - lib/bloom_remit_client/responses/base_response.rb
214
216
  - lib/bloom_remit_client/responses/create_txn_preview_response.rb
215
217
  - lib/bloom_remit_client/responses/create_txn_response.rb
218
+ - lib/bloom_remit_client/responses/get_deposit_targets_response.rb
216
219
  - lib/bloom_remit_client/version.rb
217
220
  homepage: https://github.com/imacchiato/bloom_remit_client-ruby
218
221
  licenses: