zai_payment 2.1.0 → 2.2.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/badges/coverage.json +1 -1
- data/changelog.md +47 -0
- data/docs/users.md +300 -3
- data/examples/rails_card_payment.md +716 -0
- data/lib/zai_payment/resources/user.rb +131 -3
- data/lib/zai_payment/response.rb +10 -4
- data/lib/zai_payment/version.rb +1 -1
- data/readme.md +24 -0
- metadata +3 -2
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 4711fe7ce837e63205c63cdacf15dd79ab6ac310c23cffd48dac60a3770fcb4f
|
|
4
|
+
data.tar.gz: 7de103d746c51bb8951f0c7d330ef8b05b6b69abcf15c8f170d275baa7bdb3e0
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 63ee9160f09c7e1170cd601fbe2106c026b99077afb52692bd7f1089d061aae2b0a8d91ee2471c059b270c0fdd69b4799bc9c05e5807ec2cd3ca513b6bc069b6
|
|
7
|
+
data.tar.gz: 4344ee075e93a036ffaf4b525ec15d4bc38dc4d00f2a2391a0bc7020c684e7255ac5b2c1584ac87c84ade8c8868bef3a0f831851ff11063da0cc1c67b24f023f
|
data/badges/coverage.json
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"schemaVersion": 1, "label": "coverage", "message": "
|
|
1
|
+
{"schemaVersion": 1, "label": "coverage", "message": "96.15%", "color": "brightgreen"}
|
data/changelog.md
CHANGED
|
@@ -1,4 +1,51 @@
|
|
|
1
1
|
## [Released]
|
|
2
|
+
## [2.2.0] - 2025-10-24
|
|
3
|
+
### Added
|
|
4
|
+
- **Extended User Management API**: 7 new user-related endpoints 🚀
|
|
5
|
+
- `ZaiPayment.users.wallet_account(user_id)` - Show user's wallet account details
|
|
6
|
+
- `ZaiPayment.users.items(user_id, limit:, offset:)` - List items associated with user (paginated)
|
|
7
|
+
- `ZaiPayment.users.set_disbursement_account(user_id, account_id)` - Set user's disbursement account
|
|
8
|
+
- `ZaiPayment.users.bank_account(user_id)` - Show user's active bank account
|
|
9
|
+
- `ZaiPayment.users.verify(user_id)` - Verify user (prelive environment only)
|
|
10
|
+
- `ZaiPayment.users.card_account(user_id)` - Show user's active card account
|
|
11
|
+
- `ZaiPayment.users.bpay_accounts(user_id)` - List user's BPay accounts
|
|
12
|
+
- All endpoints include comprehensive nested data structures:
|
|
13
|
+
- Bank accounts with nested `bank` details (account_name, routing_number, account_type, holder_type)
|
|
14
|
+
- Card accounts with nested `card` details (type, full_name, masked number, expiry)
|
|
15
|
+
- BPay accounts with nested `bpay_details` (biller_code, biller_name, CRN, account_name)
|
|
16
|
+
- Items with full transaction details (buyer/seller info, payment_type, status, links to related resources)
|
|
17
|
+
- Validation for all user_id and account_id parameters
|
|
18
|
+
- Links to related resources included in all responses
|
|
19
|
+
|
|
20
|
+
### Enhanced
|
|
21
|
+
- **Response Class Refactoring**: Improved data extraction logic
|
|
22
|
+
- Replaced complex conditional chain with iterative approach using `RESPONSE_DATA_KEYS` constant
|
|
23
|
+
- Added support for new data keys: `bpay_accounts`, `bank_accounts`, `card_accounts`
|
|
24
|
+
- Reduced complexity metrics (ABC, Cyclomatic, Perceived Complexity)
|
|
25
|
+
- More maintainable and extensible architecture
|
|
26
|
+
- **User Creation Validation**: Made `user_type` a required field
|
|
27
|
+
- Added validation to ensure `user_type` ('payin' or 'payout') is specified when creating users
|
|
28
|
+
- Improved error messages for missing required fields
|
|
29
|
+
- Enhanced test suite with compact, readable validation tests
|
|
30
|
+
|
|
31
|
+
### Documentation
|
|
32
|
+
- **Updated User Management Guide** (`docs/users.md`):
|
|
33
|
+
- Comprehensive examples for all 7 new endpoints
|
|
34
|
+
- Complete response structures with real API data
|
|
35
|
+
- Detailed field access patterns for nested objects
|
|
36
|
+
- Pagination examples for list endpoints
|
|
37
|
+
- Related resource link usage examples
|
|
38
|
+
- **Updated README.md**:
|
|
39
|
+
- Added quick reference for all new endpoints
|
|
40
|
+
- Updated user management section with complete API surface
|
|
41
|
+
- Real API response examples integrated for:
|
|
42
|
+
- List User Items (with buyer/seller details, transaction links)
|
|
43
|
+
- List User's BPay Accounts (with biller details, verification status)
|
|
44
|
+
- Show User Bank Account (with bank details, direct debit authorities)
|
|
45
|
+
- Show User Card Account (with card details, CVV verification status)
|
|
46
|
+
|
|
47
|
+
**Full Changelog**: https://github.com/Sentia/zai-payment/compare/v2.1.0...v2.2.0
|
|
48
|
+
|
|
2
49
|
## [2.1.0] - 2025-10-24
|
|
3
50
|
### Added
|
|
4
51
|
- **Token Auth API**: Token generation for bank and card accounts 🔐
|
data/docs/users.md
CHANGED
|
@@ -65,6 +65,7 @@ Create a new payin user who will make payments on your platform.
|
|
|
65
65
|
|
|
66
66
|
#### Required Fields for Payin Users
|
|
67
67
|
|
|
68
|
+
- `user_type` - User type (must be 'payin')
|
|
68
69
|
- `email` - User's email address
|
|
69
70
|
- `first_name` - User's first name
|
|
70
71
|
- `last_name` - User's last name
|
|
@@ -85,6 +86,7 @@ Create a new payin user who will make payments on your platform.
|
|
|
85
86
|
|
|
86
87
|
```ruby
|
|
87
88
|
response = ZaiPayment.users.create(
|
|
89
|
+
user_type: 'payin',
|
|
88
90
|
email: 'buyer@example.com',
|
|
89
91
|
first_name: 'John',
|
|
90
92
|
last_name: 'Doe',
|
|
@@ -108,6 +110,7 @@ Create a new payout user who will receive payments. Payout users must undergo ve
|
|
|
108
110
|
|
|
109
111
|
#### Required Fields for Payout Users (Individuals)
|
|
110
112
|
|
|
113
|
+
- `user_type` - User type (must be 'payout')
|
|
111
114
|
- `email` - User's email address
|
|
112
115
|
- `first_name` - User's first name
|
|
113
116
|
- `last_name` - User's last name
|
|
@@ -122,6 +125,7 @@ Create a new payout user who will receive payments. Payout users must undergo ve
|
|
|
122
125
|
|
|
123
126
|
```ruby
|
|
124
127
|
response = ZaiPayment.users.create(
|
|
128
|
+
user_type: 'payout',
|
|
125
129
|
email: 'seller@example.com',
|
|
126
130
|
first_name: 'Jane',
|
|
127
131
|
last_name: 'Smith',
|
|
@@ -157,6 +161,297 @@ response = ZaiPayment.users.update(
|
|
|
157
161
|
updated_user = response.data
|
|
158
162
|
```
|
|
159
163
|
|
|
164
|
+
### Show User Wallet Account
|
|
165
|
+
|
|
166
|
+
Show the user's wallet account using a given user ID.
|
|
167
|
+
|
|
168
|
+
```ruby
|
|
169
|
+
response = ZaiPayment.users.wallet_account('user_id')
|
|
170
|
+
|
|
171
|
+
wallet = response.data
|
|
172
|
+
puts wallet['id']
|
|
173
|
+
puts wallet['balance']
|
|
174
|
+
puts wallet['currency']
|
|
175
|
+
```
|
|
176
|
+
|
|
177
|
+
### List User Items
|
|
178
|
+
|
|
179
|
+
Retrieve an ordered and paginated list of existing items the user is associated with.
|
|
180
|
+
|
|
181
|
+
```ruby
|
|
182
|
+
# List items with default pagination (limit: 10, offset: 0)
|
|
183
|
+
response = ZaiPayment.users.items('user_id')
|
|
184
|
+
|
|
185
|
+
# List items with custom pagination
|
|
186
|
+
response = ZaiPayment.users.items('user_id', limit: 50, offset: 10)
|
|
187
|
+
|
|
188
|
+
# Access the items
|
|
189
|
+
response.data.each do |item|
|
|
190
|
+
puts "Item ID: #{item['id']}"
|
|
191
|
+
puts "Name: #{item['name']}"
|
|
192
|
+
puts "Description: #{item['description']}"
|
|
193
|
+
puts "Amount: #{item['amount']} #{item['currency']}"
|
|
194
|
+
puts "State: #{item['state']}"
|
|
195
|
+
puts "Status: #{item['status']}"
|
|
196
|
+
puts "Payment Type: #{item['payment_type_id']}"
|
|
197
|
+
|
|
198
|
+
# Buyer information
|
|
199
|
+
puts "Buyer: #{item['buyer_name']} (#{item['buyer_country']})"
|
|
200
|
+
puts "Buyer Email: #{item['buyer_email']}"
|
|
201
|
+
|
|
202
|
+
# Seller information
|
|
203
|
+
puts "Seller: #{item['seller_name']} (#{item['seller_country']})"
|
|
204
|
+
puts "Seller Email: #{item['seller_email']}"
|
|
205
|
+
|
|
206
|
+
# Access related resource links
|
|
207
|
+
puts "Transactions URL: #{item['links']['transactions']}"
|
|
208
|
+
puts "Fees URL: #{item['links']['fees']}"
|
|
209
|
+
end
|
|
210
|
+
|
|
211
|
+
# Access pagination metadata
|
|
212
|
+
puts "Total items: #{response.meta['total']}"
|
|
213
|
+
puts "Limit: #{response.meta['limit']}"
|
|
214
|
+
puts "Offset: #{response.meta['offset']}"
|
|
215
|
+
```
|
|
216
|
+
|
|
217
|
+
**Response Structure:**
|
|
218
|
+
|
|
219
|
+
```ruby
|
|
220
|
+
{
|
|
221
|
+
"items" => [
|
|
222
|
+
{
|
|
223
|
+
"id" => "7139651-1-2046",
|
|
224
|
+
"name" => "Item 7139651-1-2046",
|
|
225
|
+
"description" => "Test Item 7139651-1-2046",
|
|
226
|
+
"created_at" => "2020-05-05T12:26:50.782Z",
|
|
227
|
+
"updated_at" => "2020-05-05T12:31:03.654Z",
|
|
228
|
+
"state" => "payment_deposited",
|
|
229
|
+
"payment_type_id" => 2,
|
|
230
|
+
"status" => 22200,
|
|
231
|
+
"amount" => 109,
|
|
232
|
+
"deposit_reference" => "100014012501482",
|
|
233
|
+
"buyer_name" => "Buyer Last Name",
|
|
234
|
+
"buyer_country" => "AUS",
|
|
235
|
+
"buyer_email" => "assemblybuyer71391895@assemblypayments.com",
|
|
236
|
+
"seller_name" => "Assembly seller71391950",
|
|
237
|
+
"seller_country" => "AUS",
|
|
238
|
+
"seller_email" => "neol_seller71391950@assemblypayments.com",
|
|
239
|
+
"tds_check_state" => "NA",
|
|
240
|
+
"currency" => "AUD",
|
|
241
|
+
"links" => {
|
|
242
|
+
"self" => "/items/7139651-1-2046",
|
|
243
|
+
"buyers" => "/items/7139651-1-2046/buyers",
|
|
244
|
+
"sellers" => "/items/7139651-1-2046/sellers",
|
|
245
|
+
"status" => "/items/7139651-1-2046/status",
|
|
246
|
+
"fees" => "/items/7139651-1-2046/fees",
|
|
247
|
+
"transactions" => "/items/7139651-1-2046/transactions",
|
|
248
|
+
"batch_transactions" => "/items/7139651-1-2046/batch_transactions",
|
|
249
|
+
"wire_details" => "/items/7139651-1-2046/wire_details",
|
|
250
|
+
"bpay_details" => "/items/7139651-1-2046/bpay_details"
|
|
251
|
+
}
|
|
252
|
+
}
|
|
253
|
+
],
|
|
254
|
+
"meta" => {
|
|
255
|
+
"limit" => 10,
|
|
256
|
+
"offset" => 0,
|
|
257
|
+
"total" => 1
|
|
258
|
+
}
|
|
259
|
+
}
|
|
260
|
+
```
|
|
261
|
+
|
|
262
|
+
### Set User Disbursement Account
|
|
263
|
+
|
|
264
|
+
Set the user's disbursement account using a given user ID and bank account ID.
|
|
265
|
+
|
|
266
|
+
```ruby
|
|
267
|
+
response = ZaiPayment.users.set_disbursement_account('user_id', 'bank_account_id')
|
|
268
|
+
|
|
269
|
+
puts "Disbursement account set: #{response.data['disbursement_account_id']}"
|
|
270
|
+
```
|
|
271
|
+
|
|
272
|
+
### Show User Bank Account
|
|
273
|
+
|
|
274
|
+
Show the user's active bank account using a given user ID.
|
|
275
|
+
|
|
276
|
+
```ruby
|
|
277
|
+
response = ZaiPayment.users.bank_account('user_id')
|
|
278
|
+
|
|
279
|
+
# Access bank account details
|
|
280
|
+
account = response.data
|
|
281
|
+
puts "Account ID: #{account['id']}"
|
|
282
|
+
puts "Active: #{account['active']}"
|
|
283
|
+
puts "Verification Status: #{account['verification_status']}"
|
|
284
|
+
puts "Currency: #{account['currency']}"
|
|
285
|
+
|
|
286
|
+
# Access nested bank details
|
|
287
|
+
bank = account['bank']
|
|
288
|
+
puts "Bank Name: #{bank['bank_name']}"
|
|
289
|
+
puts "Country: #{bank['country']}"
|
|
290
|
+
puts "Account Name: #{bank['account_name']}"
|
|
291
|
+
puts "Routing Number: #{bank['routing_number']}"
|
|
292
|
+
puts "Account Number: #{bank['account_number']}"
|
|
293
|
+
puts "Holder Type: #{bank['holder_type']}"
|
|
294
|
+
puts "Account Type: #{bank['account_type']}"
|
|
295
|
+
|
|
296
|
+
# Access related resource links
|
|
297
|
+
puts "Self URL: #{account['links']['self']}"
|
|
298
|
+
puts "Users URL: #{account['links']['users']}"
|
|
299
|
+
```
|
|
300
|
+
|
|
301
|
+
**Response Structure:**
|
|
302
|
+
|
|
303
|
+
```ruby
|
|
304
|
+
{
|
|
305
|
+
"bank_accounts" => {
|
|
306
|
+
"id" => "46deb476-c1a6-41eb-8eb7-26a695bbe5bc",
|
|
307
|
+
"created_at" => "2016-04-12T09:20:38.540Z",
|
|
308
|
+
"updated_at" => "2016-04-12T09:20:38.540Z",
|
|
309
|
+
"active" => true,
|
|
310
|
+
"verification_status" => "not_verified",
|
|
311
|
+
"currency" => "AUD",
|
|
312
|
+
"bank" => {
|
|
313
|
+
"bank_name" => "Bank of Australia",
|
|
314
|
+
"country" => "AUS",
|
|
315
|
+
"account_name" => "Samuel Seller",
|
|
316
|
+
"routing_number" => "XXXXX3",
|
|
317
|
+
"account_number" => "XXX234",
|
|
318
|
+
"holder_type" => "personal",
|
|
319
|
+
"account_type" => "checking",
|
|
320
|
+
"direct_debit_authority_status" => nil
|
|
321
|
+
},
|
|
322
|
+
"links" => {
|
|
323
|
+
"self" => "/users/46deb476-c1a6-41eb-8eb7-26a695bbe5bc/bank_accounts",
|
|
324
|
+
"users" => "/bank_accounts/46deb476-c1a6-41eb-8eb7-26a695bbe5bc/users",
|
|
325
|
+
"direct_debit_authorities" => "/bank_accounts/46deb476-c1a6-41eb-8eb7-26a695bbe5bc/direct_debit_authorities"
|
|
326
|
+
}
|
|
327
|
+
}
|
|
328
|
+
}
|
|
329
|
+
```
|
|
330
|
+
|
|
331
|
+
### Verify User (Prelive Only)
|
|
332
|
+
|
|
333
|
+
Sets a user's verification state to approved on pre-live environment. This endpoint only works in the pre-live environment. The user verification workflow holds for all users in production.
|
|
334
|
+
|
|
335
|
+
```ruby
|
|
336
|
+
response = ZaiPayment.users.verify('user_id')
|
|
337
|
+
|
|
338
|
+
puts "User verified: #{response.data['verification_state']}"
|
|
339
|
+
```
|
|
340
|
+
|
|
341
|
+
**Note:** This is only available in the pre-live/test environment and will not work in production.
|
|
342
|
+
|
|
343
|
+
### Show User Card Account
|
|
344
|
+
|
|
345
|
+
Show the user's active card account using a given user ID.
|
|
346
|
+
|
|
347
|
+
```ruby
|
|
348
|
+
response = ZaiPayment.users.card_account('user_id')
|
|
349
|
+
|
|
350
|
+
# Access card account details
|
|
351
|
+
account = response.data
|
|
352
|
+
puts "Account ID: #{account['id']}"
|
|
353
|
+
puts "Active: #{account['active']}"
|
|
354
|
+
puts "Verification Status: #{account['verification_status']}"
|
|
355
|
+
puts "CVV Verified: #{account['cvv_verified']}"
|
|
356
|
+
puts "Currency: #{account['currency']}"
|
|
357
|
+
|
|
358
|
+
# Access nested card details
|
|
359
|
+
card = account['card']
|
|
360
|
+
puts "Card Type: #{card['type']}"
|
|
361
|
+
puts "Cardholder Name: #{card['full_name']}"
|
|
362
|
+
puts "Card Number: #{card['number']}"
|
|
363
|
+
puts "Expiry: #{card['expiry_month']}/#{card['expiry_year']}"
|
|
364
|
+
|
|
365
|
+
# Access related resource links
|
|
366
|
+
puts "Self URL: #{account['links']['self']}"
|
|
367
|
+
puts "Users URL: #{account['links']['users']}"
|
|
368
|
+
```
|
|
369
|
+
|
|
370
|
+
**Response Structure:**
|
|
371
|
+
|
|
372
|
+
```ruby
|
|
373
|
+
{
|
|
374
|
+
"card_accounts" => {
|
|
375
|
+
"active" => true,
|
|
376
|
+
"created_at" => "2020-05-06T01:38:29.022Z",
|
|
377
|
+
"updated_at" => "2020-05-06T01:38:29.022Z",
|
|
378
|
+
"id" => "35977230-7168-0138-0a1d-0a58a9feac07",
|
|
379
|
+
"verification_status" => "not_verified",
|
|
380
|
+
"cvv_verified" => true,
|
|
381
|
+
"currency" => "AUD",
|
|
382
|
+
"card" => {
|
|
383
|
+
"type" => "visa",
|
|
384
|
+
"full_name" => "Neol Test",
|
|
385
|
+
"number" => "XXXX-XXXX-XXXX-1111",
|
|
386
|
+
"expiry_month" => "7",
|
|
387
|
+
"expiry_year" => "2021"
|
|
388
|
+
},
|
|
389
|
+
"links" => {
|
|
390
|
+
"self" => "/users/buyer-71439598/card_accounts",
|
|
391
|
+
"users" => "/card_accounts/35977230-7168-0138-0a1d-0a58a9feac07/users"
|
|
392
|
+
}
|
|
393
|
+
}
|
|
394
|
+
}
|
|
395
|
+
```
|
|
396
|
+
|
|
397
|
+
### List User's BPay Accounts
|
|
398
|
+
|
|
399
|
+
List the BPay accounts the user is associated with using a given user ID.
|
|
400
|
+
|
|
401
|
+
```ruby
|
|
402
|
+
response = ZaiPayment.users.bpay_accounts('user_id')
|
|
403
|
+
|
|
404
|
+
# Access the BPay accounts
|
|
405
|
+
response.data.each do |account|
|
|
406
|
+
puts "BPay Account ID: #{account['id']}"
|
|
407
|
+
puts "Active: #{account['active']}"
|
|
408
|
+
puts "Verification Status: #{account['verification_status']}"
|
|
409
|
+
|
|
410
|
+
# Access BPay details
|
|
411
|
+
details = account['bpay_details']
|
|
412
|
+
puts "Biller Name: #{details['biller_name']}"
|
|
413
|
+
puts "Biller Code: #{details['biller_code']}"
|
|
414
|
+
puts "Account Name: #{details['account_name']}"
|
|
415
|
+
puts "CRN: #{details['crn']}"
|
|
416
|
+
puts "Currency: #{account['currency']}"
|
|
417
|
+
end
|
|
418
|
+
|
|
419
|
+
# Access pagination metadata
|
|
420
|
+
puts "Total accounts: #{response.meta['total']}"
|
|
421
|
+
```
|
|
422
|
+
|
|
423
|
+
**Response Structure:**
|
|
424
|
+
|
|
425
|
+
```ruby
|
|
426
|
+
{
|
|
427
|
+
"bpay_accounts" => [
|
|
428
|
+
{
|
|
429
|
+
"id" => "b0980390-ac5b-0138-8b2e-0a58a9feac03",
|
|
430
|
+
"active" => true,
|
|
431
|
+
"created_at" => "2020-07-20 02:07:33.583000+00:00",
|
|
432
|
+
"updated_at" => "2020-07-20 02:07:33.583000+00:00",
|
|
433
|
+
"bpay_details" => {
|
|
434
|
+
"biller_name" => "APIBCD AV4",
|
|
435
|
+
"account_name" => "Test Biller",
|
|
436
|
+
"biller_code" => "93815",
|
|
437
|
+
"crn" => "613295205"
|
|
438
|
+
},
|
|
439
|
+
"currency" => "AUD",
|
|
440
|
+
"verification_status" => "verified",
|
|
441
|
+
"links" => {
|
|
442
|
+
"self" => "/bpay_accounts/b0980390-ac5b-0138-8b2e-0a58a9feac03",
|
|
443
|
+
"users" => "/bpay_accounts/b0980390-ac5b-0138-8b2e-0a58a9feac03/users"
|
|
444
|
+
}
|
|
445
|
+
}
|
|
446
|
+
],
|
|
447
|
+
"meta" => {
|
|
448
|
+
"limit" => 10,
|
|
449
|
+
"offset" => 0,
|
|
450
|
+
"total" => 1
|
|
451
|
+
}
|
|
452
|
+
}
|
|
453
|
+
```
|
|
454
|
+
|
|
160
455
|
### Create Business User with Company
|
|
161
456
|
|
|
162
457
|
Create a payout user representing a business entity with full company details. This is useful for merchants, marketplace sellers, or any business that needs to receive payments.
|
|
@@ -175,6 +470,7 @@ When the `company` parameter is provided, the following fields are required:
|
|
|
175
470
|
```ruby
|
|
176
471
|
response = ZaiPayment.users.create(
|
|
177
472
|
# Personal details (authorized signer)
|
|
473
|
+
user_type: 'payout',
|
|
178
474
|
email: 'john.director@example.com',
|
|
179
475
|
first_name: 'John',
|
|
180
476
|
last_name: 'Smith',
|
|
@@ -214,6 +510,7 @@ puts "Company: #{user['company']['name']}"
|
|
|
214
510
|
|
|
215
511
|
| Field | Type | Description | Payin Required | Payout Required |
|
|
216
512
|
|-------|------|-------------|----------------|-----------------|
|
|
513
|
+
| `user_type` | String | User type ('payin' or 'payout') | ✓ | ✓ |
|
|
217
514
|
| `email` | String | User's email address | ✓ | ✓ |
|
|
218
515
|
| `first_name` | String | User's first name | ✓ | ✓ |
|
|
219
516
|
| `last_name` | String | User's last name | ✓ | ✓ |
|
|
@@ -237,7 +534,6 @@ puts "Company: #{user['company']['name']}"
|
|
|
237
534
|
| `company` | Object | Company details (see below) | Optional | Optional |
|
|
238
535
|
| `device_id` | String | Device ID for fraud prevention | When charging* | N/A |
|
|
239
536
|
| `ip_address` | String | IP address for fraud prevention | When charging* | N/A |
|
|
240
|
-
| `user_type` | String | 'payin' or 'payout' | Optional | Optional |
|
|
241
537
|
|
|
242
538
|
\* Required when an item is created and a card is charged
|
|
243
539
|
|
|
@@ -339,6 +635,7 @@ response.meta # => Pagination metadata (for list)
|
|
|
339
635
|
```ruby
|
|
340
636
|
# Step 1: Create a payin user with minimal info
|
|
341
637
|
response = ZaiPayment.users.create(
|
|
638
|
+
user_type: 'payin',
|
|
342
639
|
email: 'buyer@example.com',
|
|
343
640
|
first_name: 'John',
|
|
344
641
|
last_name: 'Doe',
|
|
@@ -363,6 +660,7 @@ ZaiPayment.users.update(
|
|
|
363
660
|
```ruby
|
|
364
661
|
response = ZaiPayment.users.create(
|
|
365
662
|
# Required fields
|
|
663
|
+
user_type: 'payout',
|
|
366
664
|
email: 'seller@example.com',
|
|
367
665
|
first_name: 'Jane',
|
|
368
666
|
last_name: 'Smith',
|
|
@@ -375,8 +673,7 @@ response = ZaiPayment.users.create(
|
|
|
375
673
|
|
|
376
674
|
# Additional recommended fields
|
|
377
675
|
mobile: '+61412345678',
|
|
378
|
-
government_number: 'TFN123456789'
|
|
379
|
-
user_type: 'payout'
|
|
676
|
+
government_number: 'TFN123456789'
|
|
380
677
|
)
|
|
381
678
|
|
|
382
679
|
user = response.data
|