diff --git a/src/ShippingPackage.php b/src/ShippingPackage.php index 15f95a7..ab3e36f 100644 --- a/src/ShippingPackage.php +++ b/src/ShippingPackage.php @@ -28,6 +28,12 @@ class ShippingPackage protected $quantity; + protected $shape; + + protected $weightunit; + + protected $widthunit; + protected $defaultdimensions = [ 'height' => 0, 'width' => 0, @@ -78,6 +84,7 @@ public function __construct($weight = 0, $dimensions = [], $options = []) $this->defaultdimensions, ['value' => null, 'quantity' => null] ); + foreach ($zerochecks as $dimension => $value) { if ($this->$dimension < 0) { $this->$dimension = 0; @@ -98,9 +105,11 @@ public function toArray() "currency" => $this->currency, "quantity" => $this->quantity ]; + return array_filter($data); } + public function __toString() { $out = ""; @@ -147,4 +156,29 @@ public function quantity() { return $this->quantity; } + + public function shape() + { + return $this->shape; + } + + public function weightunit() + { + return $this->weightunit; + } + + public function widthunit() + { + return $this->widthunit; + } + + public function diameter() + { + return $this->diameter; + } + + public function currency() + { + return $this->currency; + } }