pg_dev Posted March 2, 2023 Share Posted March 2, 2023 (edited) Hi all, I'm working on a external type payment module in prestashop 1.7. I followed prestashop payment example module in github and replicated same for external payment type. But after clicking submit button on checkout, the front tpl shows all the params set in tpl file. I need it to redirect to the API url / payment page. What should I do further to achieve this ? I tried going through paypal module code. I'm getting more confused as there are several controller overriding files & tpl files and also I'm new to this platform. some more doubts: ->Where should i write request params? will it be in front controller or front tpl file? ->Where should I write response received from payment gateway? ->Do I have to make separate controller file overriding front controller or no need for that? Below are some code img for reference. Please Help!! Thanks Edited March 29, 2023 by pg_dev (see edit history) Link to comment Share on other sites More sharing options...
innovacy Posted March 16, 2023 Share Posted March 16, 2023 (edited) Did you had a look at https://github.com/PrestaShop/paymentexample/ yet? Edited March 16, 2023 by innovacy (see edit history) Link to comment Share on other sites More sharing options...
pg_dev Posted March 23, 2023 Author Share Posted March 23, 2023 Hi, thanks for the response. Yes, I have already gone through the link which you provided. Fortunately I have moved ahead and lot of doubts got clarified. Now the redirection works fine. Ongoing issue is - even if the payment gets successful, the notifyurl is not working as expected and the response status code from gateway is not captured correctly which then doesn't takes the user to order confirmation page and order does not get placed. Can you help me with that? Link to comment Share on other sites More sharing options...
innovacy Posted March 28, 2023 Share Posted March 28, 2023 Can you provide any more information? It's hard to provide some advice with as little info only. Link to comment Share on other sites More sharing options...
pg_dev Posted March 29, 2023 Author Share Posted March 29, 2023 (edited) notify url does not seem to work even if the payment status is success, orders are not creating in the back office. I'll share snippet from validationcontroller,payment-return.tpl. Pls help! I've defined notifyurl like this: $notifyurl = $this->context->link->getModuleLink($this->name,'validation', array(), true); $this->context->smarty->assign([ 'Merchant_User_Id' => $Merchant_User_Id, 'merchantpwd' => $merchantpwd, 'Purchase_summary' => $Purchase_summary, 'currencydesc' => $currencydesc, 'merchant_ref_number' => $merchant_ref_number, 'customer_ipaddress' => $customer_ipaddress, 'amount' => $amount, etc etc......... ]); return $this->context->smarty->fetch('module:latpayredirect/views/templates/front/payment_options.tpl'); } then hookPaymentReturn function continues.... (check image for code) Edited March 29, 2023 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