svbclient 2.0.3 → 3.0.1
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/lib/svbclient.rb +43 -0
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: e0d684e3db7b968c35197b58e146a4ec525d050b
|
4
|
+
data.tar.gz: b9528bb2530a7b80e6aeb0b17dffe50cff8abb3a
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: '036623794bbcfd5433ac1cd085ad4247c55c4279921d346e892e5a4dd271f9e5d81dd3021fcef316832ce8c159fe7b9a769269f9f85a210357c91766330a79fe'
|
7
|
+
data.tar.gz: 7b0a9e8987437f0a6824a01c82c93ca21b94ed5a5fa716b290414033e0c9ca2d9554d33baae2d2830357fcc8aa1b4f2769a5b850df71ef1527d474ba68d01989
|
data/lib/svbclient.rb
CHANGED
@@ -85,6 +85,49 @@ class SVBClient
|
|
85
85
|
end
|
86
86
|
end
|
87
87
|
|
88
|
+
class SVBClient::ACH
|
89
|
+
def initialize(client, id)
|
90
|
+
@client = client
|
91
|
+
@id = id
|
92
|
+
end
|
93
|
+
|
94
|
+
def data
|
95
|
+
JSON.parse(@client.get("/v1/ach/#{@id}").body)["data"]
|
96
|
+
end
|
97
|
+
|
98
|
+
def update_status(status)
|
99
|
+
@client.patch("/v1/ach/#{id}", { status: status })
|
100
|
+
end
|
101
|
+
end
|
102
|
+
|
103
|
+
class SVBClient::ACHHandler
|
104
|
+
def initialize(client)
|
105
|
+
raise 'provide an API client' if client.nil?
|
106
|
+
@client = client
|
107
|
+
end
|
108
|
+
|
109
|
+
def create(ach_data)
|
110
|
+
response = @client.post('/v1/ach', ach_data)
|
111
|
+
SVBClient::ACH.new(@client, JSON.parse(response.body)["data"]["id"])
|
112
|
+
end
|
113
|
+
|
114
|
+
def get(id)
|
115
|
+
@client.get("/v1/ach/#{id}")
|
116
|
+
SVBClient::ACH.new(@client, id)
|
117
|
+
end
|
118
|
+
|
119
|
+
def find(status: nil, effective_date: nil)
|
120
|
+
query = ''
|
121
|
+
query += "filter%5Bstatus%5D=#{status}" unless status.nil?
|
122
|
+
query += "filter%5Beffective_date%5D=#{effective_date}" unless effective_date.nil?
|
123
|
+
response = @client.get("/v1/ach", query)
|
124
|
+
list = JSON.parse(response.body)["data"]
|
125
|
+
list.map do |ach|
|
126
|
+
SVBClient::ACH.new(@client, ach["id"])
|
127
|
+
end
|
128
|
+
end
|
129
|
+
end
|
130
|
+
|
88
131
|
class SVBClient::Onboarding
|
89
132
|
def initialize(client)
|
90
133
|
raise 'provide an API client' if client.nil?
|