ref #91040 исправлена передача параметра subscribed по апи
This commit is contained in:
parent
9b3bfaf3ff
commit
a9fefc4fb8
1 changed files with 15 additions and 0 deletions
|
@ -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;
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Reference in a new issue