/** * Creates Payment Data Object * * @param InfoInterface $paymentInfo * @return PaymentDataObjectInterface */ public function create(InfoInterface $paymentInfo) { if ($paymentInfo instanceof Payment) { $data['order'] = $this->orderAdapterFactory->create(['order' => $paymentInfo->getOrder()]); } elseif ($paymentInfo instanceof \Magento\Quote\Model\Quote\Payment) { $data['order'] = $this->quoteAdapterFactory->create(['quote' => $paymentInfo->getQuote()]); } $data['payment'] = $paymentInfo; return $this->objectManager->create('Magento\\Payment\\Gateway\\Data\\PaymentDataObject', $data); }