cronJobsHandler = $this->module->getService('inpost.shipping.handler.cron_jobs'); } public function postProcess() { if ($this->cronJobsHandler->checkToken(Tools::getValue('token'))) { try { $this->cronJobsHandler->handle(Tools::getValue('action')); die($this->module->l('Job complete', self::TRANSLATION_SOURCE)); } catch (InvalidActionException $exception) { die($this->module->l('Unknown action', self::TRANSLATION_SOURCE)); } catch (ShipXException $exception) { die(sprintf( $this->module->l('Job failed: %s', self::TRANSLATION_SOURCE), $exception->getMessage() )); } } else { die($this->module->l('Invalid token', self::TRANSLATION_SOURCE)); } } }