public function testSavePaymentInformationWithoutBillingAddress() { $cartId = 100; $paymentMock = $this->getMock('\\Magento\\Quote\\Api\\Data\\PaymentInterface'); $this->billingAddressManagementMock->expects($this->never())->method('assign'); $this->paymentMethodManagementMock->expects($this->once())->method('set')->with($cartId, $paymentMock); $this->assertTrue($this->model->savePaymentInformation($cartId, $paymentMock)); }
/** * {@inheritdoc} */ public function getPaymentInformation($cartId) { $pluginInfo = $this->pluginList->getNext($this->subjectType, 'getPaymentInformation'); if (!$pluginInfo) { return parent::getPaymentInformation($cartId); } else { return $this->___callPlugins('getPaymentInformation', func_get_args(), $pluginInfo); } }
/** * {@inheritdoc} */ public function savePaymentInformation($cartId, \Magento\Quote\Api\Data\PaymentInterface $paymentMethod, \Magento\Quote\Api\Data\AddressInterface $billingAddress = null) { $pluginInfo = $this->pluginList->getNext($this->subjectType, 'savePaymentInformation'); if (!$pluginInfo) { return parent::savePaymentInformation($cartId, $paymentMethod, $billingAddress); } else { return $this->___callPlugins('savePaymentInformation', func_get_args(), $pluginInfo); } }
/** * {@inheritDoc} */ public function getPaymentInformation($cartId) { $quoteIdMask = $this->quoteIdMaskFactory->create()->load($cartId, 'masked_id'); return $this->paymentInformationManagement->getPaymentInformation($quoteIdMask->getQuoteId()); }