zai_payment 2.0.1 → 2.1.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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: c3f50f91d34afe9dcce310026974f08678796243aef8a5b13acbb2436895d87e
4
- data.tar.gz: 1c30ea6419a504eeba75b5387525d703f7fad2e82d7dc9882d6a79537ea51a78
3
+ metadata.gz: 875d506340e0ebde15266915492626d10e454df4630a74fa17881cbc04b9e6fe
4
+ data.tar.gz: d0fae97dd2dc5d219f46af7ea61a04e0fcc74239b0860f3cfed251782c34086a
5
5
  SHA512:
6
- metadata.gz: 12dd73742c4fc6682635e563636ea5a3e6c5fe18a1b22b7acb5911959ef5172bd7ffcb81e4ceab283304200a4eafa43e9f1a52ed3528f070ada636879ac96dbf
7
- data.tar.gz: 03e9ef546c66eab48234e130ef02481e1e0074538a41d433bf86a3f48ad432660c0ce85b10731da1fe00ec9e7b686f7e808a1cf453a886e386c1eec9728a5706
6
+ metadata.gz: aa334f191958e38c6e87846daac9fd33391a3e34ae0ebcca24395c501aac4b283c44fb059d6f24b70c5bd1f91f9a241abe668f81e66facfc194dfd10f66065e4
7
+ data.tar.gz: c81b7ceb54b8947859c62a49c98efba981e6ee0a8550e7c4bb810c23bd66aad06eece483db51d9d6cc9e1c0f05afb0e37fb1bacdadbb222fbd8dc59887e907c3
data/badges/coverage.json CHANGED
@@ -1 +1 @@
1
- {"schemaVersion": 1, "label": "coverage", "message": "95.19%", "color": "brightgreen"}
1
+ {"schemaVersion": 1, "label": "coverage", "message": "95.22%", "color": "brightgreen"}
data/changelog.md CHANGED
@@ -1,7 +1,42 @@
1
1
  ## [Released]
2
+ ## [2.1.0] - 2025-10-24
3
+ ### Added
4
+ - **Token Auth API**: Token generation for bank and card accounts 🔐
5
+ - `ZaiPayment.token_auths.generate(user_id:, token_type:)` - Generate tokens for secure payment data collection
6
+ - Support for bank tokens (collecting bank account information)
7
+ - Support for card tokens (collecting credit card information)
8
+ - Token type validation (bank or card)
9
+ - User ID validation
10
+ - Full RSpec test suite for TokenAuth resource
11
+ - Comprehensive examples documentation in `examples/token_auths.md`
12
+
13
+ ### Documentation
14
+ - Added detailed TokenAuth API examples with complete integration patterns
15
+ - Frontend integration examples (PromisePay.js)
16
+ - Rails controller integration examples
17
+ - Service object pattern examples
18
+ - Error handling and retry logic examples
19
+ - Security best practices (token expiry management, audit logging, rate limiting)
20
+ - Complete payment flow example
21
+
22
+ ### Testing
23
+ - 20+ new test cases for TokenAuth resource
24
+ - Validation error handling tested
25
+ - Case-insensitive token type support tested
26
+ - Default parameter behavior tested
27
+
28
+ **Full Changelog**: https://github.com/Sentia/zai-payment/compare/v2.0.2...v2.1.0
29
+
30
+ ## [2.0.2] - 2025-10-24
31
+ ### Fixed
32
+ - **Items API**: Fixed endpoint configuration to use `core_base` instead of `va_base`
33
+ - Items resource now correctly uses the `https://test.api.promisepay.com` endpoint (prelive)
34
+ - Resolves CloudFront 403 error when creating items via POST requests
35
+ - Ensures Items API uses the same endpoint as Users API for consistency
36
+
2
37
  ## [2.0.1] - 2025-10-24
3
38
  ### Changes
4
- - Updated markdown files
39
+ - Updated markdown files
5
40
 
6
41
  ## [2.0.0] - 2025-10-24
7
42
  ### Added
data/docs/readme.md CHANGED
@@ -5,24 +5,30 @@ Welcome to the Zai Payment Ruby gem documentation. This guide will help you find
5
5
  ## 📖 Getting Started
