diff --git a/Controller/Response/IyzicoCheckoutForm.php b/Controller/Response/IyzicoCheckoutForm.php index 7963359..ac729e3 100755 --- a/Controller/Response/IyzicoCheckoutForm.php +++ b/Controller/Response/IyzicoCheckoutForm.php @@ -1,23 +1,4 @@ . - */ namespace Iyzico\Iyzipay\Controller\Response; @@ -27,10 +8,13 @@ use Iyzico\Iyzipay\Controller\IyzicoBase\IyzicoRequest; use Magento\Checkout\Model\Type\Onepage; use Magento\Framework\Controller\ResultFactory; +use Magento\Framework\App\CsrfAwareActionInterface; +use Magento\Framework\App\RequestInterface; +use Magento\Framework\App\Request\InvalidRequestException; -class IyzicoCheckoutForm extends \Magento\Framework\App\Action\Action +class IyzicoCheckoutForm extends \Magento\Framework\App\Action\Action implements CsrfAwareActionInterface { - + protected $_context; protected $_pageFactory; protected $_jsonEncoder; @@ -50,6 +34,16 @@ class IyzicoCheckoutForm extends \Magento\Framework\App\Action\Action protected $_storeManager; protected $_helper; + public function createCsrfValidationException(RequestInterface $request): ?InvalidRequestException + { + return null; + } + + public function validateForCsrf(RequestInterface $request): ?bool + { + return true; + } + public function __construct( \Magento\Framework\App\Action\Context $context, \Magento\Framework\Json\EncoderInterface $encoder, @@ -91,7 +85,7 @@ public function __construct( } public function execute() - { + { $postData = $this->getRequest()->getPostValue(); $resultRedirect = $this->_resultRedirect->create(ResultFactory::TYPE_REDIRECT); diff --git a/LICENSE b/LICENSE old mode 100644 new mode 100755 diff --git a/Observer/DataAssignObserver.php b/Observer/DataAssignObserver.php index fd1aa2b..9a18a20 100755 --- a/Observer/DataAssignObserver.php +++ b/Observer/DataAssignObserver.php @@ -106,8 +106,6 @@ public function execute(Observer $observer) $order->setSubTotalInclTax($iyzicoSubTotal); $order->setGrandTotal($iyzicoGrandTotal); $order->setBaseGrandTotal($iyzicoGrandTotal); - $order->setState('processing'); - $order->setStatus('processing'); $payment = $order->getPayment(); $payment->setAmountOrdered($iyzicoGrandTotal); @@ -122,6 +120,9 @@ public function execute(Observer $observer) } + $order->setState('processing'); + $order->setStatus('processing'); + $historyComment = __('Payment Success').$paymentId; $order->addStatusHistoryComment($historyComment); } diff --git a/README.md b/README.md old mode 100644 new mode 100755