admin管理员组文章数量:1417691
I'm encountering an issue when passing a custom GuzzleHttp\Client instance as the authenticationClient parameter in SellingPartnerApi::seller(). According to the documentation, this parameter should accept a GuzzleHttp\Client, but when provided, it results in the following error:
Error:
Typed property Saloon\Http\Senders\GuzzleSender::$client must not be accessed before initialization.
Steps to Reproduce Instantiate a GuzzleHttp\Client with a proxy
$httpClient = new \GuzzleHttp\Client([
'proxy' => 'http://username:password@proxy_host:port',
'timeout' => 30,
'connect_timeout' => 30,
]);
// or just an empty client
$httpClient = new \GuzzleHttp\Client();
Pass it to SellingPartnerApi::seller()
$api = SellingPartnerApi::seller(
clientId: $credentials->api_client_id,
clientSecret: $credentials->api_client_secret,
refreshToken: $credentials->refresh_token,
endpoint: Endpoint::NA,
authenticationClient: $httpClient
);
Attempt to make a request:
$response = $api->sellersV1()->getMarketplaceParticipations();
Additional Information
- PHP: 8.4.1
- Selling Partner API SDK: 7.2.4 (jlevers/selling-partner-api)
- Guzzle: 7.9.2
- Laravel: 11.41.3
I've confirmed that the issue persists even when using a clean GuzzleHttp\Client instance without additional configuration.
Is there an internal constraint preventing the use of a custom GuzzleHttp\Client, or is there a required initialization step that is missing? Any guidance would be appreciated.
I'm encountering an issue when passing a custom GuzzleHttp\Client instance as the authenticationClient parameter in SellingPartnerApi::seller(). According to the documentation, this parameter should accept a GuzzleHttp\Client, but when provided, it results in the following error:
Error:
Typed property Saloon\Http\Senders\GuzzleSender::$client must not be accessed before initialization.
Steps to Reproduce Instantiate a GuzzleHttp\Client with a proxy
$httpClient = new \GuzzleHttp\Client([
'proxy' => 'http://username:password@proxy_host:port',
'timeout' => 30,
'connect_timeout' => 30,
]);
// or just an empty client
$httpClient = new \GuzzleHttp\Client();
Pass it to SellingPartnerApi::seller()
$api = SellingPartnerApi::seller(
clientId: $credentials->api_client_id,
clientSecret: $credentials->api_client_secret,
refreshToken: $credentials->refresh_token,
endpoint: Endpoint::NA,
authenticationClient: $httpClient
);
Attempt to make a request:
$response = $api->sellersV1()->getMarketplaceParticipations();
Additional Information
- PHP: 8.4.1
- Selling Partner API SDK: 7.2.4 (jlevers/selling-partner-api)
- Guzzle: 7.9.2
- Laravel: 11.41.3
I've confirmed that the issue persists even when using a clean GuzzleHttp\Client instance without additional configuration.
Is there an internal constraint preventing the use of a custom GuzzleHttp\Client, or is there a required initialization step that is missing? Any guidance would be appreciated.
Share Improve this question asked Jan 31 at 8:39 Serhii BondarenkoSerhii Bondarenko 684 bronze badges1 Answer
Reset to default 1Looks like this was a bug and has been fixed in v7.3.0
: https://github/jlevers/selling-partner-api/issues/848
版权声明:本文标题:php - Issue with Custom Guzzle Client in authenticationClient for SellingPartnerApi::seller() - Stack Overflow 内容由网友自发贡献,该文观点仅代表作者本人, 转载请联系作者并注明出处:http://www.betaflare.com/web/1745274450a2651094.html, 本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容,一经查实,本站将立刻删除。
发表评论