1
0
Fork 0
mirror of synced 2025-04-04 14:23:33 +03:00

ref #91040 исправлена передача параметра subscribed по апи

This commit is contained in:
Ivan Chaplygin 2023-07-12 14:01:47 +03:00
parent 9b3bfaf3ff
commit a9fefc4fb8

View file

@ -99,6 +99,7 @@ trait CustomersTrait
public function customersCreate(CustomersCreateRequest $request): ?CustomerChangeResponse
{
$serialized = Serializer::serializeArray($request);
$serialized = $this->setBooleanParameters($serialized);
$response = $this->client->customersCreate($serialized['customer'] ?? [], $request->site);
return Deserializer::deserializeArray($response->getResponseBody(), CustomerChangeResponse::class);
@ -182,4 +183,18 @@ trait CustomersTrait
return Deserializer::deserializeArray($response->getResponseBody(), HistoryResponse::class);
}
/**
* @param array $serializedRequest
* @return array
*/
private function setBooleanParameters($serializedRequest)
{
if (empty($serializedRequest['customer']['subscribed']))
{
$serializedRequest['customer']['subscribed'] = false;
}
return $serializedRequest;
}
}