简体   繁体   中英

Prestashop 1.6 unable to find Order via Cart ID

I am using a payment module with Prestashop 1.6, everything was working fine until an upgrade happened. The payment server return the validation data to an url like " http://..../validation.php ".

This file tries to get the order using the cart id that is returned by the server and obviously cant find it, hence the cart is not emptied and the order not created.

I added logs into that file to see what is received. The CartID (data['reference']) is correct.

writeMessage("Trying to get the order id using the cart:".$data['reference']);
        writeMessage(Order::getOrderByCartId((int)($data['reference'])));
        if ($id_order = intval(Order::getOrderByCartId((int)($data['reference']))))
        {
                writeMessage("Got the order by cart id.");
                writeMessage("Got the order by cart id:".$id_order);
                $order = new Order($id_order);
...

I am wondering if the call to Order::getOrderByCartId is correct. Is it the right way to call this function?

Any idea?

I can answer my question. The issue was not on the call to getOrderByCartId as it is normal that at this moment the order is not created yet. The issue is actually on the validation function of the module, second part of the if.

$module->validateOrder(intval($data['reference']), $orderStatus, $amount, $module->displayName, $orderMessage, NULL, $id_currency, true, $customer->secure_key);

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM