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
发布者:admin,转转请注明出处:http://www.yc00.com/questions/1745274450a4619949.html
评论列表(0条)