6
6
 
7
7
  **New to the gem?** Start here:
8
- 1. [Main README](../README.md) - Installation and basic configuration
9
- 2. [Authentication Guide](AUTHENTICATION.md) - Get tokens with two approaches (short & long way)
10
- 3. [Webhook Quick Start](WEBHOOK_SECURITY_QUICKSTART.md) - Set up secure webhooks in 5 minutes
8
+ 1. [Main README](../readme.md) - Installation and basic configuration
9
+ 2. [Authentication Guide](authentication.md) - Get tokens with two approaches (short & long way)
10
+ 3. [Webhook Quick Start](webhook_security_quickstart.md) - Set up secure webhooks in 5 minutes
11
11
  4. [Webhook Examples](../examples/webhooks.md) - Complete usage examples
12
12
 
13
13
  ## 🏗️ Architecture & Design
14
14
 
15
- - [**ARCHITECTURE.md**](ARCHITECTURE.md) - System architecture and design principles
16
- - [**AUTHENTICATION.md**](AUTHENTICATION.md) - OAuth2 implementation, token management, two approaches
17
- - [**WEBHOOKS.md**](WEBHOOKS.md) - Webhook implementation details, best practices, and patterns
15
+ - [**architecture.md**](architecture.md) - System architecture and design principles
16
+ - [**authentication.md**](authentication.md) - OAuth2 implementation, token management, two approaches
17
+ - [**users.md**](users.md) - User management for payin (buyers) and payout (sellers/merchants)
18
+ - [**items.md**](items.md) - Item management for transactions and payments
19
+ - [**token_auths.md**](token_auths.md) - Token generation for secure bank and card data collection
20
+ - [**webhooks.md**](webhooks.md) - Webhook implementation details, best practices, and patterns
18
21
 
19
22
  ## 🔐 Security Guides
20
23
 
21
- - [**WEBHOOK_SECURITY_QUICKSTART.md**](WEBHOOK_SECURITY_QUICKSTART.md) - Quick 5-minute security setup guide
22
- - [**WEBHOOK_SIGNATURE.md**](WEBHOOK_SIGNATURE.md) - Detailed signature verification implementation
24
+ - [**webhook_security_quickstart.md**](webhook_security_quickstart.md) - Quick 5-minute security setup guide
25
+ - [**webhook_signature.md**](webhook_signature.md) - Detailed signature verification implementation
23
26
 
24
27
  ## 📝 Examples
25
28
 
29
+ - [**User Examples**](../examples/users.md) - User management examples and patterns
30
+ - [**Item Examples**](../examples/items.md) - Transaction and payment workflows
31
+ - [**Token Auth Examples**](../examples/token_auths.md) - Token generation and PromisePay.js integration
26
32
  - [**Webhook Examples**](../examples/webhooks.md) - Comprehensive webhook usage examples including:
27
33
  - Basic CRUD operations
28
34
  - Rails controller implementation
@@ -34,15 +40,30 @@ Welcome to the Zai Payment Ruby gem documentation. This guide will help you find
34
40
  ## 🔗 Quick Links
35
41
 
36
42
  ### Authentication
37
- - **Getting Started**: [Authentication Guide](AUTHENTICATION.md)
43
+ - **Getting Started**: [Authentication Guide](authentication.md)
38
44
  - **Short Way**: `ZaiPayment.token` (one-liner)
39
45
  - **Long Way**: `TokenProvider.new(config: config).bearer_token` (full control)
40
46
 
