OpenMage / magento-lts

Official OpenMage LTS codebase | Migrate easily from Magento Community Edition in minutes! Download the source code for free or contribute to OpenMage LTS | Security vulnerability patches, bug fixes, performance improvements and more.
https://www.openmage.org
Open Software License 3.0
863 stars 438 forks source link

Fix ship-to address for UPS REST shipment API #4047

Open ragnese opened 1 week ago

ragnese commented 1 week ago

Description (*)

When a shipment is a "return", only the "ShipFrom" needs to change from the store owner to the customer. The "ShipTo" will already be the store owner and does not need to be changed.

Related Pull Requests

N/A

Fixed Issues (if relevant)

N/A

Manual testing scenarios (*)

Create a return shipment and try to get labels.

Questions or comments

This is kind of funny, actually. If you look at the XML version of the code that creates the request object, you can see that the XML code does not REPLACE the "ShipFrom" and "ShipTo" when it's a return shipment--it actually ADDS another "ShipTo" node, which is ignored by UPS. Since UPS only looks at the first "ShipTo" node, the old XML code worked even though it was wrong. The REST code tried to mirror what the XML code does, but actually replaces the node instead of adding more.

Contribution checklist (*)

fballiano commented 5 days ago

how do you create a return shipping label? I know only how to generate a normal shipping label, but I see know that the PDF is broken for me, it doesn't open.

fballiano commented 2 days ago

@ragnese?