示例#1
0
文件: Quote.php 项目: aiesh/magento2
 /**
  * Convert quote payment to order payment
  *
  * @param   \Magento\Sales\Model\Quote\Payment $payment
  * @return  \Magento\Sales\Model\Quote\Payment
  */
 public function paymentToOrderPayment(\Magento\Sales\Model\Quote\Payment $payment)
 {
     /** @var \Magento\Sales\Model\Order\Payment $orderPayment */
     $orderPayment = $this->_orderPaymentFactory->create()->setStoreId($payment->getStoreId());
     $orderPayment->setCustomerPaymentId($payment->getCustomerPaymentId());
     $this->_objectCopyService->copyFieldsetToTarget('sales_convert_quote_payment', 'to_order_payment', $payment, $orderPayment);
     $orderPayment->setAdditionalInformation(\Magento\Payment\Model\Method\Substitution::INFO_KEY_TITLE, $payment->getMethodInstance()->getTitle());
     return $orderPayment;
 }