pageFactory = $pageFactory; $this->logHelper = $logHelper; $this->quoteInApi = $quoteInApi; parent::__construct($context); } private function getCustomer(){ $om = \Magento\Framework\App\ObjectManager::getInstance(); $customerSession = $om->get('Magento\Customer\Model\Session'); $customer = $customerSession->getCustomer(); return $customer; } public function execute() { $customer = $this->getCustomer(); if (!$customer) { echo "{}"; exit; } //$this->logHelper->setName(self::LOG_FILE); //$this->quoteInApi->setLogHelper($this->logHelper); $response = $this->quoteInApi->login(); if ($response) { $rep = $this->quoteInApi->getData($customer->getEmail()); echo $rep->getBody()->getContents(); exit; } echo "null"; exit; } }