unit-ruby 0.5.0 → 0.7.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/Gemfile.lock +1 -1
- data/lib/unit-ruby/ach_counterparty.rb +22 -0
- data/lib/unit-ruby/deposit_account.rb +18 -0
- data/lib/unit-ruby/types/account_limits.rb +24 -0
- data/lib/unit-ruby/types/ach_limits.rb +40 -0
- data/lib/unit-ruby/types/card_limits.rb +40 -0
- data/lib/unit-ruby/types/check_deposit_limits.rb +27 -0
- data/lib/unit-ruby/version.rb +1 -1
- data/lib/unit-ruby.rb +5 -0
- metadata +8 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 40e6853f18c626e65e80304e8136701347c69e77b1f3a847a616e8ac5695ec2a
|
4
|
+
data.tar.gz: b3debed74f1f43a874c804b42d6c843346d97bb8f79c7fdee679c729172c9907
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 7fdac7147fdc333044c1bb07f765d739ddccf3d47a169ea8987a49e9ca2342634b9a547bbf3c569e938aaddf661a4395ffe58f43c66488d6151016cbbd16b7e4
|
7
|
+
data.tar.gz: 4e50d0b332986d09a0093efd0c3c2c10d0712ad75d97a22938411c197616babceeb5bcb94cf6b36a2fa058808f1a889d74c4fc87074cdaf861299c0b3e5ab738
|
data/Gemfile.lock
CHANGED
@@ -0,0 +1,22 @@
|
|
1
|
+
module Unit
|
2
|
+
class AchCounterparty < APIResource
|
3
|
+
path '/counterparties'
|
4
|
+
|
5
|
+
attribute :idempotency_key, Types::String # Optional
|
6
|
+
attribute :tags, Types::Hash # Optional
|
7
|
+
|
8
|
+
attribute :name, Types::String # Name of the account holder
|
9
|
+
attribute :created_at, Types::DateTime
|
10
|
+
attribute :routing_number, Types::String # Routing number of account.
|
11
|
+
attribute :account_number, Types::String # Account number, together with the routingNumber forms the identifier of the account on the ACH network.
|
12
|
+
attribute :account_type, Types::String # Account type, either Checking, Savings or Loan. Default is Checking.
|
13
|
+
attribute :type, Types::String # Type of the counterparty, either Business, Person or Unknown.
|
14
|
+
|
15
|
+
belongs_to :customer, class_name: 'Unit::IndividualCustomer'
|
16
|
+
|
17
|
+
include ResourceOperations::List
|
18
|
+
include ResourceOperations::Create
|
19
|
+
include ResourceOperations::Save
|
20
|
+
include ResourceOperations::Find
|
21
|
+
end
|
22
|
+
end
|
@@ -32,6 +32,24 @@ module Unit
|
|
32
32
|
self.class.find(id)
|
33
33
|
end
|
34
34
|
|
35
|
+
def limits
|
36
|
+
@limits ||= Types::AccountLimits.cast(
|
37
|
+
self.class.connection.get("accounts/#{id}/limits")
|
38
|
+
)
|
39
|
+
end
|
40
|
+
|
41
|
+
def ach_limits
|
42
|
+
limits.ach_limits
|
43
|
+
end
|
44
|
+
|
45
|
+
def card_limits
|
46
|
+
limits.card_limits
|
47
|
+
end
|
48
|
+
|
49
|
+
def check_deposit_limits
|
50
|
+
limits.check_deposit_limits
|
51
|
+
end
|
52
|
+
|
35
53
|
include ResourceOperations::List
|
36
54
|
include ResourceOperations::Create
|
37
55
|
include ResourceOperations::Save
|
@@ -0,0 +1,24 @@
|
|
1
|
+
module Unit
|
2
|
+
module Types
|
3
|
+
class AccountLimits
|
4
|
+
attr_reader :ach_limits, :card_limits, :check_deposit_limits
|
5
|
+
|
6
|
+
def initialize(ach_limits:, card_limits:, check_deposit_limits:)
|
7
|
+
@ach_limits = ach_limits
|
8
|
+
@card_limits = card_limits
|
9
|
+
@check_deposit_limits = check_deposit_limits
|
10
|
+
end
|
11
|
+
|
12
|
+
def self.cast(val)
|
13
|
+
return val if val.is_a? self
|
14
|
+
return nil if val.nil?
|
15
|
+
|
16
|
+
new(
|
17
|
+
ach_limits: AchLimits.cast(val[:attributes][:ach]),
|
18
|
+
card_limits: CardLimits.cast(val[:attributes][:card]),
|
19
|
+
check_deposit_limits: CheckDepositLimits.cast(val[:attributes][:check_deposit])
|
20
|
+
)
|
21
|
+
end
|
22
|
+
end
|
23
|
+
end
|
24
|
+
end
|
@@ -0,0 +1,40 @@
|
|
1
|
+
module Unit
|
2
|
+
module Types
|
3
|
+
class AchLimits
|
4
|
+
attr_reader :daily_debit_limit, :daily_debit_limit_used,
|
5
|
+
:monthly_debit_limit, :monthly_debit_limit_used,
|
6
|
+
:daily_credit_limit, :daily_credit_limit_used,
|
7
|
+
:monthly_credit_limit, :monthly_credit_limit_used
|
8
|
+
|
9
|
+
def initialize(daily_debit_limit:, daily_debit_limit_used:,
|
10
|
+
monthly_debit_limit:, monthly_debit_limit_used:,
|
11
|
+
daily_credit_limit:, daily_credit_limit_used:,
|
12
|
+
monthly_credit_limit:, monthly_credit_limit_used:)
|
13
|
+
@daily_debit_limit = daily_debit_limit
|
14
|
+
@daily_debit_limit_used = daily_debit_limit_used
|
15
|
+
@monthly_debit_limit = monthly_debit_limit
|
16
|
+
@monthly_debit_limit_used = monthly_debit_limit_used
|
17
|
+
@daily_credit_limit = daily_credit_limit
|
18
|
+
@daily_credit_limit_used = daily_credit_limit_used
|
19
|
+
@monthly_credit_limit = monthly_credit_limit
|
20
|
+
@monthly_credit_limit_used = monthly_credit_limit_used
|
21
|
+
end
|
22
|
+
|
23
|
+
def self.cast(val)
|
24
|
+
return val if val.is_a? self
|
25
|
+
return nil if val.nil?
|
26
|
+
|
27
|
+
new(
|
28
|
+
daily_debit_limit: val[:limits][:daily_debit],
|
29
|
+
daily_debit_limit_used: val[:totals_daily][:debits],
|
30
|
+
monthly_debit_limit: val[:limits][:monthly_debit],
|
31
|
+
monthly_debit_limit_used: val[:totals_monthly][:debits],
|
32
|
+
daily_credit_limit: val[:limits][:daily_credit],
|
33
|
+
daily_credit_limit_used: val[:totals_daily][:credits],
|
34
|
+
monthly_credit_limit: val[:limits][:monthly_credit],
|
35
|
+
monthly_credit_limit_used: val[:totals_monthly][:credits]
|
36
|
+
)
|
37
|
+
end
|
38
|
+
end
|
39
|
+
end
|
40
|
+
end
|
@@ -0,0 +1,40 @@
|
|
1
|
+
module Unit
|
2
|
+
module Types
|
3
|
+
class CardLimits
|
4
|
+
attr_reader :daily_withdrawal_limit, :daily_withdrawal_limit_used,
|
5
|
+
:daily_deposit_limit, :daily_deposit_limit_used,
|
6
|
+
:daily_purchase_limit, :daily_purchase_limit_used,
|
7
|
+
:daily_transaction_limit, :daily_transaction_limit_used
|
8
|
+
|
9
|
+
def initialize(daily_withdrawal_limit:, daily_withdrawal_limit_used:,
|
10
|
+
daily_deposit_limit:, daily_deposit_limit_used:,
|
11
|
+
daily_purchase_limit:, daily_purchase_limit_used:,
|
12
|
+
daily_transaction_limit:, daily_transaction_limit_used:)
|
13
|
+
@daily_withdrawal_limit = daily_withdrawal_limit
|
14
|
+
@daily_withdrawal_limit_used = daily_withdrawal_limit_used
|
15
|
+
@daily_deposit_limit = daily_deposit_limit
|
16
|
+
@daily_deposit_limit_used = daily_deposit_limit_used
|
17
|
+
@daily_purchase_limit = daily_purchase_limit
|
18
|
+
@daily_purchase_limit_used = daily_purchase_limit_used
|
19
|
+
@daily_transaction_limit = daily_transaction_limit
|
20
|
+
@daily_transaction_limit_used = daily_transaction_limit_used
|
21
|
+
end
|
22
|
+
|
23
|
+
def self.cast(val)
|
24
|
+
return val if val.is_a? self
|
25
|
+
return nil if val.nil?
|
26
|
+
|
27
|
+
new(
|
28
|
+
daily_withdrawal_limit: val[:limits][:daily_withdrawal],
|
29
|
+
daily_withdrawal_limit_used: val[:totals_daily][:withdrawals],
|
30
|
+
daily_deposit_limit: val[:limits][:daily_deposit],
|
31
|
+
daily_deposit_limit_used: val[:totals_daily][:deposits],
|
32
|
+
daily_purchase_limit: val[:limits][:daily_purchase],
|
33
|
+
daily_purchase_limit_used: val[:totals_daily][:purchases],
|
34
|
+
daily_transaction_limit: val[:limits][:daily_card_transaction],
|
35
|
+
daily_transaction_limit_used: val[:totals_daily][:card_transactions]
|
36
|
+
)
|
37
|
+
end
|
38
|
+
end
|
39
|
+
end
|
40
|
+
end
|
@@ -0,0 +1,27 @@
|
|
1
|
+
module Unit
|
2
|
+
module Types
|
3
|
+
class CheckDepositLimits
|
4
|
+
attr_reader :daily_deposit_limit, :daily_deposit_limit_used,
|
5
|
+
:monthly_deposit_limit, :monthly_deposit_limit_used
|
6
|
+
|
7
|
+
def initialize(daily_deposit_limit:, daily_deposit_limit_used:, monthly_deposit_limit:, monthly_deposit_limit_used:)
|
8
|
+
@daily_deposit_limit = daily_deposit_limit
|
9
|
+
@daily_deposit_limit_used = daily_deposit_limit_used
|
10
|
+
@monthly_deposit_limit = monthly_deposit_limit
|
11
|
+
@monthly_deposit_limit_used = monthly_deposit_limit_used
|
12
|
+
end
|
13
|
+
|
14
|
+
def self.cast(val)
|
15
|
+
return val if val.is_a? self
|
16
|
+
return nil if val.nil?
|
17
|
+
|
18
|
+
new(
|
19
|
+
daily_deposit_limit: val[:limits][:daily],
|
20
|
+
daily_deposit_limit_used: val[:totals_daily],
|
21
|
+
monthly_deposit_limit: val[:limits][:monthly],
|
22
|
+
monthly_deposit_limit_used: val[:totals_monthly]
|
23
|
+
)
|
24
|
+
end
|
25
|
+
end
|
26
|
+
end
|
27
|
+
end
|
data/lib/unit-ruby/version.rb
CHANGED
data/lib/unit-ruby.rb
CHANGED
@@ -4,11 +4,15 @@ require 'unit-ruby/util/api_resource'
|
|
4
4
|
require 'unit-ruby/util/resource_operations'
|
5
5
|
require 'unit-ruby/util/schema'
|
6
6
|
|
7
|
+
require 'unit-ruby/types/account_limits'
|
8
|
+
require 'unit-ruby/types/ach_limits'
|
7
9
|
require 'unit-ruby/types/address'
|
8
10
|
require 'unit-ruby/types/application_form_prefill'
|
9
11
|
require 'unit-ruby/types/application_form_settings_override'
|
10
12
|
require 'unit-ruby/types/array'
|
11
13
|
require 'unit-ruby/types/boolean'
|
14
|
+
require 'unit-ruby/types/card_limits'
|
15
|
+
require 'unit-ruby/types/check_deposit_limits'
|
12
16
|
require 'unit-ruby/types/coordinates'
|
13
17
|
require 'unit-ruby/types/counterparty'
|
14
18
|
require 'unit-ruby/types/date_time'
|
@@ -24,6 +28,7 @@ require 'unit-ruby/ach_payment'
|
|
24
28
|
require 'unit-ruby/application_form'
|
25
29
|
require 'unit-ruby/atm_location'
|
26
30
|
require 'unit-ruby/authorization'
|
31
|
+
require 'unit-ruby/ach_counterparty'
|
27
32
|
require 'unit-ruby/customer_token_verification'
|
28
33
|
require 'unit-ruby/customer_token'
|
29
34
|
require 'unit-ruby/deposit_account'
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: unit-ruby
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.7.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Chloe Isacke
|
@@ -9,7 +9,7 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: exe
|
11
11
|
cert_chain: []
|
12
|
-
date: 2024-
|
12
|
+
date: 2024-10-08 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: activesupport
|
@@ -166,6 +166,7 @@ files:
|
|
166
166
|
- bin/console
|
167
167
|
- bin/setup
|
168
168
|
- lib/unit-ruby.rb
|
169
|
+
- lib/unit-ruby/ach_counterparty.rb
|
169
170
|
- lib/unit-ruby/ach_payment.rb
|
170
171
|
- lib/unit-ruby/application_form.rb
|
171
172
|
- lib/unit-ruby/atm_location.rb
|
@@ -182,11 +183,15 @@ files:
|
|
182
183
|
- lib/unit-ruby/pin_status.rb
|
183
184
|
- lib/unit-ruby/statement.rb
|
184
185
|
- lib/unit-ruby/transaction.rb
|
186
|
+
- lib/unit-ruby/types/account_limits.rb
|
187
|
+
- lib/unit-ruby/types/ach_limits.rb
|
185
188
|
- lib/unit-ruby/types/address.rb
|
186
189
|
- lib/unit-ruby/types/application_form_prefill.rb
|
187
190
|
- lib/unit-ruby/types/application_form_settings_override.rb
|
188
191
|
- lib/unit-ruby/types/array.rb
|
189
192
|
- lib/unit-ruby/types/boolean.rb
|
193
|
+
- lib/unit-ruby/types/card_limits.rb
|
194
|
+
- lib/unit-ruby/types/check_deposit_limits.rb
|
190
195
|
- lib/unit-ruby/types/coordinates.rb
|
191
196
|
- lib/unit-ruby/types/counterparty.rb
|
192
197
|
- lib/unit-ruby/types/date.rb
|
@@ -229,7 +234,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
229
234
|
- !ruby/object:Gem::Version
|
230
235
|
version: '0'
|
231
236
|
requirements: []
|
232
|
-
rubygems_version: 3.
|
237
|
+
rubygems_version: 3.2.3
|
233
238
|
signing_key:
|
234
239
|
specification_version: 4
|
235
240
|
summary: A Ruby gem for communicating with the Unit API.
|