gabrielbull / php-ups-api

PHP Wrapper for all UPS API
MIT License
456 stars 255 forks source link

Allow BillThirdPartyConsignee to be set in ItemizedPaymentInformation #343

Open coenjacobs opened 2 years ago

coenjacobs commented 2 years ago

As per the UPS OnLine® Tools Shipping XML Tool Developers Guide (non-official link) (page 76), the BillThirdPartyConsignee element can be present instead of the BillThirdPartyShipper inside of a ItemizedPaymentInformation element:

This element or its sibling element, BillThirdPartyShipper, must be present but no more than one can be present.

The purpose of this field is to have a separate BillThirdParty inside your ItemizedPaymentInformation that is not charged for shipping, but (for example) only for duties and taxes (using the SHIPMENT_CHARGE_TYPE_DUTIES type on the ShipmentCharge).

In this pull request I've repurposed the main BillThirdParty object to be passed as a BillThirdPartyShipper parameter, as they are identical in terms of fields and methods. I'm open to suggestions to make this more optimal, if needed.