Skip to content

Commit

Permalink
Add Locale to Shipment (#330)
Browse files Browse the repository at this point in the history
Co-authored-by: Xavi Baz <fjbaz@hiberus.com>
  • Loading branch information
pista7 and xbaz authored Nov 12, 2021
1 parent d3e5040 commit b17eb56
Show file tree
Hide file tree
Showing 2 changed files with 29 additions and 0 deletions.
25 changes: 25 additions & 0 deletions src/Entity/Shipment.php
Original file line number Diff line number Diff line change
Expand Up @@ -123,6 +123,11 @@ class Shipment
*/
private $taxInformationIndicator;

/**
* @var string
*/
private $locale;

public function __construct()
{
$this->setShipper(new Shipper());
Expand Down Expand Up @@ -610,4 +615,24 @@ public function setTaxInformationIndicator(bool $taxInformationIndicator): self

return $this;
}

/**
* @return string
*/
public function getLocale()
{
return $this->locale;
}

/**
* @param string $locale
*
* @return Shipment
*/
public function setLocale($locale)
{
$this->locale = $locale;

return $this;
}
}
4 changes: 4 additions & 0 deletions src/Shipping.php
Original file line number Diff line number Diff line change
Expand Up @@ -429,6 +429,10 @@ private function createConfirmRequest(
if ($receiptSpec) {
$container->appendChild($xml->importNode($this->compileReceiptSpecificationNode($receiptSpec), true));
}

if ($shipment->getLocale()) {
$shipmentNode->appendChild($xml->createElement('Locale', $shipment->getLocale()));
}
return $xml->saveXML();
}

Expand Down

0 comments on commit b17eb56

Please sign in to comment.