zai_payment 2.8.0 → 2.8.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/changelog.md +19 -0
- data/docs/bank_accounts.md +13 -11
- data/examples/bank_accounts.md +3 -3
- data/lib/zai_payment/response.rb +1 -1
- data/lib/zai_payment/version.rb +1 -1
- metadata +6 -3
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 1a1b779cc3a64f6f5d53beabacc7eccbf06bc380c0b58f86f989673a5924b6aa
|
|
4
|
+
data.tar.gz: 5654753fffd844b167c4c10343b34a5d7f6a969ad68c058141647ee20319ea57
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: c433a00fd122c1bf91a7e112438f1df59dd7b35a4554effeadd380f93cf8bcbb0b6593e87e44727c71994c4327792cf1552320a5d71a3d7a87fc6fff90732796
|
|
7
|
+
data.tar.gz: dd2d61c6ca97cf1d02f272b985e3cf568592acfe02912b3f877462dde9d89fb812a904d4cc5c5792806f10731ece2a12f2a594f2a3ba802c4f951a9f193dc81f
|
data/changelog.md
CHANGED
|
@@ -1,5 +1,24 @@
|
|
|
1
1
|
## [Released]
|
|
2
2
|
|
|
3
|
+
## [2.8.1] - 2025-11-07
|
|
4
|
+
|
|
5
|
+
### Fixed
|
|
6
|
+
- **Response Data Extraction Bug**: Fixed `.data` method returning only `routing_number` value instead of full object 🐛
|
|
7
|
+
- Removed `routing_number` from `RESPONSE_DATA_KEYS` constant - it's a field within responses, not a collection wrapper key
|
|
8
|
+
- The `.data` method was incorrectly treating `routing_number` as a top-level data key
|
|
9
|
+
- This caused `response.data` to return just `"803320"` (the routing number) instead of the complete virtual account object
|
|
10
|
+
- Now properly returns the full response object when no wrapper key is found
|
|
11
|
+
- Affected resources: Virtual Accounts (and potentially other resources with `routing_number` field)
|
|
12
|
+
- Updated test mocks to match actual API response format (flat objects for single resources)
|
|
13
|
+
|
|
14
|
+
### Changed
|
|
15
|
+
- **Virtual Account Test Fixtures**: Updated response structure to match actual Zai API format
|
|
16
|
+
- Single resource responses (show, create, update) now return flat objects without wrapper keys
|
|
17
|
+
- Collection responses (list) continue to use `virtual_accounts` wrapper key
|
|
18
|
+
- All 87 virtual account tests passing with corrected response structure
|
|
19
|
+
|
|
20
|
+
**Full Changelog**: https://github.com/Sentia/zai-payment/compare/v2.8.0...v2.8.1
|
|
21
|
+
|
|
3
22
|
## [2.8.0] - 2025-11-07
|
|
4
23
|
|
|
5
24
|
### Added
|
data/docs/bank_accounts.md
CHANGED
|
@@ -117,7 +117,7 @@ Validate a US bank routing number before creating an account. This can be used t
|
|
|
117
117
|
response = bank_accounts.validate_routing_number('122235821')
|
|
118
118
|
|
|
119
119
|
if response.success?
|
|
120
|
-
routing_info = response.data
|
|
120
|
+
routing_info = response.data['routing_number']
|
|
121
121
|
puts "Routing Number: #{routing_info['routing_number']}"
|
|
122
122
|
puts "Bank Name: #{routing_info['customer_name']}"
|
|
123
123
|
puts "City: #{routing_info['city']}"
|
|
@@ -133,16 +133,18 @@ end
|
|
|
133
133
|
|
|
134
134
|
```ruby
|
|
135
135
|
{
|
|
136
|
-
"routing_number" =>
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
136
|
+
"routing_number" => {
|
|
137
|
+
"routing_number" => "122235821",
|
|
138
|
+
"customer_name" => "US BANK NA",
|
|
139
|
+
"address" => "EP-MN-WN1A",
|
|
140
|
+
"city" => "ST. PAUL",
|
|
141
|
+
"state_code" => "MN",
|
|
142
|
+
"zip" => "55107",
|
|
143
|
+
"zip_extension" => "1419",
|
|
144
|
+
"phone_area_code" => "800",
|
|
145
|
+
"phone_prefix" => "937",
|
|
146
|
+
"phone_suffix" => "631"
|
|
147
|
+
}
|
|
146
148
|
}
|
|
147
149
|
```
|
|
148
150
|
|
data/examples/bank_accounts.md
CHANGED
|
@@ -164,7 +164,7 @@ bank_accounts = ZaiPayment::Resources::BankAccount.new
|
|
|
164
164
|
response = bank_accounts.validate_routing_number('122235821')
|
|
165
165
|
|
|
166
166
|
if response.success?
|
|
167
|
-
routing_info = response.data
|
|
167
|
+
routing_info = response.data['routing_number']
|
|
168
168
|
|
|
169
169
|
puts "Routing Number Validation Results:"
|
|
170
170
|
puts " Routing Number: #{routing_info['routing_number']}"
|
|
@@ -197,7 +197,7 @@ begin
|
|
|
197
197
|
validation_response = bank_accounts.validate_routing_number(routing_number)
|
|
198
198
|
|
|
199
199
|
if validation_response.success?
|
|
200
|
-
bank_info = validation_response.data
|
|
200
|
+
bank_info = validation_response.data['routing_number']
|
|
201
201
|
|
|
202
202
|
# Show user the bank information for confirmation
|
|
203
203
|
puts "You are creating an account with:"
|
|
@@ -246,7 +246,7 @@ class BankAccountsController < ApplicationController
|
|
|
246
246
|
response = bank_accounts.validate_routing_number(routing_number)
|
|
247
247
|
|
|
248
248
|
if response.success?
|
|
249
|
-
bank_info = response.data
|
|
249
|
+
bank_info = response.data['routing_number']
|
|
250
250
|
|
|
251
251
|
# Return bank info to display in the form
|
|
252
252
|
render json: {
|
data/lib/zai_payment/response.rb
CHANGED
|
@@ -8,7 +8,7 @@ module ZaiPayment
|
|
|
8
8
|
RESPONSE_DATA_KEYS = %w[
|
|
9
9
|
webhooks users items fees transactions
|
|
10
10
|
batch_transactions batches bpay_accounts bank_accounts card_accounts
|
|
11
|
-
wallet_accounts virtual_accounts
|
|
11
|
+
wallet_accounts virtual_accounts disbursements pay_ids
|
|
12
12
|
].freeze
|
|
13
13
|
|
|
14
14
|
def initialize(faraday_response)
|
data/lib/zai_payment/version.rb
CHANGED
metadata
CHANGED
|
@@ -1,13 +1,14 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: zai_payment
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 2.8.
|
|
4
|
+
version: 2.8.1
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- Eddy Jaga
|
|
8
|
+
autorequire:
|
|
8
9
|
bindir: exe
|
|
9
10
|
cert_chain: []
|
|
10
|
-
date:
|
|
11
|
+
date: 2025-11-07 00:00:00.000000000 Z
|
|
11
12
|
dependencies:
|
|
12
13
|
- !ruby/object:Gem::Dependency
|
|
13
14
|
name: base64
|
|
@@ -129,6 +130,7 @@ metadata:
|
|
|
129
130
|
code_of_conduct_uri: https://github.com/Sentia/zai-payment/blob/main/code_of_conduct.md
|
|
130
131
|
rubygems_mfa_required: 'true'
|
|
131
132
|
documentation_uri: https://github.com/Sentia/zai-payment#readme
|
|
133
|
+
post_install_message:
|
|
132
134
|
rdoc_options: []
|
|
133
135
|
require_paths:
|
|
134
136
|
- lib
|
|
@@ -143,7 +145,8 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
|
143
145
|
- !ruby/object:Gem::Version
|
|
144
146
|
version: '0'
|
|
145
147
|
requirements: []
|
|
146
|
-
rubygems_version: 3.
|
|
148
|
+
rubygems_version: 3.5.22
|
|
149
|
+
signing_key:
|
|
147
150
|
specification_version: 4
|
|
148
151
|
summary: Ruby gem for Zai payment integration
|
|
149
152
|
test_files: []
|