- public function savePaymentInformationAndPlaceOrder(
- $cartId,
- \Magento\Quote\Api\Data\PaymentInterface $paymentMethod,
- \Magento\Quote\Api\Data\AddressInterface $billingAddress = null
- ) {
- $this->savePaymentInformation($cartId, $paymentMethod, $billingAddress);
- try {
- $orderId = $this->cartManagement->placeOrder($cartId);
- } catch (\Exception $e) {
- throw new CouldNotSaveException(__('Cannot place order'), $e);
- }
- return $orderId;
- }