简体   繁体   中英

Prestashop 1.6 payment module order state

I created payment module for 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).

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.

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