Skip to content

[Issue] UPS Shipment Tracking: Show "Delivered On" only when package has actually been delivered #29659

Closed
@m2-assistant

Description

@m2-assistant

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

No one assigned

    Labels

    Component: UpsFixed in 2.4.xThe issue has been fixed in 2.4-develop branchIssue: ConfirmedGate 3 Passed. Manual verification of the issue completed. Issue is confirmedIssue: Format is validGate 1 Passed. Automatic verification of issue format passedIssue: Ready for WorkGate 4. Acknowledged. Issue is added to backlog and ready for developmentPriority: P3May be fixed according to the position in the backlog.Progress: doneReported on 2.4.0Indicates original Magento version for the Issue report.Reproduced on 2.4.xThe issue has been reproduced on latest 2.4-develop branchSeverity: S3Affects non-critical data or functionality and does not force users to employ a workaround.

    Type

    No type

    Projects

    Status

    Done

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions