diff --git a/Model/TpayCards.php b/Model/TpayCards.php index f9d97ff..c3e5d40 100644 --- a/Model/TpayCards.php +++ b/Model/TpayCards.php @@ -164,7 +164,10 @@ public function getTpayFormData($orderId = null) $billingAddress = $order->getBillingAddress(); $amount = number_format($order->getGrandTotal(), 2, '.', ''); $name = $billingAddress->getData('firstname') . ' ' . $billingAddress->getData('lastname'); - + $companyName = $billingAddress->getData('company'); + if (strlen($name) <= 3 && !empty($companyName) && strlen($companyName) > 3) { + $name = $companyName; + } $om = ObjectManager::getInstance(); $resolver = $om->get('Magento\Framework\Locale\Resolver'); $language = Validate::validateCardLanguage($resolver->getLocale()); @@ -185,7 +188,8 @@ public function getTpayFormData($orderId = null) } /** - * + * @param int $orderId + * @return \Magento\Sales\Api\Data\OrderInterface */ protected function getOrder($orderId = null) { @@ -314,7 +318,6 @@ public function refund(InfoInterface $payment, $amount) throw new Exception(__('Payment refunding error.')); } - return $this; }