|
12 | 12 | use Magento\Quote\Model\Quote\Address;
|
13 | 13 | use Magento\Framework\DataObject;
|
14 | 14 | use Magento\Paypal\Model\Cart as PaypalCart;
|
15 |
| -use Magento\Framework\App\ObjectManager; |
16 |
| -use Magento\Sales\Api\OrderRepositoryInterface; |
17 | 15 |
|
18 | 16 | /**
|
19 | 17 | * Wrapper that performs Paypal Express and Checkout communication
|
@@ -270,13 +268,6 @@ class Checkout
|
270 | 268 | */
|
271 | 269 | protected $totalsCollector;
|
272 | 270 |
|
273 |
| - /** |
274 |
| - * Order repository interface. |
275 |
| - * |
276 |
| - * @var OrderRepositoryInterface |
277 |
| - */ |
278 |
| - private $orderRepository; |
279 |
| - |
280 | 271 | /**
|
281 | 272 | * @param \Psr\Log\LoggerInterface $logger
|
282 | 273 | * @param \Magento\Customer\Model\Url $customerUrl
|
@@ -805,8 +796,7 @@ public function place($token, $shippingMethodCode = null)
|
805 | 796 |
|
806 | 797 | $this->ignoreAddressValidation();
|
807 | 798 | $this->_quote->collectTotals();
|
808 |
| - $orderId = $this->quoteManagement->placeOrder($this->_quote->getId()); |
809 |
| - $order = $this->getOrderRepository()->get($orderId); |
| 799 | + $order = $this->quoteManagement->submit($this->_quote); |
810 | 800 |
|
811 | 801 | if (!$order) {
|
812 | 802 | return;
|
@@ -1174,21 +1164,4 @@ protected function prepareGuestQuote()
|
1174 | 1164 | ->setCustomerGroupId(\Magento\Customer\Model\Group::NOT_LOGGED_IN_ID);
|
1175 | 1165 | return $this;
|
1176 | 1166 | }
|
1177 |
| - |
1178 |
| - /** |
1179 |
| - * Returns order repository instance. |
1180 |
| - * |
1181 |
| - * @return OrderRepositoryInterface |
1182 |
| - * |
1183 |
| - * @deprecated |
1184 |
| - */ |
1185 |
| - private function getOrderRepository() |
1186 |
| - { |
1187 |
| - if ($this->orderRepository === null) { |
1188 |
| - $this->orderRepository = ObjectManager::getInstance() |
1189 |
| - ->get(OrderRepositoryInterface::class); |
1190 |
| - } |
1191 |
| - |
1192 |
| - return $this->orderRepository; |
1193 |
| - } |
1194 | 1167 | }
|
0 commit comments