Skip to main content
replaced http://stackoverflow.com/ with https://stackoverflow.com/
Source Link

I am developing a module for a payment gateway.

  1. I created module skeleton using module creator provided here.
  2. I used redirection solution given in thisthis.
  3. I wrote custom controller where it is getting redirect.

Now in my custom controller I need to create data to post on the payment gateway and then will post that data to the payment gateway url. Here I need order data which I and not getting in checkout session. I referred other extension they are using similar method but I am not getting any data.

protected function _getOrder() { if (!$this->_order) { $incrementId = $this->_getCheckout()->getLastRealOrderId(); var_dump($incrementId); $this->_orderFactory = $this->_objectManager->get('Magento\Sales\Model\OrderFactory'); $this->_order = $this->_orderFactory->create()->loadByIncrementId($incrementId); } return $this->_order; } protected function _getCheckout() { return $this->_objectManager->get('Magento\Checkout\Model\Session'); } 

I am developing a module for a payment gateway.

  1. I created module skeleton using module creator provided here.
  2. I used redirection solution given in this.
  3. I wrote custom controller where it is getting redirect.

Now in my custom controller I need to create data to post on the payment gateway and then will post that data to the payment gateway url. Here I need order data which I and not getting in checkout session. I referred other extension they are using similar method but I am not getting any data.

protected function _getOrder() { if (!$this->_order) { $incrementId = $this->_getCheckout()->getLastRealOrderId(); var_dump($incrementId); $this->_orderFactory = $this->_objectManager->get('Magento\Sales\Model\OrderFactory'); $this->_order = $this->_orderFactory->create()->loadByIncrementId($incrementId); } return $this->_order; } protected function _getCheckout() { return $this->_objectManager->get('Magento\Checkout\Model\Session'); } 

I am developing a module for a payment gateway.

  1. I created module skeleton using module creator provided here.
  2. I used redirection solution given in this.
  3. I wrote custom controller where it is getting redirect.

Now in my custom controller I need to create data to post on the payment gateway and then will post that data to the payment gateway url. Here I need order data which I and not getting in checkout session. I referred other extension they are using similar method but I am not getting any data.

protected function _getOrder() { if (!$this->_order) { $incrementId = $this->_getCheckout()->getLastRealOrderId(); var_dump($incrementId); $this->_orderFactory = $this->_objectManager->get('Magento\Sales\Model\OrderFactory'); $this->_order = $this->_orderFactory->create()->loadByIncrementId($incrementId); } return $this->_order; } protected function _getCheckout() { return $this->_objectManager->get('Magento\Checkout\Model\Session'); } 
deleted 38 characters in body
Source Link

0 down vote favorite

I am developing a module for a payment gateway.

  1. I created module skeleton using module creator provided here.
  2. I used redirection solution given in this.
  3. I wrote custom controller where it is getting redirect.

Now in my custom controller I need to create data to post on the payment gateway and then will post that data to the payment gateway url. Here I need order data which I and not getting in checkout session. I referred other extension they are using similar method but I am not getting any data.

protected function _getOrder() { if (!$this->_order) { $incrementId = $this->_getCheckout()->getLastRealOrderId(); var_dump($incrementId); $this->_orderFactory = $this->_objectManager->get('Magento\Sales\Model\OrderFactory'); $this->_order = $this->_orderFactory->create()->loadByIncrementId($incrementId); } return $this->_order; } protected function _getCheckout() { return $this->_objectManager->get('Magento\Checkout\Model\Session'); } 

0 down vote favorite

I am developing a module for a payment gateway.

  1. I created module skeleton using module creator provided here.
  2. I used redirection solution given in this.
  3. I wrote custom controller where it is getting redirect.

Now in my custom controller I need to create data to post on the payment gateway and then will post that data to the payment gateway url. Here I need order data which I and not getting in checkout session. I referred other extension they are using similar method but I am not getting any data.

protected function _getOrder() { if (!$this->_order) { $incrementId = $this->_getCheckout()->getLastRealOrderId(); var_dump($incrementId); $this->_orderFactory = $this->_objectManager->get('Magento\Sales\Model\OrderFactory'); $this->_order = $this->_orderFactory->create()->loadByIncrementId($incrementId); } return $this->_order; } protected function _getCheckout() { return $this->_objectManager->get('Magento\Checkout\Model\Session'); } 

I am developing a module for a payment gateway.

  1. I created module skeleton using module creator provided here.
  2. I used redirection solution given in this.
  3. I wrote custom controller where it is getting redirect.

Now in my custom controller I need to create data to post on the payment gateway and then will post that data to the payment gateway url. Here I need order data which I and not getting in checkout session. I referred other extension they are using similar method but I am not getting any data.

protected function _getOrder() { if (!$this->_order) { $incrementId = $this->_getCheckout()->getLastRealOrderId(); var_dump($incrementId); $this->_orderFactory = $this->_objectManager->get('Magento\Sales\Model\OrderFactory'); $this->_order = $this->_orderFactory->create()->loadByIncrementId($incrementId); } return $this->_order; } protected function _getCheckout() { return $this->_objectManager->get('Magento\Checkout\Model\Session'); } 
Source Link

Magento 2 - Can't get order data in custom controller for payment gateway integration

0 down vote favorite

I am developing a module for a payment gateway.

  1. I created module skeleton using module creator provided here.
  2. I used redirection solution given in this.
  3. I wrote custom controller where it is getting redirect.

Now in my custom controller I need to create data to post on the payment gateway and then will post that data to the payment gateway url. Here I need order data which I and not getting in checkout session. I referred other extension they are using similar method but I am not getting any data.

protected function _getOrder() { if (!$this->_order) { $incrementId = $this->_getCheckout()->getLastRealOrderId(); var_dump($incrementId); $this->_orderFactory = $this->_objectManager->get('Magento\Sales\Model\OrderFactory'); $this->_order = $this->_orderFactory->create()->loadByIncrementId($incrementId); } return $this->_order; } protected function _getCheckout() { return $this->_objectManager->get('Magento\Checkout\Model\Session'); }