I face a problem with my Prestashop module. I'm developing a module for payment. It works but I have a problem with the order status. I close the order before the payment (because I have to send the reference to bank which is generated after the order confirmation). Then when the payment is accepted my bank returns to me a php file that I want to edit in order to change the order status from "Awaiting payment" to "Payment accepted", how can I achieve that?
I'm using Prestashop 1.6.1.4
Thank you for every suggestion or information you can provide.
Regards
If you look at the PaymentModule.php
class you can find how the order status is set after the order is created
$new_history = new OrderHistory();
$new_history->id_order = (int) $order->id;
$new_history->changeIdOrderState((int) $id_order_state, $order, true);
Do you absolutely need to send the order reference to the bank though? My shops just send the order id which you can get with Order::getNextOrderId()
before you actually create it.