bellini13 Posted May 28, 2014 Share Posted May 28, 2014 I have several question related to the PrestaFraud module (aka "PrestaShop Security"). This is directed to Prestashop as the developer of the module. The module assumes that every order will have a carrier defined, which is a poor assumption considering that carriers are not required for Virtual orders (ie. orders that only contain virtual products) Looking into the PrestaFraud module coding, the module does the following 1) In the module configuration, you are supposed to define the type of Carriers in your store. The options are '1' => $this->l('Pick up in-store'), '2' => $this->l('Withdrawal point'), '3' => $this->l('Slow shipping more than 3 days'), '4' => $this->l('Shipping express')); Question: Could you please define what "Withdrawal point" is meant to be used for? The module does not define it, and the Prestashop documentation also does not define it. 2) The module implements the newOrder hook. Part of this is looking at the carrier used in the order, and passing that carriers configured type (from #1 above). $carrier = new Carrier((int)$params['order']->id_carrier); $carrier_infos = $order->addChild('carrier_infos'); $carrier_infos->addChild('name', $carrier->name); $carriers_type = $this->_getConfiguredCarriers(); $carrier_infos->addChild('type', $carriers_type[$carrier->id]); Question: Could you please explain if this is required for the service to function properly? For virtual orders, since the id_carrier will be 0, which is not a valid carrier, the service will not receive the carrier type. It would seem wiser to check if the carrier is valid, and then send the carrier type to the service. Otherwise if the carrier is not valid, then skip sending the carrier data completely. I would like to submit a change to the module since the module throws an error due to the id_carrier being 0, but since the API is not documented, it is impossible for me to know what effect this would have on the service. So I am looking for the developers to provide feedback on this. 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