zai_payment 2.7.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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 510e8e99ba15a794801fbfa54f066f9c9df8037b2b4439f1e4f2a11b19509899
4
- data.tar.gz: 5f699a364d1cc0f50a6e6e36e4a5ffea274a8c7e761dfa01f0f78d71043f9578
3
+ metadata.gz: 1a1b779cc3a64f6f5d53beabacc7eccbf06bc380c0b58f86f989673a5924b6aa
4
+ data.tar.gz: 5654753fffd844b167c4c10343b34a5d7f6a969ad68c058141647ee20319ea57
5
5
  SHA512:
6
- metadata.gz: ad9010a7ed0538881749587f2ea3cf2a7e3bf8dde51f1f2856b62a13726f25ef55c5174dce276c024df5d3ea9f7352a049ad2da29e15495dc7e4b838d08c963a
7
- data.tar.gz: 2d33996bd2e78ab91f8c2ee27f02d9d5d5f0f139cda22141d4c5e0d0d9358c3906872236f13131448da217665db28ed7d3df360119981b9ba87cc11a2acf9ec6
6
+ metadata.gz: c433a00fd122c1bf91a7e112438f1df59dd7b35a4554effeadd380f93cf8bcbb0b6593e87e44727c71994c4327792cf1552320a5d71a3d7a87fc6fff90732796
7
+ data.tar.gz: dd2d61c6ca97cf1d02f272b985e3cf568592acfe02912b3f877462dde9d89fb812a904d4cc5c5792806f10731ece2a12f2a594f2a3ba802c4f951a9f193dc81f
data/badges/coverage.json CHANGED
@@ -1 +1 @@
1
- {"schemaVersion": 1, "label": "coverage", "message": "97.47%", "color": "brightgreen"}
1
+ {"schemaVersion": 1, "label": "coverage", "message": "97.64%", "color": "brightgreen"}
data/changelog.md CHANGED
@@ -1,5 +1,99 @@
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
+
22
+ ## [2.8.0] - 2025-11-07
23
+
24
+ ### Added
25
+ - **Virtual Accounts Resource**: Complete virtual account management for Australian payments 🏦
26
+ - `ZaiPayment.virtual_accounts.list(wallet_account_id)` - List all virtual accounts for a wallet account
27
+ - `ZaiPayment.virtual_accounts.show(virtual_account_id)` - Get virtual account details
28
+ - `ZaiPayment.virtual_accounts.create(wallet_account_id, account_name:, aka_names:)` - Create virtual account for a wallet account
29
+ - `ZaiPayment.virtual_accounts.update_aka_names(virtual_account_id, aka_names)` - Update AKA names (0-3 items)
30
+ - `ZaiPayment.virtual_accounts.update_account_name(virtual_account_id, account_name)` - Update account name (used in CoP lookups)
31
+ - `ZaiPayment.virtual_accounts.update_status(virtual_account_id, status)` - Close a virtual account (status: 'closed')
32
+ - Support for AKA names for account aliases
33
+ - Support for Confirmation of Payee (CoP) lookups via account names
34
+ - Validation for account names (max 140 characters)
35
+ - Validation for AKA names (0-3 items)
36
+ - Full RSpec test suite with 65+ test examples
37
+ - Comprehensive documentation in `docs/virtual_accounts.md`
38
+ - Practical examples in `examples/virtual_accounts.md`
39
+
40
+ - **PayID Resource**: PayID registration management for Australian NPP payments 💳
41
+ - `ZaiPayment.pay_ids.create(virtual_account_id, pay_id:, type:, details:)` - Register a PayID for a virtual account
42
+ - `ZaiPayment.pay_ids.show(pay_id_id)` - Get PayID details including status
43
+ - `ZaiPayment.pay_ids.update_status(pay_id_id, status)` - Deregister a PayID (status: 'deregistered')
44
+ - Support for EMAIL PayID type
45
+ - Validation for PayID format (max 256 characters)
46
+ - Validation for details (pay_id_name and owner_legal_name, 1-140 characters each)
47
+ - Asynchronous status update with 202 Accepted response
48
+ - Full RSpec test suite with 35+ test examples
49
+ - Comprehensive documentation in `docs/pay_ids.md`
50
+ - Practical examples in `examples/pay_ids.md`
51
+
52
+ ### Documentation
53
+ - **Virtual Accounts Guide** (`docs/virtual_accounts.md`):
54
+ - Complete guide for all 6 virtual account endpoints
55
+ - Detailed workflow for account creation and management
56
+ - AKA names for account aliases
57
+ - Account name updates for CoP lookups
58
+ - Status updates for closing accounts
59
+ - Error handling patterns
60
+ - Comprehensive use cases
61
+
62
+ - **Virtual Accounts Examples** (`examples/virtual_accounts.md`):
63
+ - List virtual accounts examples
64
+ - Show virtual account examples
65
+ - Create virtual account examples
66
+ - Update AKA names examples
67
+ - Update account name examples
68
+ - Update status (close account) examples
69
+ - Complete workflow patterns
70
+ - Rails integration examples
71
+
72
+ - **PayID Guide** (`docs/pay_ids.md`):
73
+ - Complete guide for all 3 PayID endpoints
74
+ - PayID registration with EMAIL type
75
+ - PayID format validation rules
76
+ - Status updates for deregistration
77
+ - Integration with virtual accounts
78
+ - Error handling patterns
79
+ - Comprehensive use cases
80
+
81
+ - **PayID Examples** (`examples/pay_ids.md`):
82
+ - Register PayID examples
83
+ - Show PayID examples
84
+ - Update status (deregister) examples
85
+ - Complete workflow patterns
86
+ - Rails integration examples
87
+
88
+ ### Enhanced
89
+ - **README.md**:
90
+ - Added Virtual Accounts to features section
91
+ - Added PayID to features section
92
+ - Added documentation links to virtual accounts and PayID guides
93
+ - Updated roadmap to mark Virtual Accounts and PayID as Done
94
+
95
+ **Full Changelog**: https://github.com/Sentia/zai-payment/compare/v2.7.0...v2.8.0
96
+
3
97
  ## [2.7.0] - 2025-11-04
4
98
 
5
99
  ### Added
@@ -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" => "122235821",
137
- "customer_name" => "US BANK NA",
138
- "address" => "EP-MN-WN1A",
139
- "city" => "ST. PAUL",
140
- "state_code" => "MN",
141
- "zip" => "55107",
142
- "zip_extension" => "1419",
143
- "phone_area_code" => "800",
144
- "phone_prefix" => "937",
145
- "phone_suffix" => "631"
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