Magento 2 Documentation  2.3
Documentation for Magento 2 CMS v2.3 (December 2018)
GuestPaymentMethodManagement.php
Go to the documentation of this file.
1 <?php
7 
11 use Magento\Quote\Model\QuoteIdMaskFactory;
12 
17 {
22 
27 
34  public function __construct(
36  QuoteIdMaskFactory $quoteIdMaskFactory
37  ) {
38  $this->quoteIdMaskFactory = $quoteIdMaskFactory;
39  $this->paymentMethodManagement = $paymentMethodManagement;
40  }
41 
46  {
48  $quoteIdMask = $this->quoteIdMaskFactory->create()->load($cartId, 'masked_id');
49  return $this->paymentMethodManagement->set($quoteIdMask->getQuoteId(), $method);
50  }
51 
55  public function get($cartId)
56  {
58  $quoteIdMask = $this->quoteIdMaskFactory->create()->load($cartId, 'masked_id');
59  return $this->paymentMethodManagement->get($quoteIdMask->getQuoteId());
60  }
61 
65  public function getList($cartId)
66  {
68  $quoteIdMask = $this->quoteIdMaskFactory->create()->load($cartId, 'masked_id');
69  return $this->paymentMethodManagement->getList($quoteIdMask->getQuoteId());
70  }
71 }
__construct(PaymentMethodManagementInterface $paymentMethodManagement, QuoteIdMaskFactory $quoteIdMaskFactory)
$cartId
Definition: quote.php:22
$method
Definition: info.phtml:13