OC2.0.2.0 & Malse Commerce - Undefined index: payment_method
Posted: Thu Nov 09, 2017 4:38 am
Opencart: Version 2.0.2.0
Specific Payment Module: Malse201 - Malse Commerce
The Problem: Suspect callback fails, receive an error page when trying to return to store from the Malse-Commerce system.
Error: Undefined index: payment_method in /***/***/public_html/***.co.uk/catalog/controller/payment/malse.php on line 297
---------------------------
I am trying to integrate an extension on OC Market place for Malse Commerce, it was developed by www.fido-x.net and sold on OC. (I have tried asking the developer and not had a reply for a number of months).
The customer places an order on OC store, is then taken to Malse-Commerce payment pages, they enter card details and then displayed a confirmation page. On that page is a button that says "Return to original website to complete order". This button should take the customer to; ***.co.uk/index.php?route=payment/malse/callback (as set in Malse & with a POST request) .Which then in theory finally goes to ***.co.uk/index.php?route=checkout/success.
The file /catalog/controller/payment/malse.php has this code at the bottom;
I believe this 2nd line is causing the problem from what the error message says, the line reference and some testing.
If I strip this code to the following;
The callback from Malse-Commerce works and takes me to the OC "Your order has been placed page" but the order status is "cancelled" by default. Admin & Customer receive order confirmation emails, shopping basket empties and all order data is passed into the Malse system also.
I am wondering if there is a genuine solution, or alternatively a way to code this to A) redirect correctly like my 'stripped code' approach, and B) set the order status to 'Pending'?
Any help and advice would be very much appreciated.
James
Specific Payment Module: Malse201 - Malse Commerce
The Problem: Suspect callback fails, receive an error page when trying to return to store from the Malse-Commerce system.
Error: Undefined index: payment_method in /***/***/public_html/***.co.uk/catalog/controller/payment/malse.php on line 297
---------------------------
I am trying to integrate an extension on OC Market place for Malse Commerce, it was developed by www.fido-x.net and sold on OC. (I have tried asking the developer and not had a reply for a number of months).
The customer places an order on OC store, is then taken to Malse-Commerce payment pages, they enter card details and then displayed a confirmation page. On that page is a button that says "Return to original website to complete order". This button should take the customer to; ***.co.uk/index.php?route=payment/malse/callback (as set in Malse & with a POST request) .Which then in theory finally goes to ***.co.uk/index.php?route=checkout/success.
The file /catalog/controller/payment/malse.php has this code at the bottom;
Code: Select all
public function callback() {
if ($this->session->data['payment_method']['code'] == 'malse') {
$this->load->model('checkout/order');
if ($this->request->post['sd'] == $this->session->data['order_id']) {
$this->model_checkout_order->addOrderHistory($this->session->data['order_id'], $this->config->get('malse_order_status_id'));
}
$this->response->redirect($this->url->link('checkout/success'));
}
}
If I strip this code to the following;
Code: Select all
public function callback() {
$this->response->redirect($this->url->link('checkout/success'));
}
I am wondering if there is a genuine solution, or alternatively a way to code this to A) redirect correctly like my 'stripped code' approach, and B) set the order status to 'Pending'?
Any help and advice would be very much appreciated.
James