v4.18.0 (2025-03-03)
PSR-18 / PSR-17 HTTP client injection (backward compatible):
- Direct PSR-18 injection: You can now inject a
Psr\Http\Client\ClientInterface(PSR-18) directly intoChargebeeClientwithout implementing the Chargebee-specificHttpClientFactoryinterface. - Optional PSR-17 factories: When using a PSR-18 client, you may optionally pass
RequestFactoryInterfaceandStreamFactoryInterface(PSR-17). When omitted, php-http/discovery auto-discovers any installed PSR-17 implementation. - New adapter:
Chargebee\HttpClient\PsrClientAdapterwraps a PSR-18 client and builds PSR-7 requests using the injected or discovered PSR-17 request/stream factories. - Backward compatibility: The existing
HttpClientFactoryinjection path and the defaultGuzzleFactoryare unchanged.
New dependencies (require):
php-http/discovery^1.0psr/http-factory^1.0