/**
  * {@inheritdoc}
  */
 public function placeOrder($cartId, PaymentInterface $paymentMethod = null)
 {
     /** @var $quoteIdMask QuoteIdMask */
     $quoteIdMask = $this->quoteIdMaskFactory->create()->load($cartId, 'masked_id');
     $this->cartRepository->get($quoteIdMask->getQuoteId())->setCheckoutMethod(CartManagementInterface::METHOD_GUEST);
     return $this->quoteManagement->placeOrder($quoteIdMask->getQuoteId(), $paymentMethod);
 }
 /**
  * @param \Magento\Checkout\Model\DefaultConfigProvider $subject
  * @param array $result
  * @return array
  * @SuppressWarnings(PHPMD.UnusedFormalParameter)
  */
 public function afterGetConfig(\Magento\Checkout\Model\DefaultConfigProvider $subject, array $result)
 {
     if ($this->persistentHelper->isEnabled() && $this->persistentSession->isPersistent() && !$this->customerSession->isLoggedIn()) {
         /** @var $quoteIdMask \Magento\Quote\Model\QuoteIdMask */
         $quoteIdMask = $this->quoteIdMaskFactory->create();
         $result['quoteData']['entity_id'] = $quoteIdMask->load($this->checkoutSession->getQuote()->getId(), 'quote_id')->getMaskedId();
     }
     return $result;
 }
 /**
  * {@inheritDoc}
  */
 public function getPaymentMethods($cartId, \Magento\Quote\Api\Data\AddressInterface $shippingAddress = null)
 {
     $quoteIdMask = $this->_quoteIdMaskFactory->create()->load($cartId, 'masked_id');
     $quoteId = $quoteIdMask->getQuoteId();
     // if shippingAddress is provided use this country
     $country = null;
     if ($shippingAddress) {
         $country = $shippingAddress->getCountryId();
     }
     return $this->_paymentMethodsHelper->getPaymentMethods($quoteId, $country);
 }
 /**
  * {@inheritDoc}
  */
 public function get($cartId)
 {
     /** @var $quoteIdMask QuoteIdMask */
     $quoteIdMask = $this->quoteIdMaskFactory->create()->load($cartId, 'masked_id');
     return $this->shippingAddressManagement->get($quoteIdMask->getQuoteId());
 }
 /**
  * {@inheritdoc}
  */
 public function remove($cartId)
 {
     /** @var $quoteIdMask QuoteIdMask */
     $quoteIdMask = $this->quoteIdMaskFactory->create()->load($cartId, 'masked_id');
     return $this->couponManagement->remove($quoteIdMask->getId());
 }
 /**
  * {@inheritDoc}
  */
 public function saveAddressInformation($cartId, \Magento\Checkout\Api\Data\ShippingInformationInterface $addressInformation)
 {
     /** @var $quoteIdMask \Magento\Quote\Model\QuoteIdMask */
     $quoteIdMask = $this->quoteIdMaskFactory->create()->load($cartId, 'masked_id');
     return $this->shippingInformationManagement->saveAddressInformation($quoteIdMask->getQuoteId(), $addressInformation);
 }
 /**
  * @inheritdoc
  */
 public function estimateByExtendedAddress($cartId, AddressInterface $address)
 {
     /** @var $quoteIdMask QuoteIdMask */
     $quoteIdMask = $this->quoteIdMaskFactory->create()->load($cartId, 'masked_id');
     return $this->getShipmentEstimationManagement()->estimateByExtendedAddress((int) $quoteIdMask->getQuoteId(), $address);
 }
 /**
  * {@inheritdoc}
  */
 public function getList($cartId)
 {
     /** @var $quoteIdMask QuoteIdMask */
     $quoteIdMask = $this->quoteIdMaskFactory->create()->load($cartId, 'masked_id');
     return $this->paymentMethodManagement->getList($quoteIdMask->getQuoteId());
 }
 /**
  * {@inheritDoc}
  */
 public function save($cartId, MessageInterface $giftMessage)
 {
     /** @var $quoteIdMask QuoteIdMask */
     $quoteIdMask = $this->quoteIdMaskFactory->create()->load($cartId, 'masked_id');
     return $this->repository->save($quoteIdMask->getQuoteId(), $giftMessage);
 }
