I'm developing the WorldPay gateway, this is the general flow:
1. Checkout
2. Shipping
3. Payment (in which you select WorldPay)
4. Confirm (you set up which credit card you will use and any other coupon)
5. ... After clicking "continue" it will open WorldPay site with your customized design and all the payment information in order to proceed to pay.
6. From WorldPay is redirected to the "response link".
7. If succeed go to Payment Summary (order/success)
If not succeed, go to fail report
I'm stuck in the "callback" function in this part:
Code: Select all
if($transaction["status"] == "Y") { //success
// IS THIS CORRECT?
$this->load->model('checkout/order');
$this->model_checkout_order->confirm($order_id, $this->config->get('config_order_status_id'));
// WHAT IS NEXT HERE???
} else { //failed
... //AND HERE?
}
I have no so much experience with opencart engine (and there is so payment modules examples), so I'm not sure how I have to set that flag to 1 and how I send the response to the next page (after updating).
Any help will be appreciated. Also I would like to know where I can read any documentation about this?
Thank you.