extend debug info

This commit is contained in:
O K
2026-01-21 09:55:35 +02:00
parent 187ee14549
commit 7601859990

View File

@@ -234,6 +234,9 @@ class Usps_Api_Bridge extends Module
} }
if (empty($destCountryIso)) { if (empty($destCountryIso)) {
$this->externalLog([
'destCountryIso' => 'set to default',
]);
$destCountryIso = 'US'; $destCountryIso = 'US';
} }
@@ -249,11 +252,25 @@ class Usps_Api_Bridge extends Module
// Map Code // Map Code
$newApiClass = $this->mapServiceCodeToApiClass($methodCode, $isInternational); $newApiClass = $this->mapServiceCodeToApiClass($methodCode, $isInternational);
if (!$newApiClass) return false; if (!$newApiClass) {
$this->externalLog([
'mapServiceCodeToApiClass()' => 'failed',
'methodCode' => $methodCode,
'isInternational' => $isInternational,
]);
return false;
}
// 6. Pack Products // 6. Pack Products
$packedBoxes = $originalModule->getHelper()->getCarrierHelper()->packProducts($products, $params->id); $packedBoxes = $originalModule->getHelper()->getCarrierHelper()->packProducts($products, $params->id);
if (empty($packedBoxes)) return false; if (empty($packedBoxes)) {
$this->externalLog([
'packProducts()' => 'failed',
'products' => $products,
'params->id' => $params->id,
]);
return false;
}
// 7. Setup Client // 7. Setup Client
$client = new UspsV3Client($token, (bool)\Configuration::get('USPS_BRIDGE_LIVE_MODE')); $client = new UspsV3Client($token, (bool)\Configuration::get('USPS_BRIDGE_LIVE_MODE'));