1
0
Fork 0
mirror of synced 2025-04-19 17:00:56 +00:00

Compare commits

...

3 commits

Author SHA1 Message Date
AlexBergal
b8f4cfa149
Lost Boolean params while Request signing (#10) 2021-07-09 13:44:23 +03:00
Alex Lushpai
f919a3a99f
Double filtering seems to be overkill 2021-07-09 11:22:37 +03:00
AlexBergal
9e601738ac
Double filtering will loose some params 2021-06-21 21:56:48 +07:00
4 changed files with 7 additions and 4 deletions

View file

@ -264,6 +264,8 @@ class TopRequestFactory implements TopRequestFactoryInterface
*
* @return string|resource|null
* @todo Arrays will be encoded to JSON. Is this correct? Press X to doubt.
*
* @SuppressWarnings(PHPMD.CyclomaticComplexity)
*/
private function castValue($value)
{
@ -274,6 +276,7 @@ class TopRequestFactory implements TopRequestFactoryInterface
case 'NULL':
return $value;
case 'boolean':
return $value ? 'true' : 'false';
case 'integer':
case 'double':
case 'string':

View file

@ -25,12 +25,12 @@ class RequestDataFilter
*/
public function filterBinaryFromRequestData(array $params): array
{
return array_filter(array_filter(
return array_filter(
$params,
static function ($item) {
return !($item instanceof FileItemInterface);
}
));
);
}
/**

View file

@ -255,7 +255,7 @@ class TopClient implements TopClientInterface
try {
$httpResponse = $this->httpClient->sendRequest($httpRequest);
} catch (ClientExceptionInterface $exception) {
throw new TopClientException(sprintf('Error sending request: %s', $exception->getMessage()), $exception);
throw new TopClientException(sprintf('Error sending request: %s', $exception->getMessage()), 0, $exception);
}
$bodyData = self::getBodyContents($httpResponse->getBody());

View file

@ -141,7 +141,7 @@ EOF;
'app_key' => self::getEnvAppKey(),
'method' => 'aliexpress.solution.seller.category.tree.query',
'category_id' => '5090300',
'filter_no_permission' => 1,
'filter_no_permission' => 'true',
'session' => self::getEnvToken()
]),
$this->responseJson(200, $json)