tandlit Posted September 4, 2012 Share Posted September 4, 2012 Hi everyone, I have written a custom payment module to accept payment from a local bank here in Australia. I am using the bank's hosted payment solution, so the customer is redirected away from the prestashop store. The thing I'm unclear about is how to communicate to prestashop that successful payment has been made. I am assuming the bank will send the information back through a web request or possibly the query string but I don't know which php file in prestashop to direct it to. Any help would be greatly appreciated. Many thanks, Tas Link to comment Share on other sites More sharing options...
math_php Posted September 4, 2012 Share Posted September 4, 2012 Hi you, Most of the time you indicate the validation url to the bank in their web administration for the account. Let's call this url 'server to server' only known by you and by your bank. This one will be different from the one that allow the customer to go back to your site after payement. Best thing to do for module payment is to study working ones like sips Atos for example (do you have this one in australia ?) Regards Link to comment Share on other sites More sharing options...
tandlit Posted September 4, 2012 Author Share Posted September 4, 2012 Hi you, Most of the time you indicate the validation url to the bank in their web administration for the account. Let's call this url 'server to server' only known by you and by your bank. This one will be different from the one that allow the customer to go back to your site after payement. Best thing to do for module payment is to study working ones like sips Atos for example (do you have this one in australia ?) Regards Thanks for your reply. If I have understood correctly, I will tell the bank where to send the message confirming successful payment. When I receive that message, I'd like to update the order in prestashop and mark it as paid. This is where I come unstuck. I have no idea how to do that in code. Does the paypal module use IPN to do this? If so, I think that may be the answer to my question. I suppose the shop owner can always mark off the payment manually in the back office. I just thought it would be nicer to automate it. Tas Link to comment Share on other sites More sharing options...
kristianmu Posted September 4, 2012 Share Posted September 4, 2012 Ther will be two files, one for the bank response, and one for the customer response. The first one chaces the transaction id, that will be stored in your bdd as "pre_paidment", and if this id is in this bdd, and the return code is OK, you will transform this "pre_paidment" to "order", then at the same time, the customer will have a tpl if this all ok, or an other if there is a problem. If you want, you can check this module: http://www.prestashop.com/forums/topic/89234-modulo-lacaixa-yago-ferrer-version-11-gratis-y-testeada/ Is form a spanish bank, and it works as I said. Hope it helps! Link to comment Share on other sites More sharing options...
bellini13 Posted September 4, 2012 Share Posted September 4, 2012 usually you create a validation.php file that would be provided to the merchant (either through their API, or in the merchant account). The validation.php would verify the payment authorization, and then execute validateOrder function, and redirect to order confirmation page. look at the authorizeaim module that is packaged with prestashop for an idea. Link to comment Share on other sites More sharing options...
tandlit Posted September 8, 2012 Author Share Posted September 8, 2012 Thanks to all of you for such helpful responses. I got the module completed and everything is running well. It's great to know there's such a supportive community here. Regards, Tas Link to comment Share on other sites More sharing options...
kelvz Posted November 8, 2012 Share Posted November 8, 2012 help me... i want to customize my payment method, where i need to submit form which includes id_order, etc to other sites and i want it happen after i click the i confirm my order but i cant find where can i get the id_order and display it to Order Summary... Link to comment Share on other sites More sharing options...
math_php Posted November 8, 2012 Share Posted November 8, 2012 Hi Kelvz Try to get a working module like Atos and adapt it. To put your form put it in public function hookPayment($params){ } Good dev Link to comment Share on other sites More sharing options...
kelvz Posted November 14, 2012 Share Posted November 14, 2012 Thank you math_php! I have a problem again, i want to disable the email function in order confirmation... what should i do? Link to comment Share on other sites More sharing options...
bellini13 Posted November 14, 2012 Share Posted November 14, 2012 I don't believe there is a configuration setting to prevent it, so it means that you would have to override the PaymentModule class, the function called validateOrder, and comment out the MailSend code. Link to comment Share on other sites More sharing options...
kelvz Posted November 15, 2012 Share Posted November 15, 2012 (edited) Hi bellini13! Thank you for your response... Is this the code? Mail::Send((int)$order->id_lang, 'order_conf', Mail::l('Order confirmation', (int)$order->id_lang), $data, $customer->email, $customer->firstname.' '.$customer->lastname, NULL, NULL, $fileAttachment); I found it at the end of public_function_validateOrder and i comment out like this //Mail::Send((int)$order->id_lang, 'order_conf', Mail::l('Order confirmation', (int)$order->id_lang), $data, $customer->email, $customer->firstname.' '.$customer->lastname, NULL, NULL, $fileAttachment); sorry, i am a beginner... I try this but it was an error then i also comment out the: //if (Validate::isEmail($customer->email)) found at the top of Mail::Send... It shows no more error.. Is this correct? Edited November 15, 2012 by kelvz (see edit history) Link to comment Share on other sites More sharing options...
bellini13 Posted November 15, 2012 Share Posted November 15, 2012 yes that is correct, you want to comment out both lines. Link to comment Share on other sites More sharing options...
kelvz Posted November 16, 2012 Share Posted November 16, 2012 thank you... Link to comment Share on other sites More sharing options...
kelvz Posted November 20, 2012 Share Posted November 20, 2012 Hi! I want to update the order status of orders to "Payment Accepted" and generate invoice of it. The question is how to make it automatically without using admin. Because my payment module automatically transact to the bank and the bank will require to fill up credit card information then when the credit card is accepted , the bank will sent you a successful text and i want it happen in that page. sorry for my english... Link to comment Share on other sites More sharing options...
dusernamed Posted June 11, 2019 Share Posted June 11, 2019 hi everyone, i am developing a custom payment module that the client needs to fill in a contact form, and i want to make possible that the submit form and order payment confirmation are made in the same click. any suggestion? 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