This commit is contained in:
2026-03-31 17:52:01 +02:00
parent 50507d70a5
commit 34b0a2b4f5
4 changed files with 7 additions and 3 deletions

View File

@@ -133,7 +133,7 @@ final class ApaczkaApiClient
throw new ApaczkaApiException('API Apaczka HTTP ' . $httpCode . ': ' . $message);
}
if ($status !== 200) {
$responsePreview = substr(json_encode($decoded, JSON_UNESCAPED_UNICODE | JSON_UNESCAPED_SLASHES) ?: '', 0, 240);
$responsePreview = substr(json_encode($decoded, JSON_UNESCAPED_UNICODE | JSON_UNESCAPED_SLASHES) ?: '', 0, 1000);
throw new ApaczkaApiException(
'Blad API Apaczka (status ' . $status . '): ' . $message . '. Odpowiedz: ' . $responsePreview
);
@@ -144,7 +144,7 @@ final class ApaczkaApiClient
if ($lastSignatureError !== null) {
[$decoded, $status, $message] = $lastSignatureError;
$responsePreview = substr(json_encode($decoded, JSON_UNESCAPED_UNICODE | JSON_UNESCAPED_SLASHES) ?: '', 0, 240);
$responsePreview = substr(json_encode($decoded, JSON_UNESCAPED_UNICODE | JSON_UNESCAPED_SLASHES) ?: '', 0, 1000);
throw new ApaczkaApiException(
'Blad API Apaczka (status ' . $status . '): ' . $message . '. Odpowiedz: ' . $responsePreview
);

View File

@@ -214,7 +214,9 @@ final class ApaczkaShipmentService implements ShipmentProviderInterface
return str_contains($message, 'pickup not available for selected day')
|| str_contains($message, "can\\u2019t place an order today")
|| str_contains($message, "can't place an order today")
|| str_contains($message, 'change its date to another working day');
|| str_contains($message, 'change its date to another working day')
|| str_contains($message, 'time between cut-off hours for pickup is too short')
|| str_contains($message, 'an order for the same day can be placed up till');
}
/**