diff --git a/Controller/tpaycards/CardPayment.php b/Controller/tpaycards/CardPayment.php index 4a47d17..1112935 100644 --- a/Controller/tpaycards/CardPayment.php +++ b/Controller/tpaycards/CardPayment.php @@ -223,7 +223,8 @@ private function processNewCardPayment($orderId, $additionalPaymentInformation) ->setCustomerToken($this->tpay->getCustomerId($orderId), $result['cli_auth'], $result['card'], $additionalPaymentInformation['card_vendor']); } - return (int)$result[ResponseFields::RESULT] === 1 && $result[ResponseFields::STATUS] === 'correct' ? + return (int)$result[ResponseFields::RESULT] === 1 && isset($result[ResponseFields::STATUS]) + && $result[ResponseFields::STATUS] === 'correct' ? $this->_redirect(static::SUCCESS_PATH) : $this->trySaleAgain($localData, $orderId, $saveCard); } diff --git a/Controller/tpaycards/CardRefunds.php b/Controller/tpaycards/CardRefunds.php index 822f1da..dea24a7 100644 --- a/Controller/tpaycards/CardRefunds.php +++ b/Controller/tpaycards/CardRefunds.php @@ -2,7 +2,7 @@ namespace tpaycom\magento2cards\Controller\tpaycards; -use Magento\Payment\Model\InfoInterface; +use Magento\Sales\Model\Order\Payment; use tpaycom\magento2cards\lib\CardAPI; use Magento\Framework\Validator\Exception; @@ -35,7 +35,7 @@ public function __construct( } /** - * @param InfoInterface $payment + * @param Payment $payment * @param double $amount * @return bool * @throws Exception @@ -45,7 +45,8 @@ public function makeRefund($payment, $amount) $tpayApi = new CardAPI($this->apiKey, $this->apiPass, $this->verificationCode, $this->hashType); $transactionId = $payment->getParentTransactionId(); - $result = $tpayApi->refund($transactionId, 'Zamówienie ' . $payment->getParentId(), $amount); + $result = $tpayApi->refund($transactionId, 'Zwrot do zamówienia ' . $payment->getOrder()->getRealOrderId(), + $amount); if ((int)$result['result'] === 1 && isset($result['status']) && $result['status'] === 'correct') { return $result['sale_auth']; diff --git a/composer.json b/composer.json index 7032e7e..bf6b36b 100644 --- a/composer.json +++ b/composer.json @@ -2,7 +2,7 @@ "name": "tpaycom/magento2cards", "description": "tpay.com card payments module", "type": "magento2-module", - "version": "1.2.9", + "version": "1.3.0", "license": [ "OSL-3.0" ],