-
Notifications
You must be signed in to change notification settings - Fork 0
user management apis #6
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull Request Overview
This PR introduces comprehensive User Management support to the ZaiPayment gem, enabling full CRUD operations for both payin (buyer) and payout (seller/merchant) users. The implementation includes robust validation, extensive documentation with practical examples, and enhanced API client capabilities to support multiple endpoints.
Key Changes:
- Implemented full User resource with CRUD operations and validation for email, country codes, DOB, and user types
- Enhanced the client to support multiple API endpoints (core_base for users, va_base for webhooks)
- Added comprehensive documentation including user guides, quick reference, examples, and implementation summaries
Reviewed Changes
Copilot reviewed 16 out of 18 changed files in this pull request and generated 3 comments.
Show a summary per file
| File | Description |
|---|---|
| lib/zai_payment/resources/user.rb | New User resource implementing CRUD operations with validation |
| lib/zai_payment/client.rb | Added base_endpoint parameter for multi-endpoint support |
| lib/zai_payment/response.rb | Updated to handle both webhooks and users response formats |
| lib/zai_payment.rb | Integrated User resource with core_base endpoint |
| spec/zai_payment/resources/user_spec.rb | Comprehensive test suite with 40+ test cases |
| spec/zai_payment/client_spec.rb | New test suite for client enhancements |
| docs/USERS.md | Complete user management guide with field reference |
| docs/USER_QUICK_REFERENCE.md | Quick lookup guide for common operations |
| docs/USER_ID_FIELD.md | Detailed guide on user ID field usage |
| examples/users.md | Extensive usage examples and patterns |
| IMPLEMENTATION_SUMMARY.md | Summary of new parameters implementation |
| IMPLEMENTATION.md | Detailed implementation documentation |
| README.md | Added user management examples and updated roadmap |
| CHANGELOG.md | Documented version 1.3.0 features |
| lib/zai_payment/version.rb | Version bump to 1.3.0 |
| .rubocop.yml | Updated to accommodate User resource complexity |
Comments suppressed due to low confidence (1)
docs/USERS.md:1
- The field reference table on line 228 shows DOB format as 'DD/MM/YYYY', but the code validates and expects 'YYYYMMDD' format. Update to 'YYYYMMDD' for consistency with implementation.
# User Management
Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.
Description
This pull request introduces comprehensive user management capabilities to the Zai Payment gem, including full CRUD operations for payin and payout users, support for business users with company details, and extensive validation and documentation updates. It also adds new branding and verification fields for users, improves API endpoint flexibility, and significantly expands usage examples and guides. All changes are backward compatible.
User Management API & Features:
ZaiPayment.usersinterface, including listing, showing, creating (with progressive profile support), and updating both payin (buyer) and payout (seller/merchant) users. Comprehensive validation is included for email, country code, date of birth, and user type.drivers_license_number,drivers_license_state,logo_url,color_1,color_2,custom_descriptor, andauthorized_signer_title. Added support for a nestedcompanyobject for business users with required and optional fields, and special handling for boolean and nested values.Documentation & Examples:
docs/USERS.md), user examples (examples/users.md), quick reference, demo script, and implementation summary. README now includes a Users section, quick examples, and updated roadmap. [1] [2] [3] [4] [5] [6]idfield for users, clarifying that it is optional, can be auto-generated or custom, and must not contain dots or be blank. Includes best practices and migration strategy.API & Client Enhancements:
base_endpointparameter to the client for supporting multiple API endpoints; Users API usescore_base, Webhooks API continues withva_base. Updated the response handling to support both webhooks and users.Testing & Quality:
ClassLengthlimit and excluded variable number naming cop for user resource file to accommodate new logic.User Management API:
Documentation & Examples:
idfield for users, including validation and best practices.API Client Enhancements:
base_endpointparameter and improved response handling for new user endpoints.Testing & Quality:
Backward Compatibility: