/** * Prepare information specific to current payment method * * @param null|\Magento\Framework\DataObject|array $transport * @return \Magento\Framework\DataObject */ protected function _prepareSpecificInformation($transport = null) { if (null !== $this->_paymentSpecificInformation) { return $this->_paymentSpecificInformation; } $transport = parent::_prepareSpecificInformation($transport); $module_name = $this->getRequest()->getModuleName(); $action_name = $this->getRequest()->getActionName(); if ($details_arr = $this->getInfo()->getAdditionalInformation() and !empty($details_arr['sp_method']) and $method_obj = $this->_s2pMethod->create()->load($details_arr['sp_method'])) { if (!empty($details_arr['sp_transaction']) and $transaction_obj = $this->_s2pTransaction->create()->load($details_arr['sp_transaction'])) { if (!($payment_id = $transaction_obj->getPaymentId())) { $payment_id = __('N/A')->render(); } $this->_paymentSpecificInformation->setData(__('Method')->render(), $method_obj->getDisplayName()); $this->_paymentSpecificInformation->setData(__('Environment')->render(), $transaction_obj->getEnvironment()); $this->_paymentSpecificInformation->setData(__('Payment ID')->render(), $payment_id); if ($transaction_extra_arr = $transaction_obj->getExtraDataArray() and $details_titles_arr = $this->_helper->transaction_logger_params_to_title()) { foreach ($transaction_extra_arr as $title_key => $val) { if (empty($details_titles_arr[$title_key])) { continue; } $this->_paymentSpecificInformation->setData($details_titles_arr[$title_key], $val); } } } } $this->_paymentSpecificInformation->setData('Test', 'Test value'); return $this->_paymentSpecificInformation; }
/** * Add reference id to payment method information * * @param \Magento\Framework\DataObject|array|null $transport * @return \Magento\Framework\DataObject */ protected function _prepareSpecificInformation($transport = null) { if (null !== $this->_paymentSpecificInformation) { return $this->_paymentSpecificInformation; } $info = $this->getInfo(); $referenceID = $info->getAdditionalInformation(\Magento\Paypal\Model\Payment\Method\Billing\AbstractAgreement::PAYMENT_INFO_REFERENCE_ID); $transport = new \Magento\Framework\DataObject([(string) __('Reference ID') => $referenceID]); $transport = parent::_prepareSpecificInformation($transport); return $transport; }
/** * @param \Magento\Framework\DataObject|array|null $transport * @return \Magento\Framework\DataObject */ protected function _prepareSpecificInformation($transport = null) { if ($this->_paymentSpecificInformation !== null) { return $this->_paymentSpecificInformation; } $transport = parent::_prepareSpecificInformation($transport); $paymentInfo = $this->getInfo()->getAdditionalInformation(); // Magento expects the keys to be in the proper case, and it's a lot easier to just not fight it // and provide the keys in this form and use them in this form everywhere. $transport->addData(["Biller Code" => $paymentInfo["biller_code"], "Customer Ref" => $paymentInfo["customer_ref"]]); return $transport; }
/** * @param \Magento\Framework\DataObject|array|null $transport * @return \Magento\Framework\DataObject */ protected function _prepareSpecificInformation($transport = null) { if ($this->_paymentSpecificInformation !== null) { return $this->_paymentSpecificInformation; } $transport = parent::_prepareSpecificInformation($transport); $paymentInfo = $this->getInfo()->getAdditionalInformation(); // Magento expects the keys to be in the proper case, and it's a lot easier to just not fight it // and provide the keys in this form and use them in this form everywhere. $transport->addData(["Account Name" => $paymentInfo["account_name"], "Account BSB" => $paymentInfo["account_bsb"], "Account Number" => $paymentInfo["account_number"]]); return $transport; }
/** * Prepare information specific to current payment method * * @param null | array $transport * @return \Magento\Framework\DataObject */ protected function _prepareSpecificInformation($transport = null) { $transport = parent::_prepareSpecificInformation($transport); $data = []; $info = $this->getInfo(); if ($this->_appState->getAreaCode() === \Magento\Backend\App\Area\FrontNameResolver::AREA_CODE && $info->getAdditionalInformation()) { foreach ($info->getAdditionalInformation() as $field => $value) { $beautifiedFieldName = ucwords(trim(preg_replace('/(?<=\\w)(?=[A-Z])/', " \$1", $field))); $data[__($beautifiedFieldName)->getText()] = $value; } } return $transport->setData(array_merge($data, $transport->getData())); }
protected function _prepareSpecificInformation($transport = null) { /** * @var $client \Orba\Payupl\Model\Client */ $transport = parent::_prepareSpecificInformation($transport); $orderId = $this->getInfo()->getParentId(); $status = $this->transactionResource->getLastStatusByOrderId($orderId); $client = $this->clientFactory->create(); $statusDescription = $client->getOrderHelper()->getStatusDescription($status); $transport->setData((string) __('Status'), $statusDescription); return $transport; }
/** * Prepare information specific to current payment method * * @param null | array $transport * @return \Magento\Framework\DataObject */ protected function _prepareSpecificInformation($transport = null) { $transport = parent::_prepareSpecificInformation($transport); $data = []; $info = $this->getInfo(); $fields = [["field" => "cardholderName", "title" => "Card Holder Name"], ["field" => "trunc_card", "title" => "Card Number"], ["field" => "payment_method", "title" => "Payment Method"], ["field" => "expiration_date", "title" => "Expiration Date"], ["field" => "installments", "title" => "Installments"], ["field" => "statement_descriptor", "title" => "Statement Descriptor"], ["field" => "payment_id", "title" => "Payment id (MercadoPago)"], ["field" => "status", "title" => "Payment Status"], ["field" => "status_detail", "title" => "Payment Detail"], ["field" => "activation_uri", "title" => "Generate Ticket"], ["field" => "payment_id_detail", "title" => "Mercado Pago Payment Id"]]; foreach ($fields as $field) { if ($info->getAdditionalInformation($field['field']) != "") { $text = __($field['title'], $info->getAdditionalInformation($field['field'])); $data[$text->getText()] = $info->getAdditionalInformation($field['field']); } } return $transport->setData(array_merge($data, $transport->getData())); }
/** * Prepare PayPal-specific payment information * * @param \Magento\Framework\DataObject|array|null $transport * @return \Magento\Framework\DataObject */ protected function _prepareSpecificInformation($transport = null) { $transport = parent::_prepareSpecificInformation($transport); $payment = $this->getInfo(); $fieldsToStore = explode(',', (string) $this->config->getValue('paymentInfoKeys')); if ($this->getIsSecureMode()) { $fieldsToStore = array_diff($fieldsToStore, explode(',', (string) $this->config->getValue('privateInfoKeys'))); } foreach ($fieldsToStore as $field) { if ($payment->getAdditionalInformation($field) !== null) { $this->setDataToTransfer($transport, $field, $payment->getAdditionalInformation($field)); } } return $transport; }
/** * AbstractInfo constructor. * * @param \Adyen\Payment\Helper\Data $adyenHelper * @param \Adyen\Payment\Model\Resource\Order\Payment\CollectionFactory $adyenOrderPaymentCollectionFactory * @param Template\Context $context * @param array $data */ public function __construct(\Adyen\Payment\Helper\Data $adyenHelper, \Adyen\Payment\Model\Resource\Order\Payment\CollectionFactory $adyenOrderPaymentCollectionFactory, Template\Context $context, array $data = []) { parent::__construct($context, $data); $this->_adyenHelper = $adyenHelper; $this->_adyenOrderPaymentCollectionFactory = $adyenOrderPaymentCollectionFactory; }
/** * Constructor * * @param Template\Context $context * @param array $data */ public function __construct(\Adyen\Payment\Helper\Data $adyenHelper, Template\Context $context, array $data = []) { parent::__construct($context, $data); $this->_adyenHelper = $adyenHelper; }
/** * @param \Magento\Framework\View\Element\Template\Context $context * @param \Magento\Payment\Model\Config $paymentConfig * @param \Payfast\Payfast\Model\InfoFactory $payfastInfoFactory * @param array $data */ public function __construct(\Magento\Framework\View\Element\Template\Context $context, \Magento\Payment\Model\Config $paymentConfig, \Payfast\Payfast\Model\InfoFactory $payfastInfoFactory, array $data = []) { $this->_payfastInfoFactory = $payfastInfoFactory; parent::__construct($context, $data); }
/** * Prepare credit card related payment info * * @param \Magento\Framework\Object|array $transport * @return \Magento\Framework\Object */ protected function _prepareSpecificInformation($transport = null) { if (null !== $this->_paymentSpecificInformation) { return $this->_paymentSpecificInformation; } $transport = parent::_prepareSpecificInformation($transport); $data = []; if ($ccType = $this->getCcTypeName()) { $data[(string) __('Credit Card Type')] = $ccType; } if ($this->getInfo()->getCcLast4()) { $data[(string) __('Credit Card Number')] = sprintf('xxxx-%s', $this->getInfo()->getCcLast4()); } if (!$this->getIsSecureMode()) { if ($ccSsIssue = $this->getInfo()->getCcSsIssue()) { $data[(string) __('Switch/Solo/Maestro Issue Number')] = $ccSsIssue; } $year = $this->getInfo()->getCcSsStartYear(); $month = $this->getInfo()->getCcSsStartMonth(); if ($year && $month) { $data[(string) __('Switch/Solo/Maestro Start Date')] = $this->_formatCardDate($year, $month); } } return $transport->setData(array_merge($data, $transport->getData())); }
protected function _construct() { parent::_construct(); $this->setTemplate('Ess_M2ePro::magento/order/payment/info.phtml'); }