diff --git a/usps_api_bridge.php b/usps_api_bridge.php index e59c323..8d73353 100644 --- a/usps_api_bridge.php +++ b/usps_api_bridge.php @@ -234,6 +234,9 @@ class Usps_Api_Bridge extends Module } if (empty($destCountryIso)) { + $this->externalLog([ + 'destCountryIso' => 'set to default', + ]); $destCountryIso = 'US'; } @@ -249,11 +252,25 @@ class Usps_Api_Bridge extends Module // Map Code $newApiClass = $this->mapServiceCodeToApiClass($methodCode, $isInternational); - if (!$newApiClass) return false; + if (!$newApiClass) { + $this->externalLog([ + 'mapServiceCodeToApiClass()' => 'failed', + 'methodCode' => $methodCode, + 'isInternational' => $isInternational, + ]); + return false; + } // 6. Pack Products $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 $client = new UspsV3Client($token, (bool)\Configuration::get('USPS_BRIDGE_LIVE_MODE'));