* @copyright 2007-2019 PrestaShop SA * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) * International Registered Trademark & Property of PrestaShop SA */ use Symfony\Component\HttpFoundation\JsonResponse; /** * Class PaypalAbstarctModuleFrontController */ abstract class PaypalAbstarctModuleFrontController extends ModuleFrontController { public $name = 'paypal'; public $jsonValues; public $values; public $redirectUrl; public $errors; /** * @see ModuleFrontController::run */ public function run() { $this->init(); if ($this->checkAccess()) { // postProcess handles ajaxProcess $this->postProcess(); } if (!empty($this->redirectUrl)) { Tools::redirect($this->redirectUrl); } if (!empty($this->jsonValues)) { $response = new JsonResponse($this->jsonValues); return $response->send(); } } }