How To: What Replaces Mage::throwException($errorMsg); in Magento 2?
if ($errorMsg) { Mage::throwException($errorMsg); }
and Mage::getUrl
public function getOrderPlaceRedirectUrl() { return Mage::getUrl('skypay/payment/redirect', array('_secure' => false)); }
Solved! Go to Solution.
Try to use like this :
catch (\Exception $e) { throw new \Magento\Framework\Exception\LocalizedException(__('%1', $e->getMessage())); }
or
if ($errorMsg) { throw new \Exception($errorMsg); }
For second code solution :
$this->_url->getUrl('skypay/payment/redirect', ['_secure' => false]);
It may be helpful for you.
If issue solved , Click Kudos & Accept as Solution
@bbbmishucs
please check my updated answer and accept solution if it is useful for you.
Try to use like this :
catch (\Exception $e) { throw new \Magento\Framework\Exception\LocalizedException(__('%1', $e->getMessage())); }
or
if ($errorMsg) { throw new \Exception($errorMsg); }
For second code solution :
$this->_url->getUrl('skypay/payment/redirect', ['_secure' => false]);
It may be helpful for you.
If issue solved , Click Kudos & Accept as Solution
Thanks @rohanhapani .
Now tell me how can I change last part
@bbbmishucs
please check my updated answer and accept solution if it is useful for you.