abantecart / ups-php

PHP SDK to UPS RESTful API
MIT License
14 stars 9 forks source link

PackageResults does not work as expected #3

Closed DemigodCode closed 1 year ago

DemigodCode commented 1 year ago

The PackageResults Property of ShipmentResults can be an array of PackageResults or just the properties of an PackageResults-Object

Single: "PackageResults": { "TrackingNumber": "1ZXXXXXXXXXXXXXXXX", "ServiceOptionsCharges": { "CurrencyCode": "USD", "MonetaryValue": "0.00" }, "ShippingLabel": { "ImageFormat": { "Code": "ZPL", "Description": "ZPL" }, "GraphicImage": "" } }

Multiple:

"PackageResults": [ { "TrackingNumber": "1ZXXXXXXXXXXXXXXXX", "ServiceOptionsCharges": { "CurrencyCode": "USD", "MonetaryValue": "0.00" }, "ShippingLabel": { "ImageFormat": { "Code": "ZPL", "Description": "ZPL" }, "GraphicImage": "" } }, { "TrackingNumber": "1ZXXXXXXXXXXXXXXXX", "ServiceOptionsCharges": { "CurrencyCode": "USD", "MonetaryValue": "0.00" }, "ShippingLabel": { "ImageFormat": { "Code": "ZPL", "Description": "ZPL" }, "GraphicImage": "" } } ]

The swagger generated classes do not support this and currently only array as PackageResults are supported.

abolabo commented 1 year ago

in the v1.0.2 i see arrays on containers in the response. Looks like ups dev team fixed it. Please check and let us know.

DemigodCode commented 1 year ago

Yes, there are containers, but these containers are empty, cause if you create one single package in a shipment, it returns the package property instead of an array of packages. It's still not working. Same error as before.

DemigodCode commented 1 year ago

https://github.com/UPS-API/api-documentation/issues/3#issuecomment-1798198715

I have an ongoing discussion with UPS about that and others too.