/**
  * {@inheritDoc}
  */
 public function savePaymentInformation($cartId, \Magento\Quote\Api\Data\PaymentInterface $paymentMethod, \Magento\Quote\Api\Data\AddressInterface $billingAddress = null)
 {
     if ($billingAddress) {
         $this->billingAddressManagement->assign($cartId, $billingAddress);
     }
     $this->paymentMethodManagement->set($cartId, $paymentMethod);
     return true;
 }
 /**
  * @{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, $checkoutMethod = null)
 {
     $this->billingAddressManagement->assign($cartId, $billingAddress);
     /** @var \Magento\Quote\Api\Data\AddressDetailsInterface  $addressDetails */
     $addressDetails = $this->addressDetailsFactory->create();
     if ($shippingAddress) {
         $this->shippingAddressManagement->assign($cartId, $shippingAddress);
         $addressDetails->setFormattedShippingAddress($this->shippingAddressManagement->get($cartId)->format('html'));
         $addressDetails->setShippingMethods($this->shippingMethodManagement->getList($cartId));
     }
     $addressDetails->setPaymentMethods($this->paymentMethodManagement->getList($cartId));
     if ($additionalData !== null) {
         $this->dataProcessor->process($additionalData);
     }
     if ($checkoutMethod != null) {
         $this->quoteRepository->save($this->quoteRepository->getActive($cartId)->setCheckoutMethod($checkoutMethod));
     }
     $addressDetails->setFormattedBillingAddress($this->billingAddressManagement->get($cartId)->format('html'));
     $addressDetails->setTotals($this->cartTotalsRepository->get($cartId));
     return $addressDetails;
 }
 /**
  * {@inheritDoc}
  */
 public function get($cartId)
 {
     /** @var $quoteIdMask QuoteIdMask */
     $quoteIdMask = $this->quoteIdMaskFactory->create()->load($cartId, 'masked_id');
     return $this->billingAddressManagement->get($quoteIdMask->getQuoteId());
 }