diff --git a/src/Entity/Shipment.php b/src/Entity/Shipment.php index 5ed6aeff..89854827 100644 --- a/src/Entity/Shipment.php +++ b/src/Entity/Shipment.php @@ -78,7 +78,7 @@ class Shipment * @var ReferenceNumber */ private $referenceNumber; - + /** * @var ReferenceNumber */ @@ -103,7 +103,7 @@ class Shipment * @var InvoiceLineTotal */ private $invoiceLineTotal; - + /** * @var ShipmentTotalWeight */ @@ -118,6 +118,10 @@ class Shipment * @var DeliveryTimeInformation */ private $deliveryTimeInformation; + /** + * @var bool + */ + private $taxInformationIndicator; public function __construct() { @@ -126,6 +130,7 @@ public function __construct() $this->setShipmentServiceOptions(new ShipmentServiceOptions()); $this->setService(new Service()); $this->rateInformation = null; + $this->taxInformationIndicator = false; } /** @@ -205,7 +210,7 @@ public function setReferenceNumber(ReferenceNumber $referenceNumber) return $this; } - + /** * @param ReferenceNumber $referenceNumber * @@ -225,7 +230,7 @@ public function getReferenceNumber() { return $this->referenceNumber; } - + /** * @return ReferenceNumber */ @@ -574,7 +579,7 @@ public function setDeliveryTimeInformation(DeliveryTimeInformation $deliveryTime { $this->deliveryTimeInformation = $deliveryTimeInformation; } - + /** * @return ShipmentTotalWeight */ @@ -590,4 +595,19 @@ public function setShipmentTotalWeight(ShipmentTotalWeight $shipmentTotalWeight) { $this->shipmentTotalWeight = $shipmentTotalWeight; } + + public function getTaxInformationIndicator(): bool + { + return $this->taxInformationIndicator; + } + + /** + * If called, returned prices will include Tax Information + */ + public function setTaxInformationIndicator(bool $taxInformationIndicator): self + { + $this->taxInformationIndicator = $taxInformationIndicator; + + return $this; + } } diff --git a/src/Rate.php b/src/Rate.php index da0877bf..9146fc3a 100644 --- a/src/Rate.php +++ b/src/Rate.php @@ -190,17 +190,21 @@ private function createRequest(RateRequest $rateRequest) if (isset($deliveryTimeInformation)) { $shipmentNode->appendChild($deliveryTimeInformation->toNode($xml)); } - + $ShipmentTotalWeight = $shipment->getShipmentTotalWeight(); if (isset($ShipmentTotalWeight)) { $shipmentNode->appendChild($ShipmentTotalWeight->toNode($xml)); } - + $InvoiceLineTotal = $shipment->getInvoiceLineTotal(); if (isset($InvoiceLineTotal)) { $shipmentNode->appendChild($InvoiceLineTotal->toNode($xml)); } + if ($shipment->getTaxInformationIndicator()) { + $shipmentNode->appendChild($xml->createElement('TaxInformationIndicator')); + } + return $xml->saveXML(); }