bloom_remit_client 0.16.1 → 0.17.3

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
2
  SHA256:
3
- metadata.gz: 3d05d4bbb0ec183ac5431dfd8e23b41cfa495bdab6cd63d5ccd262027f9c28e4
4
- data.tar.gz: ea90abde2f013faa52e46c1899fbd2c737f4793826ce6a328448293385eeafef
3
+ metadata.gz: 950e0d2964cd9a5de5d01b86cc31ea73e1d1e73eae73c292dafca3691670f7ac
4
+ data.tar.gz: bfcaa028570e346b05c67c937a2f4f01ffb5d8a5e2a0ac3c3626b3134707f9eb
5
5
  SHA512:
6
- metadata.gz: c80276da94593218d43021c48527140979f70b52b8988ec26a91defde9448fc762bfe714bde5433e569b72e0771dba649eaf61aa010af0a5935b2758141c9c44
7
- data.tar.gz: 37b74d5855caca1c94c5a4072aefcc0977ca19463c7f4603093a4d9b9585638c5aea7caa26dcef9b83cf8aa3848ea3bed11fe01e42ee416e9532ef571effa553
6
+ metadata.gz: c33dd38d28f49fbacd35ea2d153f073e22ff63fa3ee059b7d2ca8f1b6a90d7abc50dd4992c433e89b89d90ea8cac05638f80f2f761dd257b24efbfda4bdb3eba
7
+ data.tar.gz: e4652bfc6a23aa97181ddfa1580ff21f62041d400f8b74a012699260b3ee2247864f3f3cb345d2d4372f6c51764bb9ee73f5b4d07731a4ce312e9a4740639cb4
data/CHANGELOG.md CHANGED
@@ -2,11 +2,31 @@
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.1] - 2020-01-19
5
+ ## [0.17.3] - 2021-02-19
6
+ ### Fixed
7
+ - Pass `Authorization` header to BloomRemit
8
+
9
+ ## [0.17.2] - 2021-02-11
10
+ ### Changed
11
+ - Update messagebus channel to `/v2/tx_events` (from `/v2/txns`)
12
+
13
+ ## [0.17.1] - 2021-02-03
14
+ ### Added
15
+ - Add `create_txn#errors` to easily access errors
16
+
17
+ ## [0.17.0] - 2021-02-01
18
+ ### Added
19
+ - `#get_deposit_targets` to list all deposit targets
20
+
21
+ ## [0.16.2] - 2021-01-26
22
+ ### Changed
23
+ - `CreateTxnPreviewResponse#errors` change from `Hash` to `Array`
24
+
25
+ ## [0.16.1] - 2021-01-19
6
26
  ### Changed
7
27
  - Allow nil for both `partner_id` and `api_secret
8
28
 
9
- ## [0.16.0] - 2020-01-18
29
+ ## [0.16.0] - 2021-01-18
10
30
  ### Changed
11
31
  - Removed all API methods (complete overhaul)
12
32
 
@@ -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,7 +48,7 @@ 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
54
  TXN_UPDATES_CHANNEL => { processor: configuration.on_txn_update },
@@ -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,7 +1,7 @@
1
1
  module BloomRemitClient
2
2
  class CreateTxnPreviewResponse < BaseResponse
3
3
 
4
- attribute :errors, Hash, lazy: true, default: :default_errors
4
+ attribute :errors, Array, lazy: true, default: :default_errors
5
5
  attribute :txn_preview, TxnPreview, lazy: true, default: :default_txn_preview
6
6
 
7
7
  def default_errors
@@ -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.1"
2
+ VERSION = "0.17.3"
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.1
4
+ version: 0.17.3
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-19 00:00:00.000000000 Z
11
+ date: 2021-02-19 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: