Jump to content

Webservice order BUG


Recommended Posts



it is not possible to add an order through webservice without writing to ps_order_payment!


for example if  i want to add an order with bankwire payment it always set order state to payment error because prestashop always writes a row in ps_order_payment even if it is not required (bankwire payment).


Does anybody worked this around????


Please help us  we're stuck on this developing a mobile app.



Edited by ziostanko (see edit history)
Link to comment
Share on other sites

<?xml version="1.0" encoding="UTF-8"?>
<prestashop xmlns:xlink="http://www.w3.org/1999/xlink">
	<payment>Bonifico bancario</payment>

am i missing something?

Link to comment
Share on other sites

found that webservice orders are validated by

public function addWs($autodate = true, $null_values = false)
        /** @var PaymentModule $payment_module */
        $payment_module = Module::getInstanceByName($this->module);
        $customer = new Customer($this->id_customer);
        $payment_module->validateOrder($this->id_cart, Configuration::get('PS_OS_WS_PAYMENT'), $this->total_paid, $this->payment, null, array(), null, false, $customer->secure_key);
        $this->id = $payment_module->currentOrder;
        return true;

in order class...


this method sets the state of the order to Configuration::get('PS_OS_WS_PAYMENT') that is 12 (remote payment accepted or something like that) by default... is that for security reasons?

why this method does not read the current_state from xml ws???


i had to write an override for this method using custom states based on payment module.



Edited by ziostanko (see edit history)
Link to comment
Share on other sites

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 account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Create New...