Update USPS tracking library
This commit is contained in:
parent
8a18007fd9
commit
60ddb9e1bf
@ -106,7 +106,7 @@ class Tracking_FedEx {
|
|||||||
} catch (Exception $ex) {
|
} catch (Exception $ex) {
|
||||||
throw new TrackingException("There was a server problem. This code cannot be tracked right now.");
|
throw new TrackingException("There was a server problem. This code cannot be tracked right now.");
|
||||||
}
|
}
|
||||||
|
|
||||||
$info = new TrackingInfo();
|
$info = new TrackingInfo();
|
||||||
|
|
||||||
$info->setCode($trackinfo["trackingNumberInfo"]["trackingNumber"]);
|
$info->setCode($trackinfo["trackingNumberInfo"]["trackingNumber"]);
|
||||||
|
|||||||
@ -121,9 +121,9 @@ class Tracking_USPS {
|
|||||||
$info->setFrom($from);
|
$info->setFrom($from);
|
||||||
|
|
||||||
$to = new Location();
|
$to = new Location();
|
||||||
$to->city = (string) $trackinfo["destinationCity"] ?? "";
|
$to->city = (string) (isset($trackinfo["destinationCity"]) ? ($trackinfo["destinationCity"] ?? "") : "");
|
||||||
$to->state = (string) $trackinfo["destinationState"] ?? "";
|
$to->state = (string) (isset($trackinfo["destinationState"]) ? ($trackinfo["destinationState"] ?? "") : "");
|
||||||
$to->zip = (string) $trackinfo["destinationZIP"] ?? "";
|
$to->zip = (string) (isset($trackinfo["destinationZIP"]) ? ($trackinfo["destinationZIP"] ?? "") : "");
|
||||||
$to->country = (string) (isset($trackinfo["destinationCountry"]) ? $trackinfo["destinationCountry"] : "");
|
$to->country = (string) (isset($trackinfo["destinationCountry"]) ? $trackinfo["destinationCountry"] : "");
|
||||||
|
|
||||||
$info->setTo($to);
|
$info->setTo($to);
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user