From d32a1abf8fcf496a03cc3abe2e037c081bac8df5 Mon Sep 17 00:00:00 2001 From: AlexV Date: Wed, 16 Oct 2024 16:50:06 +0700 Subject: [PATCH] feat: entity-id header --- src/CoreApi.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/CoreApi.php b/src/CoreApi.php index b0132d1..28009cd 100644 --- a/src/CoreApi.php +++ b/src/CoreApi.php @@ -50,13 +50,13 @@ public function syncShop(string $authIntToken): string throw new ShopRegistrationException('[CDEKDelivery] Register shop failed', 'cdek_error.register.shop'); } - if (empty($response->data()['id'])) { + if (empty($response->getHeaders()['X-Entity-Id'])) { throw new ShopRegistrationException( '[CDEKDelivery] Failed to get shop uuid', 'cdek_error.uuid.auth', $response->data(), ); } - return $response->data()['id']; + return $response->getHeaders()['X-Entity-Id']; } /**