Olaseni
Olaseni

Reputation: 7916

How to create a pending order in prestashop

Most of the Prestashop payment modules I have come across or any viable tutorial seem to follow the trend of creating and "validating" the order after payment has been ascertained i.e. after the return from a remote payment gateway like PayPal.

We have an architecture that requires we create a traditional "pending" order before payment is even attempted, and then this order's status (history) is changed to "payment accepted" and validated after the payment is completed or otherwise.

Is there a less than complicated way of doing something like this with prestashop?

I have tried calling "validateOrder" with a "pending" order status, and I noticed that would fire an order confirmation mail, and empty the contents of the cart irrespective of the payment status.

Upvotes: 2

Views: 1819

Answers (1)

Siva Kumar
Siva Kumar

Reputation: 560

You can pass the needed order state to validateOrder method called by the payment gateway module.

validateOrder($id_cart, $id_order_state, $amount_paid, $payment_method = 'Unknown', $message = null, $extra_vars = array(), $currency_special = null, $dont_touch_amount = false,   $secure_key = false, Shop $shop = null);

Upvotes: 1

Related Questions