Skip to content

Commit 5506dc5

Browse files
authored
Merge pull request #6 from Sentia/feature/user-management-payin-payout
user management apis
2 parents 02e2377 + 57ea85e commit 5506dc5

File tree

18 files changed

+4211
-191
lines changed

18 files changed

+4211
-191
lines changed

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -51,3 +51,4 @@ Gemfile.lock
5151
# Used by RSpec
5252
.rspec_status
5353

54+
.DS_Store

.rubocop.yml

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,4 +26,8 @@ RSpec/ExampleLength:
2626
Max: 8
2727

2828
Metrics/ClassLength:
29-
Max: 150
29+
Max: 200
30+
31+
Naming/VariableNumber:
32+
Exclude:
33+
- 'lib/zai_payment/resources/user.rb'

CHANGELOG.md

Lines changed: 64 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,69 @@
11
## [Released]
22

3+
## [1.3.0] - 2025-10-23
4+
### Added
5+
- **User Management API**: Full CRUD operations for managing Zai users (payin and payout) 👥
6+
- `ZaiPayment.users.list(limit:, offset:)` - List all users with pagination
7+
- `ZaiPayment.users.show(user_id)` - Get user details by ID
8+
- `ZaiPayment.users.create(**attributes)` - Create payin (buyer) or payout (seller/merchant) users
9+
- `ZaiPayment.users.update(user_id, **attributes)` - Update user information
10+
- Support for both payin users (buyers) and payout users (sellers/merchants)
11+
- Comprehensive validation for all user types
12+
- Email format validation
13+
- Country code validation (ISO 3166-1 alpha-3)
14+
- Date of birth format validation (YYYYMMDD)
15+
- User type validation (payin/payout)
16+
- Progressive profile building support
17+
18+
### Enhancements
19+
- **Client**: Added `base_endpoint` parameter to support multiple API endpoints
20+
- Users API uses `core_base` endpoint
21+
- Webhooks API continues to use `va_base` endpoint
22+
- **Response**: Updated `data` method to handle both `webhooks` and `users` response formats
23+
- **Main Module**: Added `users` accessor for convenient access to User resource
24+
25+
### Documentation
26+
- **NEW**: [User Management Guide](docs/USERS.md) - Comprehensive guide covering:
27+
- Overview of payin vs payout users
28+
- Required fields for each user type
29+
- Complete API reference with examples
30+
- Field reference table
31+
- Error handling patterns
32+
- Best practices for each user type
33+
- Response structures
34+
- **NEW**: [User Examples](examples/users.md) - 500+ lines of practical examples:
35+
- Basic and advanced payin user creation
36+
- Progressive profile building patterns
37+
- Payout user creation (individual and company)
38+
- International users (AU, UK, US)
39+
- List, search, and pagination
40+
- Update operations
41+
- Rails integration examples
42+
- Batch operations
43+
- User profile validation helper
44+
- RSpec integration tests
45+
- Common patterns with retry logic
46+
- **NEW**: [User Quick Reference](docs/USER_QUICK_REFERENCE.md) - Quick lookup for common operations
47+
- **NEW**: [User Demo Script](examples/user_demo.rb) - Interactive demo of all user operations
48+
- **NEW**: [Implementation Summary](IMPLEMENTATION.md) - Detailed summary of the implementation
49+
- **Updated**: README.md - Added Users section with quick examples and updated roadmap
50+
51+
### Testing
52+
- 40+ new test cases for User resource
53+
- All CRUD operations tested
54+
- Validation error handling tested
55+
- API error handling tested
56+
- Integration tests with main module
57+
- Tests for both payin and payout user types
58+
59+
### API Endpoints
60+
- `GET /users` - List users
61+
- `GET /users/:id` - Show user
62+
- `POST /users` - Create user
63+
- `PATCH /users/:id` - Update user
64+
65+
**Full Changelog**: https://github.com/Sentia/zai-payment/compare/v1.2.0...v1.3.0
66+
367
## [1.2.0] - 2025-10-22
468
### Added
569
- **Webhook Security: Signature Verification** 🔒

Gemfile.lock

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
PATH
22
remote: .
33
specs:
4-
zai_payment (1.2.0)
4+
zai_payment (1.3.0)
55
base64 (~> 0.3.0)
66
faraday (~> 2.0)
77
openssl (~> 3.3)

0 commit comments

Comments
 (0)