S.A Posted April 13, 2022 Share Posted April 13, 2022 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 Link to comment Share on other sites More sharing options...
knacky Posted April 14, 2022 Share Posted April 14, 2022 https://andresa.dev/en/prestashop-1-7-how-to-create-a-new-payment-module-part-1/ 1 Link to comment Share on other sites More sharing options...
S.A Posted April 14, 2022 Author Share Posted April 14, 2022 @knacky Thank you for replay. I did all steps mention on links. But still didn't work. Link to comment Share on other sites More sharing options...
knacky Posted April 14, 2022 Share Posted April 14, 2022 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 Link to comment Share on other sites More sharing options...
S.A Posted April 14, 2022 Author Share Posted April 14, 2022 @knacky Yes I check this link and I was do all things. But still didn't work. Link to comment Share on other sites More sharing options...
knacky Posted April 14, 2022 Share Posted April 14, 2022 (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, 2022 by knacky (see edit history) Link to comment Share on other sites More sharing options...
S.A Posted April 14, 2022 Author Share Posted April 14, 2022 @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); } Link to comment Share on other sites More sharing options...
tdsoft Posted April 15, 2022 Share Posted April 15, 2022 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? Link to comment Share on other sites More sharing options...
S.A Posted April 15, 2022 Author Share Posted April 15, 2022 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 Link to comment Share on other sites More sharing options...
knacky Posted April 15, 2022 Share Posted April 15, 2022 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. Link to comment Share on other sites More sharing options...
S.A Posted April 15, 2022 Author Share Posted April 15, 2022 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 Link to comment Share on other sites More sharing options...
knacky Posted April 15, 2022 Share Posted April 15, 2022 It is clearly written in the statement that the module name is not found. ModuleCore :: getInstanceByName ('') Link to comment Share on other sites More sharing options...
S.A Posted April 15, 2022 Author Share Posted April 15, 2022 (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, 2022 by S.A (see edit history) Link to comment Share on other sites More sharing options...
knacky Posted April 16, 2022 Share Posted April 16, 2022 https://devdocs.prestashop.com/1.7/modules/concepts/controllers/front-controllers/ Link to comment Share on other sites More sharing options...
S.A Posted April 16, 2022 Author Share Posted April 16, 2022 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. Link to comment Share on other sites More sharing options...
knacky Posted April 16, 2022 Share Posted April 16, 2022 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. Link to comment Share on other sites More sharing options...
ps8modules Posted November 21, 2022 Share Posted November 21, 2022 (edited) 35 minutes ago, pg_dev said: @knackyI wonder how fellow people around you, tolerate you!😪 Instead of helping @S.A/ providing guidance you are just confusing him by sending links. What would have cost you if you could just explain him in detail. Your answer would have also helped others too. But no Why would you do that for free?? Am i right?!! and look at your replies. So mean, so rude!!! 👎who says like that? why are you still in prestashop community if you have no intentions to help others. Someone pls exclude him from this community. It will be a big relief. You are an absolute disappointment in yourself. I came here in this page to look for some solution to my question and my mind just got heated by going through your response. Anyways, God Bless you! @pg_dev Hi. It is polite to say hello first and then write. I have to support @knacky, it helps a lot. It is only up to those who ask and need help if they are shareable. If they are asked for a code, or a link to a page or a complete extract from debug mode, they should do it, they have the option to share links and codes via a private message. You always have the option under the posts to report the post to the moderators and write to them what is so objectionable that they remove the post or block the user's account. If you read your post, it is not helpful and I would consider it as spam. Realize that older programmers study a lot and then someone comes to the forum and wants to get the answer at any cost. Good luck to you too. Everyone who reads your response will want to help you. Edited November 21, 2022 by 4you.software (see edit history) Link to comment Share on other sites More sharing options...
pg_dev Posted November 21, 2022 Share Posted November 21, 2022 (edited) @4you.software Hi. I understand and apologize. You are right. I should have pinged him privately. Actually I'm new to this platform. Prior to this comment, I was unaware of how things worked. Edited November 21, 2022 by pg_dev (see edit history) 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