Example #10
0
 /**
  * {@inheritdoc}
  */
 public function placeOrderCreatingAccount($cartId, $customer, $password, $agreements = null, PaymentInterface $paymentMethod = null)
 {
     /** @var $quoteIdMask QuoteIdMask */
     $quoteIdMask = $this->quoteIdMaskFactory->create()->load($cartId, 'masked_id');
     return $this->quoteManagement->placeOrderCreatingAccount($quoteIdMask->getQuoteId(), $customer, $password, $agreements, $paymentMethod);
 }
 /**
  * {@inheritDoc}
  */
 public function set($cartId, $carrierCode, $methodCode)
 {
     /** @var $quoteIdMask QuoteIdMask */
     $quoteIdMask = $this->quoteIdMaskFactory->create()->load($cartId, 'masked_id');
     return $this->shippingMethodManagement->set($quoteIdMask->getQuoteId(), $carrierCode, $methodCode);
 }
 /**
  * {@inheritdoc}
  */
 public function get($cartId)
 {
     /** @var $quoteIdMask QuoteIdMask */
     $quoteIdMask = $this->quoteIdMaskFactory->create()->load($cartId, 'masked_id');
     return $this->quoteRepository->get($quoteIdMask->getQuoteId());
 }
Example #13
0
 /**
  * {@inheritdoc}
  */
 public function placeOrder($cartId)
 {
     /** @var $quoteIdMask QuoteIdMask */
     $quoteIdMask = $this->quoteIdMaskFactory->create()->load($cartId, 'masked_id');
     return $this->quoteManagement->placeOrder($quoteIdMask->getId());
 }
 /**
  * {@inheritDoc}
  */
 public function getPaymentInformation($cartId)
 {
     $quoteIdMask = $this->quoteIdMaskFactory->create()->load($cartId, 'masked_id');
     return $this->paymentInformationManagement->getPaymentInformation($quoteIdMask->getQuoteId());
 }
 /**
  * {@inheritDoc}
  */
 public function estimateByAddress($cartId, \Magento\Quote\Api\Data\EstimateAddressInterface $address)
 {
     /** @var $quoteIdMask QuoteIdMask */
     $quoteIdMask = $this->quoteIdMaskFactory->create()->load($cartId, 'masked_id');
     return $this->shippingMethodManagement->estimateByAddress($quoteIdMask->getQuoteId(), $address);
 }
 /**
  * {@inheritdoc}
  */
 public function deleteById($cartId, $itemId)
 {
     /** @var $quoteIdMask QuoteIdMask */
     $quoteIdMask = $this->quoteIdMaskFactory->create()->load($cartId, 'masked_id');
     return $this->repository->deleteById($quoteIdMask->getQuoteId(), $itemId);
 }
 /**
  * {@inheritDoc}
  */
 public function collectTotals($cartId, \Magento\Quote\Api\Data\PaymentInterface $paymentMethod, $shippingCarrierCode = null, $shippingMethodCode = null, \Magento\Quote\Api\Data\TotalsAdditionalDataInterface $additionalData = null)
 {
     $quoteIdMask = $this->quoteIdMaskFactory->create()->load($cartId, 'masked_id');
     return $this->cartTotalManagement->collectTotals($quoteIdMask->getQuoteId(), $paymentMethod, $shippingCarrierCode, $shippingMethodCode, $additionalData);
 }
 /**
  * @{inheritdoc}
  */
 public function saveAddresses($cartId, \Magento\Quote\Api\Data\AddressInterface $billingAddress, \Magento\Quote\Api\Data\AddressInterface $shippingAddress = null, \Magento\Quote\Api\Data\AddressAdditionalDataInterface $additionalData = null)
 {
     $quoteIdMask = $this->quoteIdMaskFactory->create()->load($cartId, 'masked_id');
     return $this->addressDetailsManagement->saveAddresses($quoteIdMask->getQuoteId(), $billingAddress, $shippingAddress, $additionalData);
 }