unit-ruby 0.2.0 → 0.2.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 +4 -4
- data/Gemfile.lock +6 -6
- data/README.md +1 -0
- data/lib/unit-ruby/ach_payment.rb +1 -0
- data/lib/unit-ruby/types/address.rb +19 -3
- data/lib/unit-ruby/util/connection.rb +2 -1
- data/lib/unit-ruby/version.rb +1 -1
- data/lib/unit-ruby.rb +1 -0
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: a6cb6013957f5fb86b11a7112b26b4d012c5cba20a35d214667be9f4cc352057
|
4
|
+
data.tar.gz: 299368d998697e2522f914cc68adf61bae766231dc2c5ce3b3b273d8765e87ad
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 965abcbb2f9fd0f214b50560f06d73b70e9e1e50be2a74d9d90de62a391136cd7501c6fcb04290181048b3683e55e0062a60dc43f16d857d8b8ece2f0de3f748
|
7
|
+
data.tar.gz: 377c38ccff1bcbc1f5065057960ed518832037e89aba038f5d9fd73f54451594290750fdc800e11458666a1d1aa41526b777e0b4a86be9ed0dfd7f34bcd6bb8d
|
data/Gemfile.lock
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
PATH
|
2
2
|
remote: .
|
3
3
|
specs:
|
4
|
-
unit-ruby (0.2.
|
4
|
+
unit-ruby (0.2.3)
|
5
5
|
activesupport
|
6
6
|
faraday (~> 1.8.0)
|
7
7
|
faraday_middleware (~> 1.0.0)
|
@@ -9,7 +9,7 @@ PATH
|
|
9
9
|
GEM
|
10
10
|
remote: https://rubygems.org/
|
11
11
|
specs:
|
12
|
-
activesupport (6.1.
|
12
|
+
activesupport (6.1.5)
|
13
13
|
concurrent-ruby (~> 1.0, >= 1.0.2)
|
14
14
|
i18n (>= 1.6, < 2)
|
15
15
|
minitest (>= 5.1)
|
@@ -17,7 +17,7 @@ GEM
|
|
17
17
|
zeitwerk (~> 2.3)
|
18
18
|
ast (2.4.2)
|
19
19
|
coderay (1.1.3)
|
20
|
-
concurrent-ruby (1.1.
|
20
|
+
concurrent-ruby (1.1.10)
|
21
21
|
diff-lcs (1.5.0)
|
22
22
|
dotenv (2.7.6)
|
23
23
|
faraday (1.8.0)
|
@@ -41,10 +41,10 @@ GEM
|
|
41
41
|
faraday-rack (1.0.0)
|
42
42
|
faraday_middleware (1.0.0)
|
43
43
|
faraday (~> 1.0)
|
44
|
-
i18n (1.
|
44
|
+
i18n (1.10.0)
|
45
45
|
concurrent-ruby (~> 1.0)
|
46
46
|
method_source (1.0.0)
|
47
|
-
minitest (5.
|
47
|
+
minitest (5.15.0)
|
48
48
|
multipart-post (2.1.1)
|
49
49
|
parallel (1.21.0)
|
50
50
|
parser (3.1.0.0)
|
@@ -85,7 +85,7 @@ GEM
|
|
85
85
|
tzinfo (2.0.4)
|
86
86
|
concurrent-ruby (~> 1.0)
|
87
87
|
unicode-display_width (2.1.0)
|
88
|
-
zeitwerk (2.4
|
88
|
+
zeitwerk (2.5.4)
|
89
89
|
|
90
90
|
PLATFORMS
|
91
91
|
ruby
|
data/README.md
CHANGED
@@ -12,6 +12,7 @@ module Unit
|
|
12
12
|
attribute :verify_counterparty_balance, Types::Hash # Optional
|
13
13
|
|
14
14
|
attribute :status, Types::String, readonly: true
|
15
|
+
attribute :reason, Types::String, readonly: true
|
15
16
|
attribute :settlement_date, Types::DateTime, readonly: true
|
16
17
|
attribute :created_at, Types::DateTime, readonly: true
|
17
18
|
|
@@ -1,10 +1,18 @@
|
|
1
1
|
module Unit
|
2
2
|
module Types
|
3
3
|
class Address
|
4
|
-
attr_reader :street, :city, :state, :postal_code, :country
|
4
|
+
attr_reader :street, :street2, :city, :state, :postal_code, :country
|
5
5
|
|
6
|
-
def initialize(
|
6
|
+
def initialize(
|
7
|
+
street:,
|
8
|
+
city:,
|
9
|
+
state:,
|
10
|
+
postal_code:,
|
11
|
+
country:,
|
12
|
+
street2: nil
|
13
|
+
)
|
7
14
|
@street = street
|
15
|
+
@street2 = street2
|
8
16
|
@city = city
|
9
17
|
@state = state
|
10
18
|
@postal_code = postal_code
|
@@ -17,6 +25,7 @@ module Unit
|
|
17
25
|
|
18
26
|
new(
|
19
27
|
street: val[:street],
|
28
|
+
street2: val[:street2],
|
20
29
|
city: val[:city],
|
21
30
|
state: val[:state],
|
22
31
|
postal_code: val[:postal_code],
|
@@ -25,7 +34,14 @@ module Unit
|
|
25
34
|
end
|
26
35
|
|
27
36
|
def as_json_api
|
28
|
-
{
|
37
|
+
{
|
38
|
+
street: street,
|
39
|
+
street2: street2,
|
40
|
+
city: city,
|
41
|
+
state: state,
|
42
|
+
postal_code: postal_code,
|
43
|
+
country: country
|
44
|
+
}.compact
|
29
45
|
end
|
30
46
|
end
|
31
47
|
end
|
@@ -5,13 +5,14 @@ require 'active_support/core_ext/hash'
|
|
5
5
|
module Unit
|
6
6
|
class Connection
|
7
7
|
class << self
|
8
|
-
attr_accessor :api_key, :base_url
|
8
|
+
attr_accessor :api_key, :base_url, :trust_token
|
9
9
|
end
|
10
10
|
|
11
11
|
attr_reader :connection
|
12
12
|
|
13
13
|
def initialize
|
14
14
|
@connection = Faraday.new(self.class.base_url) do |f|
|
15
|
+
f.headers['UNIT_TRUST_TOKEN'] = self.class.trust_token if self.class.trust_token
|
15
16
|
f.headers['Authorization'] = "Bearer #{self.class.api_key}"
|
16
17
|
f.request :json # encode req bodies as JSON
|
17
18
|
f.request :retry # retry transient failures
|
data/lib/unit-ruby/version.rb
CHANGED
data/lib/unit-ruby.rb
CHANGED
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.2.
|
4
|
+
version: 0.2.3
|
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: 2022-
|
12
|
+
date: 2022-04-06 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: activesupport
|