diff --git a/app/code/Magento/Sales/Api/Data/OrderInterface.php b/app/code/Magento/Sales/Api/Data/OrderInterface.php index 5c7a809c8ea09..c3d8debff23f9 100644 --- a/app/code/Magento/Sales/Api/Data/OrderInterface.php +++ b/app/code/Magento/Sales/Api/Data/OrderInterface.php @@ -1528,6 +1528,13 @@ public function setItems($items); */ public function getBillingAddress(); + /** + * Gets the shipping address, if any, for the order. + * + * @return \Magento\Sales\Api\Data\OrderAddressInterface|null Shipping address. Otherwise, null. + */ + public function getShippingAddress(); + /** * Sets the billing address, if any, for the order. * @@ -1536,6 +1543,14 @@ public function getBillingAddress(); */ public function setBillingAddress(\Magento\Sales\Api\Data\OrderAddressInterface $billingAddress = null); + /** + * Sets the shipping address, if any, for the order. + * + * @param \Magento\Sales\Api\Data\OrderAddressInterface $shippingAddress + * @return $this + */ + public function setShippingAddress(\Magento\Sales\Api\Data\OrderAddressInterface $shippingAddress = null); + /** * Gets order payment * diff --git a/dev/tests/api-functional/testsuite/Magento/Sales/Service/V1/OrderGetTest.php b/dev/tests/api-functional/testsuite/Magento/Sales/Service/V1/OrderGetTest.php index ec688ded48103..d3c50bf63b72a 100644 --- a/dev/tests/api-functional/testsuite/Magento/Sales/Service/V1/OrderGetTest.php +++ b/dev/tests/api-functional/testsuite/Magento/Sales/Service/V1/OrderGetTest.php @@ -39,7 +39,7 @@ public function testOrderGet() 'increment_id' => self::ORDER_INCREMENT_ID, ]; $expectedPayments = ['method' => 'checkmo']; - $expectedBillingAddressNotEmpty = [ + $expectedAddressNotEmpty = [ 'city', 'postcode', 'lastname', @@ -78,8 +78,18 @@ public function testOrderGet() } $this->assertArrayHasKey('billing_address', $result); - foreach ($expectedBillingAddressNotEmpty as $field) { - $this->assertArrayHasKey($field, $result['billing_address']); + $this->assertArrayHasKey('shipping_address', $result); + foreach ($expectedAddressNotEmpty as $field) { + $this->assertArrayHasKey( + $field, + $result['billing_address'], + "Billing address should have field {$field}" + ); + $this->assertArrayHasKey( + $field, + $result['shipping_address'], + "Shipping address should have field {$field}" + ); } //check that nullable fields were marked as optional and were not sent