|
7 | 7 |
|
8 | 8 | use Magento\Customer\Api\Data\CustomerInterface as CustomerDataObject;
|
9 | 9 | use Magento\Customer\Model\AccountManagement;
|
10 |
| -use Magento\Framework\App\ObjectManager; |
11 | 10 | use Magento\Framework\DataObject;
|
12 | 11 | use Magento\Paypal\Model\Cart as PaypalCart;
|
13 | 12 | use Magento\Paypal\Model\Config as PaypalConfig;
|
14 | 13 | use Magento\Quote\Model\Quote\Address;
|
15 |
| -use Magento\Sales\Api\OrderRepositoryInterface; |
16 | 14 | use Magento\Sales\Model\Order\Email\Sender\OrderSender;
|
17 | 15 |
|
18 | 16 | /**
|
@@ -270,11 +268,6 @@ class Checkout
|
270 | 268 | */
|
271 | 269 | protected $totalsCollector;
|
272 | 270 |
|
273 |
| - /** |
274 |
| - * @var OrderRepositoryInterface |
275 |
| - */ |
276 |
| - private $orderRepository; |
277 |
| - |
278 | 271 | /**
|
279 | 272 | * @param \Psr\Log\LoggerInterface $logger
|
280 | 273 | * @param \Magento\Customer\Model\Url $customerUrl
|
@@ -796,8 +789,7 @@ public function place($token, $shippingMethodCode = null)
|
796 | 789 |
|
797 | 790 | $this->ignoreAddressValidation();
|
798 | 791 | $this->_quote->collectTotals();
|
799 |
| - $orderId = $this->quoteManagement->placeOrder($this->_quote->getId()); |
800 |
| - $order = $this->getOrderRepository()->get($orderId); |
| 792 | + $order = $this->quoteManagement->submit($this->_quote); |
801 | 793 |
|
802 | 794 | if (!$order) {
|
803 | 795 | return;
|
@@ -1149,20 +1141,4 @@ protected function prepareGuestQuote()
|
1149 | 1141 | ->setCustomerGroupId(\Magento\Customer\Model\Group::NOT_LOGGED_IN_ID);
|
1150 | 1142 | return $this;
|
1151 | 1143 | }
|
1152 |
| - |
1153 |
| - /** |
1154 |
| - * Returns order repository instance |
1155 |
| - * |
1156 |
| - * @return OrderRepositoryInterface |
1157 |
| - * @deprecated |
1158 |
| - */ |
1159 |
| - private function getOrderRepository() |
1160 |
| - { |
1161 |
| - if ($this->orderRepository === null) { |
1162 |
| - $this->orderRepository = ObjectManager::getInstance() |
1163 |
| - ->get(OrderRepositoryInterface::class); |
1164 |
| - } |
1165 |
| - |
1166 |
| - return $this->orderRepository; |
1167 |
| - } |
1168 | 1144 | }
|
0 commit comments