zai_payment 1.3.0 → 1.3.1
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/CHANGELOG.md +7 -0
- data/IMPLEMENTATION.md +2 -2
- data/README.md +2 -2
- data/badges/coverage.json +1 -1
- data/docs/USERS.md +2 -2
- data/docs/USER_ID_FIELD.md +1 -1
- data/docs/USER_QUICK_REFERENCE.md +2 -2
- data/lib/zai_payment/resources/user.rb +4 -4
- data/lib/zai_payment/response.rb +14 -1
- data/lib/zai_payment/version.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: dabc0f9dc5f73ccb000c026d7a13eb171d14e447d0968af90458ddbc618ed415
|
|
4
|
+
data.tar.gz: a0152f5b7d19286f58d2c0cb0e7e551f657e3e3ddba54211ccb37fb145206674
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: eca4cb501d4135796dc7947eb21110ba1581672860450343995284f64209e200348791ade1573a599540702c82c86427f4fb5d3dcc7d4b3d91a1c775263fbd62
|
|
7
|
+
data.tar.gz: 45aabfa5d699dcb06c9e527ff72690698cdb70ab635d813070a94811f73b596bad47bde1771828eea1f200f6f2a1b805841cdc52677e69ef55994b0de9e5c96e
|
data/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,12 @@
|
|
|
1
1
|
## [Released]
|
|
2
2
|
|
|
3
|
+
## [1.3.1] - 2025-10-23
|
|
4
|
+
### Changed
|
|
5
|
+
- Update error response format
|
|
6
|
+
- Update some docs
|
|
7
|
+
|
|
8
|
+
**Full Changelog**: https://github.com/Sentia/zai-payment/compare/v1.3.0...v1.3.1
|
|
9
|
+
|
|
3
10
|
## [1.3.0] - 2025-10-23
|
|
4
11
|
### Added
|
|
5
12
|
- **User Management API**: Full CRUD operations for managing Zai users (payin and payout) 👥
|
data/IMPLEMENTATION.md
CHANGED
|
@@ -285,8 +285,8 @@ The implementation is complete and ready for use. Recommended next steps:
|
|
|
285
285
|
|
|
286
286
|
## References
|
|
287
287
|
|
|
288
|
-
- [Zai: Onboarding a Payin User](https://developer.hellozai.com/docs/onboarding-a-
|
|
289
|
-
- [Zai: Onboarding a Payout User](https://developer.hellozai.com/docs/onboarding-a-
|
|
288
|
+
- [Zai: Onboarding a Payin User](https://developer.hellozai.com/docs/onboarding-a-pay-in-user)
|
|
289
|
+
- [Zai: Onboarding a Payout User](https://developer.hellozai.com/docs/onboarding-a-pay-out-user)
|
|
290
290
|
- [Zai API Reference](https://developer.hellozai.com/reference)
|
|
291
291
|
|
|
292
292
|
## Support
|
data/README.md
CHANGED
|
@@ -137,8 +137,8 @@ response = ZaiPayment.users.update('user_id', mobile: '+9876543210')
|
|
|
137
137
|
**📚 Documentation:**
|
|
138
138
|
- 📖 [User Management Guide](docs/USERS.md) - Complete guide for payin and payout users
|
|
139
139
|
- 💡 [User Examples](examples/users.md) - Real-world usage patterns and Rails integration
|
|
140
|
-
- 🔗 [Zai: Onboarding a Payin User](https://developer.hellozai.com/docs/onboarding-a-
|
|
141
|
-
- 🔗 [Zai: Onboarding a Payout User](https://developer.hellozai.com/docs/onboarding-a-
|
|
140
|
+
- 🔗 [Zai: Onboarding a Payin User](https://developer.hellozai.com/docs/onboarding-a-pay-in-user)
|
|
141
|
+
- 🔗 [Zai: Onboarding a Payout User](https://developer.hellozai.com/docs/onboarding-a-pay-out-user)
|
|
142
142
|
|
|
143
143
|
### Webhooks
|
|
144
144
|
|
data/badges/coverage.json
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"schemaVersion": 1, "label": "coverage", "message": "
|
|
1
|
+
{"schemaVersion": 1, "label": "coverage", "message": "94.77%", "color": "brightgreen"}
|
data/docs/USERS.md
CHANGED
|
@@ -12,8 +12,8 @@ Both user types use the same endpoints but have different required information b
|
|
|
12
12
|
|
|
13
13
|
## References
|
|
14
14
|
|
|
15
|
-
- [Onboarding a Payin User](https://developer.hellozai.com/docs/onboarding-a-
|
|
16
|
-
- [Onboarding a Payout User](https://developer.hellozai.com/docs/onboarding-a-
|
|
15
|
+
- [Onboarding a Payin User](https://developer.hellozai.com/docs/onboarding-a-pay-in-user)
|
|
16
|
+
- [Onboarding a Payout User](https://developer.hellozai.com/docs/onboarding-a-pay-out-user)
|
|
17
17
|
|
|
18
18
|
## Usage
|
|
19
19
|
|
data/docs/USER_ID_FIELD.md
CHANGED
|
@@ -269,7 +269,7 @@ old_user.update(zai_user_id: new_response.data['id'])
|
|
|
269
269
|
|
|
270
270
|
## References
|
|
271
271
|
|
|
272
|
-
- [Zai Developer Documentation](https://developer.hellozai.com/docs/onboarding-a-
|
|
272
|
+
- [Zai Developer Documentation](https://developer.hellozai.com/docs/onboarding-a-pay-in-user)
|
|
273
273
|
- [Zai API Reference](https://developer.hellozai.com/reference/createuser)
|
|
274
274
|
- [User Management Guide](USERS.md)
|
|
275
275
|
|
|
@@ -218,8 +218,8 @@ ruby examples/user_demo.rb
|
|
|
218
218
|
|
|
219
219
|
- [Full User Guide](USERS.md)
|
|
220
220
|
- [Usage Examples](../examples/users.md)
|
|
221
|
-
- [Zai: Payin User](https://developer.hellozai.com/docs/onboarding-a-
|
|
222
|
-
- [Zai: Payout User](https://developer.hellozai.com/docs/onboarding-a-
|
|
221
|
+
- [Zai: Payin User](https://developer.hellozai.com/docs/onboarding-a-pay-in-user)
|
|
222
|
+
- [Zai: Payout User](https://developer.hellozai.com/docs/onboarding-a-pay-out-user)
|
|
223
223
|
|
|
224
224
|
## Support
|
|
225
225
|
|
|
@@ -4,8 +4,8 @@ module ZaiPayment
|
|
|
4
4
|
module Resources
|
|
5
5
|
# User resource for managing Zai users (payin and payout)
|
|
6
6
|
#
|
|
7
|
-
# @see https://developer.hellozai.com/docs/onboarding-a-
|
|
8
|
-
# @see https://developer.hellozai.com/docs/onboarding-a-
|
|
7
|
+
# @see https://developer.hellozai.com/docs/onboarding-a-pay-in-user
|
|
8
|
+
# @see https://developer.hellozai.com/docs/onboarding-a-pay-out-user
|
|
9
9
|
class User
|
|
10
10
|
attr_reader :client
|
|
11
11
|
|
|
@@ -197,8 +197,8 @@ module ZaiPayment
|
|
|
197
197
|
# )
|
|
198
198
|
#
|
|
199
199
|
# @see https://developer.hellozai.com/reference/createuser
|
|
200
|
-
# @see https://developer.hellozai.com/docs/onboarding-a-
|
|
201
|
-
# @see https://developer.hellozai.com/docs/onboarding-a-
|
|
200
|
+
# @see https://developer.hellozai.com/docs/onboarding-a-pay-in-user
|
|
201
|
+
# @see https://developer.hellozai.com/docs/onboarding-a-pay-out-user
|
|
202
202
|
def create(**attributes)
|
|
203
203
|
validate_create_attributes!(attributes)
|
|
204
204
|
|
data/lib/zai_payment/response.rb
CHANGED
|
@@ -68,10 +68,23 @@ module ZaiPayment
|
|
|
68
68
|
|
|
69
69
|
def extract_error_message
|
|
70
70
|
if body.is_a?(Hash)
|
|
71
|
-
body['error'] || body['message'] || body['errors']
|
|
71
|
+
body['error'] || body['message'] || format_errors(body['errors']) || "HTTP #{status}"
|
|
72
72
|
else
|
|
73
73
|
"HTTP #{status}: #{body}"
|
|
74
74
|
end
|
|
75
75
|
end
|
|
76
|
+
|
|
77
|
+
def format_errors(errors)
|
|
78
|
+
return nil if errors.nil?
|
|
79
|
+
|
|
80
|
+
case errors
|
|
81
|
+
when Array
|
|
82
|
+
errors.join(', ')
|
|
83
|
+
when Hash
|
|
84
|
+
errors.map { |key, value| "#{key}: #{value}" }.join(', ')
|
|
85
|
+
else
|
|
86
|
+
errors.to_s
|
|
87
|
+
end
|
|
88
|
+
end
|
|
76
89
|
end
|
|
77
90
|
end
|
data/lib/zai_payment/version.rb
CHANGED