bloom_remit_client 0.13.0 → 0.16.2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +5 -5
- data/.github/workflows/push.yml +27 -0
- data/.ruby-version +1 -1
- data/CHANGELOG.md +27 -0
- data/Gemfile +2 -1
- data/README.md +61 -0
- data/bloom_remit_client.gemspec +5 -5
- data/lib/bloom_remit_client.rb +40 -50
- data/lib/bloom_remit_client/client.rb +6 -133
- data/lib/bloom_remit_client/factories.rb +23 -0
- data/lib/bloom_remit_client/models/txn.rb +39 -0
- data/lib/bloom_remit_client/models/txn_preview.rb +15 -0
- data/lib/bloom_remit_client/requests/base_request.rb +18 -0
- data/lib/bloom_remit_client/requests/create_txn_preview_request.rb +24 -0
- data/lib/bloom_remit_client/requests/create_txn_request.rb +79 -0
- data/lib/bloom_remit_client/responses/base_response.rb +18 -0
- data/lib/bloom_remit_client/responses/create_txn_preview_response.rb +16 -0
- data/lib/bloom_remit_client/responses/create_txn_response.rb +11 -0
- data/lib/bloom_remit_client/version.rb +1 -1
- metadata +23 -50
- data/.travis.yml +0 -9
- data/lib/bloom_remit_client/coercers/path.rb +0 -11
- data/lib/bloom_remit_client/concerns/has_base_authentification.rb +0 -16
- data/lib/bloom_remit_client/models/biller.rb +0 -16
- data/lib/bloom_remit_client/models/credit.rb +0 -12
- data/lib/bloom_remit_client/models/deposit_strategy.rb +0 -11
- data/lib/bloom_remit_client/models/payment.rb +0 -23
- data/lib/bloom_remit_client/models/recipient.rb +0 -18
- data/lib/bloom_remit_client/models/remittance.rb +0 -22
- data/lib/bloom_remit_client/models/user.rb +0 -21
- data/lib/bloom_remit_client/requests/base.rb +0 -55
- data/lib/bloom_remit_client/requests/billers/list.rb +0 -23
- data/lib/bloom_remit_client/requests/credit/history.rb +0 -20
- data/lib/bloom_remit_client/requests/credit/list.rb +0 -20
- data/lib/bloom_remit_client/requests/deposit_strategies/list.rb +0 -21
- data/lib/bloom_remit_client/requests/payments/create.rb +0 -31
- data/lib/bloom_remit_client/requests/rate/show.rb +0 -29
- data/lib/bloom_remit_client/requests/recipients/create.rb +0 -32
- data/lib/bloom_remit_client/requests/recipients/list.rb +0 -34
- data/lib/bloom_remit_client/requests/remittances/calculate.rb +0 -33
- data/lib/bloom_remit_client/requests/remittances/create.rb +0 -30
- data/lib/bloom_remit_client/requests/requests_sender.rb +0 -35
- data/lib/bloom_remit_client/requests/senders/create.rb +0 -30
- data/lib/bloom_remit_client/requests/txns/create.rb +0 -30
- data/lib/bloom_remit_client/requests/url_builder.rb +0 -51
- data/lib/bloom_remit_client/responses/base.rb +0 -31
- data/lib/bloom_remit_client/responses/billers/list.rb +0 -17
- data/lib/bloom_remit_client/responses/deposit_strategies/list.rb +0 -20
- data/lib/bloom_remit_client/responses/payments/create.rb +0 -17
- data/lib/bloom_remit_client/responses/recipients/create.rb +0 -20
- data/lib/bloom_remit_client/responses/recipients/list.rb +0 -20
- data/lib/bloom_remit_client/responses/remittances/calculate.rb +0 -69
- data/lib/bloom_remit_client/responses/remittances/create.rb +0 -20
- data/lib/bloom_remit_client/responses/senders/create.rb +0 -21
- data/lib/bloom_remit_client/responses/txns/create.rb +0 -20
@@ -0,0 +1,39 @@
|
|
1
|
+
module BloomRemitClient
|
2
|
+
class Txn
|
3
|
+
|
4
|
+
include Virtus.model
|
5
|
+
|
6
|
+
attribute :id, String
|
7
|
+
attribute :recipient_id, String
|
8
|
+
attribute :dest_currency, String
|
9
|
+
attribute :receivable_in_dest_currency, BigDecimal
|
10
|
+
attribute :payout_method, String
|
11
|
+
attribute :status, String
|
12
|
+
attribute :account_name, String
|
13
|
+
attribute :account_number, String
|
14
|
+
attribute :tracking_sender, String
|
15
|
+
attribute :tracking_number, String
|
16
|
+
attribute :client_external_id, String
|
17
|
+
attribute :purpose, String
|
18
|
+
attribute :sender_first_name, String
|
19
|
+
attribute :sender_last_name, String
|
20
|
+
attribute :sender_email, String
|
21
|
+
attribute :sender_address, String
|
22
|
+
attribute :sender_city, String
|
23
|
+
attribute :sender_state, String
|
24
|
+
attribute :sender_zip_code, String
|
25
|
+
attribute :sender_country, String
|
26
|
+
attribute :sender_occupation, String
|
27
|
+
attribute :recipient_first_name, String
|
28
|
+
attribute :recipient_last_name, String
|
29
|
+
attribute :recipient_mobile, String
|
30
|
+
attribute :recipient_address, String
|
31
|
+
attribute :recipient_city, String
|
32
|
+
attribute :recipient_state, String
|
33
|
+
attribute :recipient_zip_code, String
|
34
|
+
attribute :recipient_country, String
|
35
|
+
attribute :recipient_occupation, String
|
36
|
+
attribute :recipient_relationship_to_sender, String
|
37
|
+
|
38
|
+
end
|
39
|
+
end
|
@@ -0,0 +1,15 @@
|
|
1
|
+
module BloomRemitClient
|
2
|
+
class TxnPreview
|
3
|
+
|
4
|
+
include Virtus.model
|
5
|
+
|
6
|
+
attribute :total_fees, BigDecimal
|
7
|
+
attribute :maximum_amount, BigDecimal
|
8
|
+
attribute :amount, BigDecimal
|
9
|
+
attribute :payout_method, String
|
10
|
+
attribute :minimum_wait_time_in_minutes, Integer
|
11
|
+
attribute :maximum_wait_time_in_minutes, Integer
|
12
|
+
attribute :days_available, Array
|
13
|
+
|
14
|
+
end
|
15
|
+
end
|
@@ -0,0 +1,18 @@
|
|
1
|
+
module BloomRemitClient
|
2
|
+
class BaseRequest
|
3
|
+
|
4
|
+
include APIClientBase::Request.module
|
5
|
+
|
6
|
+
attribute :host, String
|
7
|
+
attribute :partner_id, String
|
8
|
+
attribute :api_secret, String
|
9
|
+
|
10
|
+
def headers
|
11
|
+
{
|
12
|
+
"X-API-PARTNER-ID" => partner_id,
|
13
|
+
"X-API-SECRET" => api_secret,
|
14
|
+
}
|
15
|
+
end
|
16
|
+
|
17
|
+
end
|
18
|
+
end
|
@@ -0,0 +1,24 @@
|
|
1
|
+
module BloomRemitClient
|
2
|
+
class CreateTxnPreviewRequest < BaseRequest
|
3
|
+
|
4
|
+
attribute :amount, BigDecimal
|
5
|
+
attribute :payout_method, String
|
6
|
+
|
7
|
+
def default_action
|
8
|
+
:post
|
9
|
+
end
|
10
|
+
|
11
|
+
def path
|
12
|
+
"/api/v2/txn_previews"
|
13
|
+
end
|
14
|
+
|
15
|
+
def body
|
16
|
+
txn_preview_values = %i[amount payout_method].each_with_object({}) do |attr, hash|
|
17
|
+
hash[attr] = send(attr)
|
18
|
+
end
|
19
|
+
|
20
|
+
{ txn_preview: txn_preview_values }
|
21
|
+
end
|
22
|
+
|
23
|
+
end
|
24
|
+
end
|
@@ -0,0 +1,79 @@
|
|
1
|
+
module BloomRemitClient
|
2
|
+
class CreateTxnRequest < BaseRequest
|
3
|
+
|
4
|
+
attribute :sender_first_name, String
|
5
|
+
attribute :sender_last_name, String
|
6
|
+
attribute :sender_email, String
|
7
|
+
attribute :sender_mobile, String
|
8
|
+
attribute :sender_address, String
|
9
|
+
attribute :sender_city, String
|
10
|
+
attribute :sender_state, String
|
11
|
+
attribute :sender_zip_code, String
|
12
|
+
attribute :sender_country, String
|
13
|
+
attribute :sender_occupation, String
|
14
|
+
attribute :recipient_first_name, String
|
15
|
+
attribute :recipient_last_name, String
|
16
|
+
attribute :recipient_mobile, String
|
17
|
+
attribute :recipient_address, String
|
18
|
+
attribute :recipient_city, String
|
19
|
+
attribute :recipient_state, String
|
20
|
+
attribute :recipient_zip_code, String
|
21
|
+
attribute :recipient_country, String
|
22
|
+
attribute :recipient_occupation, String
|
23
|
+
attribute :recipient_relationship_to_sender, String
|
24
|
+
attribute :dest_currency, String
|
25
|
+
attribute :receivable_in_dest_currency, String
|
26
|
+
attribute :payout_method, String
|
27
|
+
attribute :purpose, String
|
28
|
+
attribute :account_number, String
|
29
|
+
attribute :account_name, String
|
30
|
+
attribute :client_external_id, String
|
31
|
+
|
32
|
+
BODY_ATTRIBUTES = %i[
|
33
|
+
sender_first_name
|
34
|
+
sender_last_name
|
35
|
+
sender_email
|
36
|
+
sender_mobile
|
37
|
+
sender_address
|
38
|
+
sender_city
|
39
|
+
sender_state
|
40
|
+
sender_zip_code
|
41
|
+
sender_country
|
42
|
+
sender_occupation
|
43
|
+
recipient_first_name
|
44
|
+
recipient_last_name
|
45
|
+
recipient_mobile
|
46
|
+
recipient_address
|
47
|
+
recipient_city
|
48
|
+
recipient_state
|
49
|
+
recipient_zip_code
|
50
|
+
recipient_country
|
51
|
+
recipient_occupation
|
52
|
+
recipient_relationship_to_sender
|
53
|
+
dest_currency
|
54
|
+
receivable_in_dest_currency
|
55
|
+
payout_method
|
56
|
+
purpose
|
57
|
+
account_number
|
58
|
+
account_name
|
59
|
+
client_external_id
|
60
|
+
].freeze
|
61
|
+
|
62
|
+
def default_action
|
63
|
+
:post
|
64
|
+
end
|
65
|
+
|
66
|
+
def path
|
67
|
+
"/api/v2/txns"
|
68
|
+
end
|
69
|
+
|
70
|
+
def body
|
71
|
+
txn_values = BODY_ATTRIBUTES.each_with_object({}) do |attr, hash|
|
72
|
+
hash[attr] = send(attr)
|
73
|
+
end
|
74
|
+
|
75
|
+
{ txn: txn_values }
|
76
|
+
end
|
77
|
+
|
78
|
+
end
|
79
|
+
end
|
@@ -0,0 +1,18 @@
|
|
1
|
+
module BloomRemitClient
|
2
|
+
class BaseResponse
|
3
|
+
|
4
|
+
include APIClientBase::Response.module
|
5
|
+
|
6
|
+
attribute :body, String, lazy: true, default: :default_body
|
7
|
+
attribute :parsed_body, String, lazy: true, default: :default_parsed_body
|
8
|
+
|
9
|
+
def default_body
|
10
|
+
raw_response.body
|
11
|
+
end
|
12
|
+
|
13
|
+
def default_parsed_body
|
14
|
+
JSON.parse(body).with_indifferent_access
|
15
|
+
end
|
16
|
+
|
17
|
+
end
|
18
|
+
end
|
@@ -0,0 +1,16 @@
|
|
1
|
+
module BloomRemitClient
|
2
|
+
class CreateTxnPreviewResponse < BaseResponse
|
3
|
+
|
4
|
+
attribute :errors, Array, lazy: true, default: :default_errors
|
5
|
+
attribute :txn_preview, TxnPreview, lazy: true, default: :default_txn_preview
|
6
|
+
|
7
|
+
def default_errors
|
8
|
+
Array(parsed_body[:errors])
|
9
|
+
end
|
10
|
+
|
11
|
+
def default_txn_preview
|
12
|
+
TxnPreview.new(parsed_body[:txn_preview])
|
13
|
+
end
|
14
|
+
|
15
|
+
end
|
16
|
+
end
|
metadata
CHANGED
@@ -1,17 +1,17 @@
|
|
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.16.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Ramon Tayag
|
8
|
-
autorequire:
|
8
|
+
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2021-01-26 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
|
-
name:
|
14
|
+
name: activesupport
|
15
15
|
requirement: !ruby/object:Gem::Requirement
|
16
16
|
requirements:
|
17
17
|
- - ">="
|
@@ -25,7 +25,7 @@ dependencies:
|
|
25
25
|
- !ruby/object:Gem::Version
|
26
26
|
version: '0'
|
27
27
|
- !ruby/object:Gem::Dependency
|
28
|
-
name:
|
28
|
+
name: api_client_base
|
29
29
|
requirement: !ruby/object:Gem::Requirement
|
30
30
|
requirements:
|
31
31
|
- - ">="
|
@@ -39,7 +39,7 @@ dependencies:
|
|
39
39
|
- !ruby/object:Gem::Version
|
40
40
|
version: '0'
|
41
41
|
- !ruby/object:Gem::Dependency
|
42
|
-
name:
|
42
|
+
name: typhoeus
|
43
43
|
requirement: !ruby/object:Gem::Requirement
|
44
44
|
requirements:
|
45
45
|
- - ">="
|
@@ -53,7 +53,7 @@ dependencies:
|
|
53
53
|
- !ruby/object:Gem::Version
|
54
54
|
version: '0'
|
55
55
|
- !ruby/object:Gem::Dependency
|
56
|
-
name:
|
56
|
+
name: message_bus_client_worker
|
57
57
|
requirement: !ruby/object:Gem::Requirement
|
58
58
|
requirements:
|
59
59
|
- - ">="
|
@@ -72,14 +72,14 @@ dependencies:
|
|
72
72
|
requirements:
|
73
73
|
- - "~>"
|
74
74
|
- !ruby/object:Gem::Version
|
75
|
-
version: '
|
75
|
+
version: '2.0'
|
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: '
|
82
|
+
version: '2.0'
|
83
83
|
- !ruby/object:Gem::Dependency
|
84
84
|
name: rake
|
85
85
|
requirement: !ruby/object:Gem::Requirement
|
@@ -165,7 +165,7 @@ dependencies:
|
|
165
165
|
- !ruby/object:Gem::Version
|
166
166
|
version: '0'
|
167
167
|
- !ruby/object:Gem::Dependency
|
168
|
-
name:
|
168
|
+
name: virtus-matchers
|
169
169
|
requirement: !ruby/object:Gem::Requirement
|
170
170
|
requirements:
|
171
171
|
- - ">="
|
@@ -178,7 +178,7 @@ dependencies:
|
|
178
178
|
- - ">="
|
179
179
|
- !ruby/object:Gem::Version
|
180
180
|
version: '0'
|
181
|
-
description:
|
181
|
+
description:
|
182
182
|
email:
|
183
183
|
- ramon.tayag@gmail.com
|
184
184
|
executables: []
|
@@ -186,10 +186,10 @@ extensions: []
|
|
186
186
|
extra_rdoc_files: []
|
187
187
|
files:
|
188
188
|
- ".envrc"
|
189
|
+
- ".github/workflows/push.yml"
|
189
190
|
- ".gitignore"
|
190
191
|
- ".rspec"
|
191
192
|
- ".ruby-version"
|
192
|
-
- ".travis.yml"
|
193
193
|
- CHANGELOG.md
|
194
194
|
- CODE_OF_CONDUCT.md
|
195
195
|
- Gemfile
|
@@ -203,49 +203,23 @@ files:
|
|
203
203
|
- lib/bloom_remit_client.rb
|
204
204
|
- lib/bloom_remit_client/client.rb
|
205
205
|
- lib/bloom_remit_client/coercers/indifferent_hash.rb
|
206
|
-
- lib/bloom_remit_client/coercers/path.rb
|
207
|
-
- lib/bloom_remit_client/concerns/has_base_authentification.rb
|
208
206
|
- lib/bloom_remit_client/factories.rb
|
209
|
-
- lib/bloom_remit_client/models/
|
210
|
-
- lib/bloom_remit_client/models/
|
211
|
-
- lib/bloom_remit_client/models/deposit_strategy.rb
|
212
|
-
- lib/bloom_remit_client/models/payment.rb
|
213
|
-
- lib/bloom_remit_client/models/recipient.rb
|
214
|
-
- lib/bloom_remit_client/models/remittance.rb
|
215
|
-
- lib/bloom_remit_client/models/user.rb
|
207
|
+
- lib/bloom_remit_client/models/txn.rb
|
208
|
+
- lib/bloom_remit_client/models/txn_preview.rb
|
216
209
|
- lib/bloom_remit_client/requests.rb
|
217
|
-
- lib/bloom_remit_client/requests/
|
218
|
-
- lib/bloom_remit_client/requests/
|
219
|
-
- lib/bloom_remit_client/requests/
|
220
|
-
- lib/bloom_remit_client/
|
221
|
-
- lib/bloom_remit_client/
|
222
|
-
- lib/bloom_remit_client/
|
223
|
-
- lib/bloom_remit_client/requests/rate/show.rb
|
224
|
-
- lib/bloom_remit_client/requests/recipients/create.rb
|
225
|
-
- lib/bloom_remit_client/requests/recipients/list.rb
|
226
|
-
- lib/bloom_remit_client/requests/remittances/calculate.rb
|
227
|
-
- lib/bloom_remit_client/requests/remittances/create.rb
|
228
|
-
- lib/bloom_remit_client/requests/requests_sender.rb
|
229
|
-
- lib/bloom_remit_client/requests/senders/create.rb
|
230
|
-
- lib/bloom_remit_client/requests/txns/create.rb
|
231
|
-
- lib/bloom_remit_client/requests/url_builder.rb
|
232
|
-
- lib/bloom_remit_client/responses/base.rb
|
233
|
-
- lib/bloom_remit_client/responses/billers/list.rb
|
234
|
-
- lib/bloom_remit_client/responses/deposit_strategies/list.rb
|
235
|
-
- lib/bloom_remit_client/responses/payments/create.rb
|
236
|
-
- lib/bloom_remit_client/responses/recipients/create.rb
|
237
|
-
- lib/bloom_remit_client/responses/recipients/list.rb
|
238
|
-
- lib/bloom_remit_client/responses/remittances/calculate.rb
|
239
|
-
- lib/bloom_remit_client/responses/remittances/create.rb
|
240
|
-
- lib/bloom_remit_client/responses/senders/create.rb
|
241
|
-
- lib/bloom_remit_client/responses/txns/create.rb
|
210
|
+
- lib/bloom_remit_client/requests/base_request.rb
|
211
|
+
- lib/bloom_remit_client/requests/create_txn_preview_request.rb
|
212
|
+
- lib/bloom_remit_client/requests/create_txn_request.rb
|
213
|
+
- lib/bloom_remit_client/responses/base_response.rb
|
214
|
+
- lib/bloom_remit_client/responses/create_txn_preview_response.rb
|
215
|
+
- lib/bloom_remit_client/responses/create_txn_response.rb
|
242
216
|
- lib/bloom_remit_client/version.rb
|
243
217
|
homepage: https://github.com/imacchiato/bloom_remit_client-ruby
|
244
218
|
licenses:
|
245
219
|
- MIT
|
246
220
|
metadata:
|
247
221
|
allowed_push_host: https://rubygems.org
|
248
|
-
post_install_message:
|
222
|
+
post_install_message:
|
249
223
|
rdoc_options: []
|
250
224
|
require_paths:
|
251
225
|
- lib
|
@@ -260,9 +234,8 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
260
234
|
- !ruby/object:Gem::Version
|
261
235
|
version: '0'
|
262
236
|
requirements: []
|
263
|
-
|
264
|
-
|
265
|
-
signing_key:
|
237
|
+
rubygems_version: 3.1.4
|
238
|
+
signing_key:
|
266
239
|
specification_version: 4
|
267
240
|
summary: Ruby wrapper around Bloom Remit's API
|
268
241
|
test_files: []
|
data/.travis.yml
DELETED
@@ -1,16 +0,0 @@
|
|
1
|
-
# frozen_string_literal: true
|
2
|
-
module BloomRemitClient
|
3
|
-
module Concerns
|
4
|
-
module HasBaseAuthentification
|
5
|
-
def self.included(base)
|
6
|
-
base.class_eval do
|
7
|
-
attribute :api_token, String
|
8
|
-
attribute :api_secret, String
|
9
|
-
attribute :host, String
|
10
|
-
|
11
|
-
validates :api_token, :api_secret, :host, presence: true
|
12
|
-
end
|
13
|
-
end
|
14
|
-
end
|
15
|
-
end
|
16
|
-
end
|
@@ -1,16 +0,0 @@
|
|
1
|
-
module BloomRemitClient
|
2
|
-
class Biller
|
3
|
-
|
4
|
-
include Virtus.model
|
5
|
-
attribute :slug, String
|
6
|
-
attribute :description, String
|
7
|
-
attribute :first_field, String
|
8
|
-
attribute :first_field_format, String
|
9
|
-
attribute :first_field_width, Integer
|
10
|
-
attribute :second_field, String
|
11
|
-
attribute :second_field_format, String
|
12
|
-
attribute :second_field_width, Integer
|
13
|
-
attribute :service_charge, Float
|
14
|
-
|
15
|
-
end
|
16
|
-
end
|