From f8f7419f0b4de12a675be5f301ed1ed9c3fd0418 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jose=20Andr=C3=A9s=20Puertas?= Date: Fri, 9 Nov 2018 14:35:07 +0000 Subject: [PATCH] feat: added country and phone to setReturnAddress helper --- src/order/orderData/shipment/shipment.php | 8 ++++++-- tests/order/orderTest.php | 6 +++++- 2 files changed, 11 insertions(+), 3 deletions(-) diff --git a/src/order/orderData/shipment/shipment.php b/src/order/orderData/shipment/shipment.php index e87222f..8c6d08c 100644 --- a/src/order/orderData/shipment/shipment.php +++ b/src/order/orderData/shipment/shipment.php @@ -115,9 +115,11 @@ public function setShipTo($name, $companyName, $address1, $address2="", $address * @param string $state (default: "") * @param mixed $postcode * @param mixed $isoCountry + * @param mixed $country + * @param mixed $phone * @return void */ - public function setReturnAddress($name, $companyName, $address1, $address2="", $address3="", $town, $state="", $postcode, $isoCountry) { + public function setReturnAddress($name, $companyName, $address1, $address2="", $address3="", $town, $state="", $postcode, $isoCountry, $country="", $phone) { $this->__addObject("returnAddress","Address"); @@ -130,6 +132,8 @@ public function setReturnAddress($name, $companyName, $address1, $address2="", $ $this->returnAddress->state = $state; $this->returnAddress->isoCountry = $isoCountry; $this->returnAddress->postcode = $postcode; + $this->returnAddress->country = $country; + $this->returnAddress->phone = $phone; } @@ -169,4 +173,4 @@ public function setLabelName($labelName) { } } -?> \ No newline at end of file +?> diff --git a/tests/order/orderTest.php b/tests/order/orderTest.php index d14bc1e..11e2e5c 100644 --- a/tests/order/orderTest.php +++ b/tests/order/orderTest.php @@ -66,7 +66,9 @@ public function testCanBuildASingleItemOrder() 'town', 'state', 'postcode', - 'isoCountryCode' + 'isoCountryCode', + 'country', + 'phone' ); $shipment->setCarrier('carrierCode', 'carrierService'); $shipment->setCarrierByAlias('carrierAlias'); @@ -167,6 +169,8 @@ public function testCanBuildASingleItemOrder() $this->assertEquals('state', $outputShipment->returnAddress->state); $this->assertEquals('postcode', $outputShipment->returnAddress->postcode); $this->assertEquals('isoCountryCode', $outputShipment->returnAddress->isoCountry); + $this->assertEquals('country', $outputShipment->returnAddress->country); + $this->assertEquals('phone', $outputShipment->returnAddress->phone); $this->assertObjectHasAttribute('carrier', $outputShipment); $this->assertEquals('carrierCode', $outputShipment->carrier->code);