gabrielbull / php-ups-api

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

ISSUE : DOMDocument::createElement(): Argument #2 ($value) must be of type string, Ups\Entity\Shipper given #340

Closed TuhiranDevbhuti closed 2 years ago

TuhiranDevbhuti commented 2 years ago

Hello @Rud5G @thijsw @okj579 @MPiccinato @JREAM

I 'm facing a issue in the shipping class "DOMDocument::createElement(): Argument #2 ($value) must be of type string, Ups\Entity\Shipper given" under gabrielbull\ups-api\src\Shipping.php $shipperNode->appendChild($xml->createElement('ShipperNumber', $shipment->getShipper()->getShipperNumber())) Shipper-given ;

okj579 commented 2 years ago

Hi @TuhiranDevbhuti, how are you setting ShipperNumber? It looks like it contains an object instead of a string.

TuhiranDevbhuti commented 2 years ago

Hello @okj579 I'm using exactly the same code shipping API https://github.com/gabrielbull/php-ups-api#shipping-class-example