简体   繁体   English

Prestashop 1.6无法通过购物车ID查找订单

[英]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. 我在Prestashop 1.6中使用了付款模块,一切正常,直到发生升级为止。 The payment server return the validation data to an url like " http://..../validation.php ". 付款服务器将验证数据返回到类似“ http://..../validation.php ”的URL。

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. 该文件尝试使用服务器返回的购物车ID来获取订单,显然找不到该订单,因此未清空购物车,也未创建订单。

I added logs into that file to see what is received. 我将日志添加到该文件中以查看收到了什么。 The CartID (data['reference']) is correct. CartID(data ['reference'])是正确的。

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. 我想知道对Order :: getOrderByCartId的调用是否正确。 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. 调用getOrderByCartId时没有问题,因为目前还没有创建订单,这很正常。 The issue is actually on the validation function of the module, second part of the if. 问题实际上出在模块的验证功能上,即if的第二部分。

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

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

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