lem__mel Posted April 6, 2018 Share Posted April 6, 2018 Hi ! I'm currently coding an application that allows to create order by using the webservice API. For statistical purposes I need to have the correct payment method registered, but if I assume that payment and module elements allows to specify the payment, I don't know how to list all the payment methods available. Have someone an idea about how to get the payments available ? P.S. : the use of the API call /api/orders/?display=full&schema=blank list all of fields of an order (here I see that there is payment and module elements), and when I go see the details about webservice permission management, I see nothing of interest (order_payments allows to know what payment was used for a given order). Link to comment Share on other sites More sharing options...
rvkvino Posted April 6, 2020 Share Posted April 6, 2020 Hello, I'm also finding the solution to list out all the available payment methods in mobile application is there any API or solution find out means please update this. Link to comment Share on other sites More sharing options...
maicol.cantagallo Posted July 17, 2020 Share Posted July 17, 2020 Hi lem__mel, i have the same problem Link to comment Share on other sites More sharing options...
EvaF Posted July 17, 2020 Share Posted July 17, 2020 you can get list of modules, that handles payment methods f.e. this way: SELECT m.*, group_concat(iso_code) as currencies FROM `ps_hook_module` h join ps_module m on m.id_module=h.id_module join ps_module_currency mc on mc.id_module=m.id_module join ps_currency c on c.id_currency=mc.id_currency WHERE `id_hook` in (select id_hook from ps_hook where name = 'paymentOptions') and m.active=1 group by m.id_module or you can get the list (include paymentMethod name) : $payment_methods = array(); foreach (PaymentModule::getInstalledPaymentModules() as $payment) { $module = Module::getInstanceByName($payment['name']); if (Validate::isLoadedObject($module) && $module->active) { $payment_methods[] = $module->displayName; } } or you can combine both codes above to get list of { NameOfModule + its PaymentMethods + its allowed currencies } Link to comment Share on other sites More sharing options...
maicol.cantagallo Posted July 17, 2020 Share Posted July 17, 2020 Thanks EvaF. But if i want to use payments method list in webservice call? There is reference to retrieve payments method and manage all checkout steps from webservice? Link to comment Share on other sites More sharing options...
rvkvino Posted July 17, 2020 Share Posted July 17, 2020 I'm also looking for payment and checkout web-service call. If anyone implemented successfully through web service call please update the code it will be helpful. Link to comment Share on other sites More sharing options...
EvaF Posted July 17, 2020 Share Posted July 17, 2020 oh sorry, my missunderstanding Link to comment Share on other sites More sharing options...
maicol.cantagallo Posted July 17, 2020 Share Posted July 17, 2020 I need to retrieve all payments method show in checkout. your reply return all payments method also those not show in checkout. also I should have the payment list from a webservice call...it is possible? thanks Link to comment Share on other sites More sharing options...
maicol.cantagallo Posted July 17, 2020 Share Posted July 17, 2020 4 hours ago, EvaF said: oh sorry, my missunderstanding understand now? thanks Link to comment Share on other sites More sharing options...
maicol.cantagallo Posted August 3, 2020 Share Posted August 3, 2020 On 7/17/2020 at 10:50 AM, EvaF said: you can get list of modules, that handles payment methods f.e. this way: SELECT m.*, group_concat(iso_code) as currencies FROM `ps_hook_module` h join ps_module m on m.id_module=h.id_module join ps_module_currency mc on mc.id_module=m.id_module join ps_currency c on c.id_currency=mc.id_currency WHERE `id_hook` in (select id_hook from ps_hook where name = 'paymentOptions') and m.active=1 group by m.id_module or you can get the list (include paymentMethod name) : $payment_methods = array(); foreach (PaymentModule::getInstalledPaymentModules() as $payment) { $module = Module::getInstanceByName($payment['name']); if (Validate::isLoadedObject($module) && $module->active) { $payment_methods[] = $module->displayName; } } or you can combine both codes above to get list of { NameOfModule + its PaymentMethods + its allowed currencies } I'm building an APP and I need to have the list of payment methods for the cart checkout phase. I am using the prestashop webservice but cannot find the method related to the payment list. Can u help me? thanks Link to comment Share on other sites More sharing options...
Endrigo Posted January 11, 2021 Share Posted January 11, 2021 On 8/3/2020 at 9:49 AM, maicol.cantagallo said: I'm building an APP and I need to have the list of payment methods for the cart checkout phase. I am using the prestashop webservice but cannot find the method related to the payment list. Can u help me? thanks Hi maicol.cantagallo. I am developing something similar. It seems that there is no API for the list of payment methods. From PaymentModule::getInstalledPaymentModules() I got the information (Prestashop 1.7.3): SELECT DISTINCT m.`id_module`, h.`id_hook`, m.`name`, hm.`position` FROM `ps_module` m LEFT JOIN `ps_hook_module` hm ON hm.`id_module` = m.`id_module` AND hm.id_shop IN (1) LEFT JOIN `ps_hook` h ON hm.`id_hook` = h.`id_hook` INNER JOIN `ps_module_shop` ms ON (m.`id_module` = ms.`id_module`AND ms.id_shop = 1) -- Enable / disable module WHERE h.`name` = 'paymentOptions' ; I hope you find this information useful. Link to comment Share on other sites More sharing options...
maicol.cantagallo Posted January 12, 2021 Share Posted January 12, 2021 12 hours ago, Endrigo said: Hi maicol.cantagallo. I am developing something similar. It seems that there is no API for the list of payment methods. From PaymentModule::getInstalledPaymentModules() I got the information (Prestashop 1.7.3): SELECT DISTINCT m.`id_module`, h.`id_hook`, m.`name`, hm.`position` FROM `ps_module` m LEFT JOIN `ps_hook_module` hm ON hm.`id_module` = m.`id_module` AND hm.id_shop IN (1) LEFT JOIN `ps_hook` h ON hm.`id_hook` = h.`id_hook` INNER JOIN `ps_module_shop` ms ON (m.`id_module` = ms.`id_module`AND ms.id_shop = 1) -- Enable / disable module WHERE h.`name` = 'paymentOptions' ; I hope you find this information useful. Hi Endrigo, thanks for reply. yes i used this solution but it is not the best. How can I manage payments from the payplug module? or paypal module? thanks 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