47
+ ### Users
48
+ - **Guide**: [User Management](users.md)
49
+ - **Examples**: [User Examples](../examples/users.md)
50
+ - **API Reference**: [Zai Users API](https://developer.hellozai.com/reference/getallusers)
51
+
52
+ ### Items
53
+ - **Guide**: [Item Management](items.md)
54
+ - **Examples**: [Item Examples](../examples/items.md)
55
+ - **API Reference**: [Zai Items API](https://developer.hellozai.com/reference/listitems)
56
+
57
+ ### Token Auth
58
+ - **Guide**: [Token Auth](token_auths.md)
59
+ - **Examples**: [Token Auth Examples](../examples/token_auths.md)
60
+ - **API Reference**: [Zai Generate Token API](https://developer.hellozai.com/reference/generatetoken)
61
+
41
62
  ### Webhooks
42
- - **Setup**: [Quick Start Guide](WEBHOOK_SECURITY_QUICKSTART.md)
63
+ - **Setup**: [Quick Start Guide](webhook_security_quickstart.md)
43
64
  - **Examples**: [Complete Examples](../examples/webhooks.md)
44
- - **Details**: [Technical Documentation](WEBHOOKS.md)
45
- - **Security**: [Signature Verification](WEBHOOK_SIGNATURE.md)
65
+ - **Details**: [Technical Documentation](webhooks.md)
66
+ - **Security**: [Signature Verification](webhook_signature.md)
46
67
 
47
68
  ### External Resources
48
69
  - [Zai Developer Portal](https://developer.hellozai.com/)
@@ -53,29 +74,38 @@ Welcome to the Zai Payment Ruby gem documentation. This guide will help you find
53
74
 
54
75
  ```
55
76
  docs/
56
- ├── README.md # This file - documentation index
57
- ├── AUTHENTICATION.md # OAuth2 authentication guide (NEW!)
58
- ├── ARCHITECTURE.md # System architecture
59
- ├── WEBHOOKS.md # Webhook technical docs
60
- ├── WEBHOOK_SECURITY_QUICKSTART.md # Quick security setup
61
- └── WEBHOOK_SIGNATURE.md # Signature implementation
77
+ ├── readme.md # This file - documentation index
78
+ ├── authentication.md # OAuth2 authentication guide
79
+ ├── users.md # User management guide
80
+ ├── items.md # Item management guide
81
+ ├── token_auths.md # Token generation guide (NEW!)
82
+ ├── architecture.md # System architecture
83
+ ├── webhooks.md # Webhook technical docs
84
+ ├── webhook_security_quickstart.md # Quick security setup
85
+ └── webhook_signature.md # Signature implementation
62
86
 
63
87
  examples/
64
- └── webhooks.md # Complete webhook examples
88
+ ├── users.md # User management examples
89
+ ├── items.md # Item examples
90
+ ├── token_auths.md # Token auth examples (NEW!)
91
+ └── webhooks.md # Webhook examples
65
92
  ```
66
93
 
67
94
  ## 💡 Tips
68
95
 
69
- - **Getting tokens?** Check [AUTHENTICATION.md](AUTHENTICATION.md) for both approaches
70
- - **Looking for code examples?** Check [examples/webhooks.md](../examples/webhooks.md)
71
- - **Need quick setup?** See [WEBHOOK_SECURITY_QUICKSTART.md](WEBHOOK_SECURITY_QUICKSTART.md)
72
- - **Want to understand the design?** Read [ARCHITECTURE.md](ARCHITECTURE.md)
73
- - **Security details?** Review [WEBHOOK_SIGNATURE.md](WEBHOOK_SIGNATURE.md)
96
+ - **Getting tokens?** Check [authentication.md](authentication.md) for both approaches
97
+ - **Managing users?** See [users.md](users.md) for payin and payout user guides
98
+ - **Creating transactions?** Review [items.md](items.md) for item management
99
+ - **Collecting payment data?** See [token_auths.md](token_auths.md) for secure token generation
100
+ - **Looking for code examples?** Check the [examples](../examples/) directory
101
+ - **Need quick setup?** See [webhook_security_quickstart.md](webhook_security_quickstart.md)
102
+ - **Want to understand the design?** Read [architecture.md](architecture.md)
103
+ - **Security details?** Review [webhook_signature.md](webhook_signature.md)
74
104
 
75
105
  ## 🆘 Need Help?
76
106
 
77
107
  1. Check the relevant documentation section above
78
- 2. Review the [examples](../examples/webhooks.md)
108
+ 2. Review the [examples](../examples/)
79
109
  3. Consult the [Zai API documentation](https://developer.hellozai.com/)
80
110
  4. Open an issue on GitHub
81
111