|
|
|
@ -135,7 +135,6 @@ class Tracking_UPS {
|
|
|
|
|
// $from->country = (string) $trackinfo->OriginCountryCode ?? "";
|
|
|
|
|
//
|
|
|
|
|
// $info->setFrom($from);
|
|
|
|
|
|
|
|
|
|
// Only one entry, so put it in itself so the loop works
|
|
|
|
|
if (!isset($trackinfo["Package"]["Activity"][0])) {
|
|
|
|
|
$trackinfo["Package"]["Activity"] = [
|
|
|
|
@ -148,10 +147,17 @@ class Tracking_UPS {
|
|
|
|
|
$location->state = $history["ActivityLocation"]["Address"]["StateProvinceCode"] ?? "";
|
|
|
|
|
$location->zip = $history["ActivityLocation"]["Address"]["PostalCode"] ?? "";
|
|
|
|
|
$location->country = $history["ActivityLocation"]["Address"]["CountryCode"] ?? "";
|
|
|
|
|
if (!empty($history["Date"]) && !empty($history["Time"])) {
|
|
|
|
|
$datetimestring = DateTime::createFromFormat('Ymd His', "$history[Date] $history[Time]")->format("c");
|
|
|
|
|
} else if (!empty($history["Date"])) {
|
|
|
|
|
$datetimestring = DateTime::createFromFormat('Ymd His', "$history[Date]")->format("c");
|
|
|
|
|
} else {
|
|
|
|
|
$datetimestring = "";
|
|
|
|
|
}
|
|
|
|
|
$info->appendHistoryEntry(new TrackingEntry(
|
|
|
|
|
TrackingStatus::UPSEventTypeToStatus($history["Status"]["Type"]),
|
|
|
|
|
$history["Status"]["Description"] ?? "Unknown",
|
|
|
|
|
DateTime::createFromFormat('Ymd His', "$history[Date] $history[Time]")->format("c"),
|
|
|
|
|
$datetimestring,
|
|
|
|
|
$location
|
|
|
|
|
));
|
|
|
|
|
}
|
|
|
|
|