简体   繁体   English

Prestashop 1.6支付模块订单状态

[英]Prestashop 1.6 payment module order state

I created payment module for Prestashop 1.6.1.1. 我为Prestashop 1.6.1.1创建了支付模块。

The problem is with updating order state after customer returns from banks website. 问题在于客户从银行网站返回后更新订单状态。 I can not get cart from context as shown on examples. 如示例所示,我无法从上下文中获取购物车。

For example, this is controller, which is executed, when customer presses cancel button on bank: 例如,当客户按下银行上的取消按钮时,这是执行的控制器:

class MyModulePaymentCancelModuleFrontController extends ModuleFrontController{
    public function initContent(){
        $cart = $this->context->cart;
    }
}

The cart value is null. 购物车价值为空。 It seems like the cart has been deleted / discarded prior to the controller. 看起来在购买控制器之前已经删除/丢弃了购物车。

In the contrary, I get proper cart from context in MyModule Payment ModuleFrontController (creating order) and MyModulePayment Return ModuleFrontController (payment completed successfully). 相反,我在MyModule Payment ModuleFrontController(创建订单)和MyModulePayment 返回 ModuleFrontController(付款成功完成)中从上下文获取正确的购物车。

Could anyone please point me in the right direction. 谁能请我指出正确的方向。

Looks like cart is destroyed as soon as order is created. 一旦订单创建,看起来像购物车被销毁。 I sent order id to the bank, which I expected to be returned and then used that as reference point for updating orders. 我将订单ID发送到银行,我希望将其返回,然后将其用作更新订单的参考点。

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

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