Description
This issue is automatically created based on existing pull request: #29080: UPS Shipment Tracking: Show "Delivered On" only when package has actually been delivered
Summary (*)
Magento 2.4-develop
The UPS Tracking API returns the activity status code "D" for delivered packages. The delivery properties of the tracking object should only be set if we see this status code. Otherwise packages that are still in transit show as delivered, incorrectly.
Consider the following extract of a UPS tracking API response:
...
<Package>
<TrackingNumber>*REMOVED*</TrackingNumber>
<DeliveryIndicator>N</DeliveryIndicator>
<Activity>
<ActivityLocation>
<Address>
<City>Secaucus</City>
<StateProvinceCode>NJ</StateProvinceCode>
<CountryCode>US</CountryCode>
</Address>
</ActivityLocation>
<Status>
<StatusType>
<Code>I</Code>
<Description>Departed from Facility</Description>
</StatusType>
<StatusCode>
<Code>DP</Code>
</StatusCode>
</Status>
<Date>20200711</Date>
<Time>034100</Time>
<GMTDate>2020-07-11</GMTDate>
<GMTTime>07:41:00</GMTTime>
<GMTOffset>-04:00</GMTOffset>
<NextScheduleActivity>
<Date>2020-07-15</Date>
<Time>235900</Time>
</NextScheduleActivity>
</Activity>
<Activity>
<ActivityLocation>
<Address>
<City>New York</City>
<StateProvinceCode>NY</StateProvinceCode>
<CountryCode>US</CountryCode>
</Address>
</ActivityLocation>
<Status>
<StatusType>
<Code>I</Code>
<Description>Origin Scan</Description>
</StatusType>
<StatusCode>
<Code>OR</Code>
</StatusCode>
</Status>
<Date>20200710</Date>
<Time>202339</Time>
<GMTDate>2020-07-11</GMTDate>
<GMTTime>00:23:39</GMTTime>
<GMTOffset>-04:00</GMTOffset>
</Activity>
...
In this case, the package is still in transit. However, because the check for the DeliveryStatus
is missing, the package would incorrectly show as delivered in Magento, and display the date/time of the first activity as Delivered On.
Examples (*)
You will need a valid UPS tracking number and UPS API keys to test this.
Proposed solution
Metadata
Metadata
Assignees
Labels
Type
Projects
Status