zai_payment 2.3.0 → 2.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/badges/coverage.json +1 -1
- data/changelog.md +9 -0
- data/lib/zai_payment/client.rb +2 -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: bd2bc88b008ee18d342d81dfbe7ee3680e2564b266d2fadd0f6d6f65140098b2
|
|
4
|
+
data.tar.gz: 59158c3d8919b6ae9df07ddefc6f21162b51218bf47b7c3267e81a52b25172b4
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 19e4a3f16c002720a058dbd172a63f14231f99cb9d70735080ad400267e3490813062a5cdfb3ea3c538df71a48008d10bf47efa2284503a9beb2ecd1ee4f7e35
|
|
7
|
+
data.tar.gz: c3efe64996d506e89b364a9867c7b349111061ff58ad222b9a8814479b1842985ebf0f8bb72c89cf469327ac3e24985c25f84ebb7aee9ae1cbc05d08bf46a070
|
data/badges/coverage.json
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"schemaVersion": 1, "label": "coverage", "message": "
|
|
1
|
+
{"schemaVersion": 1, "label": "coverage", "message": "96.15%", "color": "brightgreen"}
|
data/changelog.md
CHANGED
|
@@ -1,4 +1,13 @@
|
|
|
1
1
|
## [Released]
|
|
2
|
+
## [2.3.1] - 2025-10-28
|
|
3
|
+
### Fixed
|
|
4
|
+
- **Token Refresh Bug**: Fixed authentication token not being refreshed after expiration
|
|
5
|
+
- Previously, the Authorization header was set once when the connection was created
|
|
6
|
+
- After ~1 hour, tokens would expire and subsequent API calls would fail with `UnauthorizedError`
|
|
7
|
+
- Now, the Authorization header is set dynamically on each request, ensuring fresh tokens are always used
|
|
8
|
+
- The `TokenProvider` automatically refreshes expired tokens, preventing authentication errors
|
|
9
|
+
- Fixes issue where some APIs would work while others failed after token expiration
|
|
10
|
+
|
|
2
11
|
## [2.3.0] - 2025-10-28
|
|
3
12
|
### Added
|
|
4
13
|
- **User Management API Enhancement**: Added search parameter to list users endpoint
|
data/lib/zai_payment/client.rb
CHANGED
|
@@ -53,6 +53,7 @@ module ZaiPayment
|
|
|
53
53
|
def request(method, path, params: {}, body: {})
|
|
54
54
|
response = connection.public_send(method) do |req|
|
|
55
55
|
req.url path
|
|
56
|
+
req.headers['Authorization'] = token_provider.bearer_token
|
|
56
57
|
req.params = params if params.any?
|
|
57
58
|
req.body = body if body.any?
|
|
58
59
|
end
|
|
@@ -81,7 +82,7 @@ module ZaiPayment
|
|
|
81
82
|
end
|
|
82
83
|
|
|
83
84
|
def apply_headers(faraday)
|
|
84
|
-
|
|
85
|
+
# Authorization header is set per-request to ensure fresh tokens
|
|
85
86
|
faraday.headers['Content-Type'] = 'application/json'
|
|
86
87
|
faraday.headers['Accept'] = 'application/json'
|
|
87
88
|
end
|
data/lib/zai_payment/version.rb
CHANGED