] );
$data = \
json_decode($response->
getBody()->
getContents(), true, flags: \JSON_THROW_ON_ERROR
);
$userToken =
new ShopUserTokenStruct( $data['shopUserToken'
]['token'
],
new \
DateTimeImmutable($data['shopUserToken'
]['expirationDate'
]) );
$accessTokenStruct =
new AccessTokenStruct( $userToken,
$data['shopSecret'
] ?? null,
);
$this->storeService->
updateStoreToken($context,
$accessTokenStruct);
$this->configService->
set('core.store.shopSecret',
$accessTokenStruct->
getShopSecret());
} /**
* @return array<string, mixed>
*/