Skip to content

Commit

Permalink
Merge pull request #29 from Oneflow/development
Browse files Browse the repository at this point in the history
feat: added country and phone to setReturnAddress helper
  • Loading branch information
joseandrespg authored Nov 9, 2018
2 parents be646e9 + f8f7419 commit 683422f
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 3 deletions.
8 changes: 6 additions & 2 deletions src/order/orderData/shipment/shipment.php
Original file line number Diff line number Diff line change
Expand Up @@ -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");

Expand All @@ -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;

}

Expand Down Expand Up @@ -169,4 +173,4 @@ public function setLabelName($labelName) {
}
}

?>
?>
6 changes: 5 additions & 1 deletion tests/order/orderTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,9 @@ public function testCanBuildASingleItemOrder()
'town',
'state',
'postcode',
'isoCountryCode'
'isoCountryCode',
'country',
'phone'
);
$shipment->setCarrier('carrierCode', 'carrierService');
$shipment->setCarrierByAlias('carrierAlias');
Expand Down Expand Up @@ -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);
Expand Down

0 comments on commit 683422f

Please sign in to comment.