Update USPS tracking library

This commit is contained in:
Skylar Ittner 2025-12-14 16:47:25 -07:00
parent 8a18007fd9
commit 60ddb9e1bf
2 changed files with 4 additions and 4 deletions

View File

@ -106,7 +106,7 @@ class Tracking_FedEx {
} catch (Exception $ex) {
throw new TrackingException("There was a server problem. This code cannot be tracked right now.");
}
$info = new TrackingInfo();
$info->setCode($trackinfo["trackingNumberInfo"]["trackingNumber"]);

View File

@ -121,9 +121,9 @@ class Tracking_USPS {
$info->setFrom($from);
$to = new Location();
$to->city = (string) $trackinfo["destinationCity"] ?? "";
$to->state = (string) $trackinfo["destinationState"] ?? "";
$to->zip = (string) $trackinfo["destinationZIP"] ?? "";
$to->city = (string) (isset($trackinfo["destinationCity"]) ? ($trackinfo["destinationCity"] ?? "") : "");
$to->state = (string) (isset($trackinfo["destinationState"]) ? ($trackinfo["destinationState"] ?? "") : "");
$to->zip = (string) (isset($trackinfo["destinationZIP"]) ? ($trackinfo["destinationZIP"] ?? "") : "");
$to->country = (string) (isset($trackinfo["destinationCountry"]) ? $trackinfo["destinationCountry"] : "");
$info->setTo($to);