diff --git a/.github/ISSUE_TEMPLATE/documentation.yml b/.github/ISSUE_TEMPLATE/documentation.yml index 7755d50..fe9f959 100644 --- a/.github/ISSUE_TEMPLATE/documentation.yml +++ b/.github/ISSUE_TEMPLATE/documentation.yml @@ -16,7 +16,7 @@ body: label: Documentation Type description: What type of documentation needs attention? options: - - README + - readme - API Documentation - Code Examples - Architecture Documentation @@ -47,7 +47,7 @@ body: attributes: label: Location description: Where is the documentation issue? (file path, URL, or section name) - placeholder: e.g., README.md line 42, or docs/WEBHOOKS.md + placeholder: e.g., readme.md line 42, or docs/WEBHOOKS.md validations: required: true diff --git a/.yardopts b/.yardopts index 58f755b..dc3949b 100644 --- a/.yardopts +++ b/.yardopts @@ -1,3 +1,3 @@ --markup markdown ---readme README.md +--readme readme.md lib \ No newline at end of file diff --git a/Gemfile.lock b/Gemfile.lock index 39196f2..c6f08c0 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -1,7 +1,7 @@ PATH remote: . specs: - zai_payment (2.0.0) + zai_payment (2.0.1) base64 (~> 0.3.0) faraday (~> 2.0) openssl (~> 3.3) diff --git a/changelog.md b/changelog.md index b09a453..2762d8c 100644 --- a/changelog.md +++ b/changelog.md @@ -1,4 +1,7 @@ ## [Released] +## [2.0.1] - 2025-10-24 +### Changes + - Updated markdown files ## [2.0.0] - 2025-10-24 ### Added @@ -20,10 +23,25 @@ - Full RSpec test suite for Items resource with 100% coverage - Comprehensive examples documentation in `examples/items.md` +### Changed +- **User Management Enhancement**: Updated user creation validation to support user type-specific required fields + - `user_type` parameter now determines which fields are required during user creation + - Payin users require: `email`, `first_name`, `last_name`, `country` + - Payout users require additional fields: `address_line1`, `city`, `state`, `zip`, `dob` + - Company validation now enforces required fields based on user type + - For payout companies, additional fields required: `address_line1`, `city`, `state`, `zip`, `phone`, `country` + - All companies require: `name`, `legal_name`, `tax_number`, `business_email`, `country` +- **Clarified device_id and ip_address requirements**: These fields are NOT required when creating a payin user, but become required when creating an item and charging a card +- Refactored company validation logic for better maintainability and reduced cyclomatic complexity + ### Documentation - Added detailed Items API examples with complete workflow demonstrations - Payment types documentation (1-7: Direct Debit, Credit Card, Bank Transfer, Wallet, BPay, PayPal, Other) - Error handling examples for Items operations +- Updated User Management documentation (`docs/users.md`) with correct required fields for each user type +- Updated all user examples in `examples/users.md` to reflect proper user type usage +- Added clear notes about when `device_id` and `ip_address` are required +- Updated company field requirements in all documentation **Full Changelog**: https://github.com/Sentia/zai-payment/compare/v1.3.2...v2.0.0 @@ -33,7 +51,7 @@ - Added `yard` gem as development dependency for API documentation ### Fixed -- Fixed YARD link resolution warning in README.md by converting markdown link to HTML format +- Fixed YARD link resolution warning in readme.md by converting markdown link to HTML format ### Documentation - Configured YARD to generate comprehensive API documentation diff --git a/contributing.md b/contributing.md index 7f20c79..a04a6e6 100644 --- a/contributing.md +++ b/contributing.md @@ -231,7 +231,7 @@ feat(webhooks): add support for webhook signature verification fix(auth): prevent token refresh race condition -docs: update README with webhook examples +docs: update readme with webhook examples test(client): add specs for error handling ``` @@ -364,7 +364,7 @@ end ### Recognition Contributors will be recognized in: -- The project's README (if significant contribution) +- The project's readme (if significant contribution) - The CHANGELOG for their specific contributions - Release notes diff --git a/docs/webhook_signature.md b/docs/webhook_signature.md index 9a2dab1..b8220fc 100644 --- a/docs/webhook_signature.md +++ b/docs/webhook_signature.md @@ -60,7 +60,7 @@ Test categories: ### 4. Documentation #### Updated Files: -1. **`docs/WEBHOOKS.md`** (170+ lines added) +1. **`docs/webhooks.md`** (170+ lines added) - Complete security section - Step-by-step setup guide - Rails controller examples @@ -77,7 +77,7 @@ Test categories: - Background job processing pattern - Idempotency pattern -3. **`README.md`** (40+ lines added) +3. **`readme.md`** (40+ lines added) - Quick start guide - Security features highlights - Simple usage example diff --git a/implementation.md b/implementation.md index 75a2ef6..8809c2c 100644 --- a/implementation.md +++ b/implementation.md @@ -110,7 +110,7 @@ Practical examples including: - RSpec integration tests - Common patterns with retry logic -#### README Updates (`readme.md`) +#### readme Updates (`readme.md`) - Added Users section with quick examples - Updated roadmap to mark Users as "Done" - Added documentation links @@ -149,7 +149,7 @@ response = ZaiPayment.users.create( first_name: 'Jane', last_name: 'Smith', country: 'AUS', - dob: '19900101', + dob: '01/01/1990', address_line1: '456 Market St', city: 'Sydney', state: 'NSW', @@ -208,7 +208,7 @@ response = ZaiPayment.users.update( 1. **Email**: Must be valid email format 2. **Country**: Must be 3-letter ISO 3166-1 alpha-3 code (e.g., USA, AUS, GBR) -3. **Date of Birth**: Must be DD/MM/YYYY format (e.g., 19900101) +3. **Date of Birth**: Must be DD/MM/YYYY format (e.g., 01/01/1990) 4. **User Type**: Must be 'payin' or 'payout' (optional field) ## Error Handling diff --git a/implementation_summary.md b/implementation_summary.md index 95ae3cf..5766f34 100644 --- a/implementation_summary.md +++ b/implementation_summary.md @@ -169,8 +169,8 @@ The following documentation files have been updated: 1. **`lib/zai_payment/resources/user.rb`** - Implementation 2. **`examples/users.md`** - Usage examples and patterns -3. **`docs/USERS.md`** - Field reference and comprehensive guide -4. **`README.md`** - Quick start example +3. **`docs/users.md`** - Field reference and comprehensive guide +4. **`readme.md`** - Quick start example ## Testing @@ -190,6 +190,6 @@ These changes are **backward compatible**. All new parameters are optional and e - `/lib/zai_payment/resources/user.rb` - Main implementation - `/examples/users.md` - Usage examples -- `/docs/USERS.md` - Field reference -- `/README.md` - Quick start guide +- `/docs/users.md` - Field reference +- `/readme.md` - Quick start guide diff --git a/lib/zai_payment/version.rb b/lib/zai_payment/version.rb index e7722e2..0668c78 100644 --- a/lib/zai_payment/version.rb +++ b/lib/zai_payment/version.rb @@ -1,5 +1,5 @@ # frozen_string_literal: true module ZaiPayment - VERSION = '2.0.0' + VERSION = '2.0.1' end diff --git a/zai_payment.gemspec b/zai_payment.gemspec index 4fd4ead..79fdbb7 100644 --- a/zai_payment.gemspec +++ b/zai_payment.gemspec @@ -17,8 +17,8 @@ Gem::Specification.new do |spec| spec.metadata['allowed_push_host'] = 'https://rubygems.org' spec.metadata['homepage_uri'] = spec.homepage spec.metadata['source_code_uri'] = 'https://github.com/Sentia/zai-payment' - spec.metadata['changelog_uri'] = 'https://github.com/Sentia/zai-payment/blob/main/CHANGELOG.md' - spec.metadata['code_of_conduct_uri'] = 'https://github.com/Sentia/zai-payment/blob/main/CODE_OF_CONDUCT.md' + spec.metadata['changelog_uri'] = 'https://github.com/Sentia/zai-payment/blob/main/changelog.md' + spec.metadata['code_of_conduct_uri'] = 'https://github.com/Sentia/zai-payment/blob/main/code_of_conduct.md' spec.metadata['rubygems_mfa_required'] = 'true' spec.metadata['documentation_uri'] = 'https://github.com/Sentia/zai-payment#readme'