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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: b74d44b6fb3083a1ffacfdad938d1ead025a6c7ae327a69f0b0a20c0c9bf217c
4
- data.tar.gz: 06e0c28b63d871523e65095953450519e6eb81d02c22c2154cc453977936274b
3
+ metadata.gz: bd2bc88b008ee18d342d81dfbe7ee3680e2564b266d2fadd0f6d6f65140098b2
4
+ data.tar.gz: 59158c3d8919b6ae9df07ddefc6f21162b51218bf47b7c3267e81a52b25172b4
5
5
  SHA512:
6
- metadata.gz: cd47c060b0f3f8e42e3ddae83b3bef226fd5d963fafce84a37edb42b38a2f0662ce8b56f4cee4bdec33683c8d1cf0b86150d54fe232b4e9fb4659adf9939b100
7
- data.tar.gz: 57141c543bac064b1f93ec8733fc4f354056ba698cbdc87ae22d80c30fc08ed4949ec22577fe10b35efea829594b10df87dcb82aa63b35d1a2b5aec00e2186dd
6
+ metadata.gz: 19e4a3f16c002720a058dbd172a63f14231f99cb9d70735080ad400267e3490813062a5cdfb3ea3c538df71a48008d10bf47efa2284503a9beb2ecd1ee4f7e35
7
+ data.tar.gz: c3efe64996d506e89b364a9867c7b349111061ff58ad222b9a8814479b1842985ebf0f8bb72c89cf469327ac3e24985c25f84ebb7aee9ae1cbc05d08bf46a070
data/badges/coverage.json CHANGED
@@ -1 +1 @@
1
- {"schemaVersion": 1, "label": "coverage", "message": "97.15%", "color": "brightgreen"}
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
@@ -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
- faraday.headers['Authorization'] = token_provider.bearer_token
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
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module ZaiPayment
4
- VERSION = '2.3.0'
4
+ VERSION = '2.3.1'
5
5
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: zai_payment
3
3
  version: !ruby/object:Gem::Version
4
- version: 2.3.0
4
+ version: 2.3.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Eddy Jaga