_theLion Posted September 20, 2017 Share Posted September 20, 2017 (edited) I am new to Prestashop and I am trying to build a payment gateway module.It all works fine until I try and get the parameters for the return URL. For some reason the post parameters always comeback as blank or none as existent. I have tried checking on the browser debugger to see if it was actually sending something and all the required data is there. Here is the code: Here is the output: This is the return URL:..."index.php?fc=module&module=cashu&controller=fail" PS: I am running on a Local Host. Edited September 20, 2017 by _theLion (see edit history) Link to comment Share on other sites More sharing options...
catalin.pop Posted September 20, 2017 Share Posted September 20, 2017 Try using php filter_input and see if it's working instead of Tools::getValue $errorCode = filter_input(INPUT_POST, 'errorCode'); based on Tools:getValue method from their source code: public static function getValue($key, $default_value = false) { if (!isset($key) || empty($key) || !is_string($key)) { return false; } if (getenv('kernel.environment') === 'test' && self::$request instanceof Request) { $value = self::$request->request->get($key, self::$request->query->get($key, $default_value)); } else { $value = (isset($_POST[$key]) ? $_POST[$key] : (isset($_GET[$key]) ? $_GET[$key] : $default_value)); } if (is_string($value)) { return stripslashes(urldecode(preg_replace('/((\%5C0+)|(\%00+))/i', '', urlencode($value)))); } return $value; } try to debug your module and see where what is not reading the parameter.. maybe has something to do with $_POST[$key] Link to comment Share on other sites More sharing options...
_theLion Posted October 10, 2017 Author Share Posted October 10, 2017 I've figured out that it was just the way that I had set up the server. Everything was being redirected so I just stopped it from doing that. I'm getting all the parameters now. Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now