S.A Posted April 13 Posted April 13 Dear Developer I'm working on a custom payment plugin in Prestashop 1.7. I created a callback URL But the page returned 404 **"The page you are looking for was not found. "**. This is a controller path: /controllers/front/Validation.php $callback_url = $this->context->link->getModuleLink($this->name, 'Validation', [], true); $this->context->smarty->assign([ 'callback_url' => $callback_url)]; What's wrong! Thank you for your support Share this post Link to post Share on other sites More sharing options...
knacky Posted April 14 Posted April 14 https://andresa.dev/en/prestashop-1-7-how-to-create-a-new-payment-module-part-1/ 1 Share this post Link to post Share on other sites More sharing options...
S.A Posted April 14 Posted April 14 @knacky Thank you for replay. I did all steps mention on links. But still didn't work. Share this post Link to post Share on other sites More sharing options...
knacky Posted April 14 Posted April 14 Please do not contact me via private messages to check your codes. Here is a link to the sample module: https://github.com/andresams/prestapay Share this post Link to post Share on other sites More sharing options...
S.A Posted April 14 Posted April 14 @knacky Yes I check this link and I was do all things. But still didn't work. Share this post Link to post Share on other sites More sharing options...
knacky Posted April 14 Posted April 14 (edited) And do you have a link to Validation added in Seo & Url? https://doc.prestashop.com/m/mobile.action#page/51185023 Edited April 14 by knacky (see edit history) Share this post Link to post Share on other sites More sharing options...
S.A Posted April 14 Posted April 14 @knacky No need to add link in Seo & Url I use this in validation file controllers. private function redirectToOrder($cart, $customer, $message = null) { $url = 'index.php?controller=order-confirmation' . '&id_cart=' . $cart->id . '&id_module=' . $this->module->id . '&id_order=' . $this->module->currentOrder . '&key=' . $customer->secure_key; if ($message) { $url .= '&message=' . $message; } Tools::redirect($url); } Share this post Link to post Share on other sites More sharing options...
tdsoft Posted April 15 Posted April 15 11 hours ago, S.A said: @knacky No need to add link in Seo & Url I use this in validation file controllers. private function redirectToOrder($cart, $customer, $message = null) { $url = 'index.php?controller=order-confirmation' . '&id_cart=' . $cart->id . '&id_module=' . $this->module->id . '&id_order=' . $this->module->currentOrder . '&key=' . $customer->secure_key; if ($message) { $url .= '&message=' . $message; } Tools::redirect($url); } What is your URL to show error 404? Share this post Link to post Share on other sites More sharing options...
S.A Posted April 15 Posted April 15 6 hours ago, tdsoft said: What is your URL to show error 404? https://domain-name/index.php?fc=module&%3Bmodule=module-name&%3Bcontroller=validation&id=payment-id&status=paid&amount=1912&message=Succeeded%21 Share this post Link to post Share on other sites More sharing options...
knacky Posted April 15 Posted April 15 Do you want help or not? You must provide a valid link to the site and turn on debug mode. You do not want to give a valid link to the site, go to the JOB section and enter a request and someone will repair the module for a fee. Share this post Link to post Share on other sites More sharing options...
S.A Posted April 15 Posted April 15 8 minutes ago, knacky said: Do you want help or not? You must provide a valid link to the site and turn on debug mode. You do not want to give a valid link to the site, go to the JOB section and enter a request and someone will repair the module for a fee. After enable debug mode: Fatal error: Uncaught PrestaShopException: is not a valid module name. in /ps-1.7.8/prestashop/classes/Tools.php:1182 Stack trace: #0 /ps-1.7.8/prestashop/classes/module/Module.php(1159): ToolsCore::displayError(' is not a valid...') #1 /ps-1.7.8/prestashop/classes/Dispatcher.php(390): ModuleCore::getInstanceByName('') #2 /ps-1.7.8/prestashop/index.php(28): DispatcherCore->dispatch() #3 {main} thrown in /ps-1.7.8/prestashop/classes/Tools.php on line 1182 Share this post Link to post Share on other sites More sharing options...
knacky Posted April 15 Posted April 15 It is clearly written in the statement that the module name is not found. ModuleCore :: getInstanceByName ('') Share this post Link to post Share on other sites More sharing options...
S.A Posted April 15 Posted April 15 (edited) 6 hours ago, knacky said: It is clearly written in the statement that the module name is not found. ModuleCore :: getInstanceByName ('') Well. what must be write to solve it? I use "$this->module->" in my code Edited April 15 by S.A (see edit history) Share this post Link to post Share on other sites More sharing options...
knacky Posted April 16 Posted April 16 https://devdocs.prestashop.com/1.7/modules/concepts/controllers/front-controllers/ Share this post Link to post Share on other sites More sharing options...
S.A Posted April 16 Posted April 16 11 hours ago, knacky said: https://devdocs.prestashop.com/1.7/modules/concepts/controllers/front-controllers/ Yes. I following steps in this link. But still can't find where is a problem. Share this post Link to post Share on other sites More sharing options...
knacky Posted April 16 Posted April 16 There is no more advice. Everything has already been said. You claim that you have everything right and I claim that you don't and no one will just examine your module and correct the error, according to the examples you give here. Your FrontController just doesn't know your module. Share this post Link to post 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