Magento 2: Controller issue

I have code in the controller eg: if($token==”) { echo ‘token not found’; exit; } else { echo $lead; exit; } But need to return this public function execute() { if(isset($getCookie)){ $lead = $this->api->getleadDataForm(‘COOKIE’, $getCookie,$allfield); $token=$this->api->getToken(); } if($token==”) { $response = ‘token not found’; } else { $response = $lead; } return $response; } But…

Magento 1.9 Observer – How to disable Payment method in Observer?

I want to assign specific payment method only for selected one customer group, successfully get customer group & Payment method code, How to add condition, following are my workout, Following Tutorial : https://meetanshi.com/blog/disable-payment-method-programmatically-in-magento/ workout : <?php class Gta_FindPaymentGateway_Model_Observer { public function paymenter($Observer) { if(Mage::getSingleton(‘customer/session’)->isLoggedIn()) { // Get group Id $groupId = Mage::getSingleton(‘customer/session’)->getCustomerGroupId(); //Get customer Group…

Setting permissions for developer mode / production mode

I have installed magento (using tar file from magento) and changed to developer mode. Read the docs in https://devdocs.magento.com/guides/v2.2/config-guide/prod/prod_file-sys-perms.html In default or developer mode, the following directories must be writable by the user: vendor app/etc pub/static var Any other static resources generated/code generated/metadata var/view_preprocessed In file manager, I can see those folders are marked as…