-- url of the page with the problem -- :
biosinar.com
-- HikaShop version -- : 3.1.1
-- Joomla version -- : 3.7.4
-- PHP version -- : 7.0.22
Hi guys,
I am developing a custom payment method for Hikashop. a couple of things are not working.
1. When i use this line in my code for function onPaymentNotification(&$statuses)...
$this->modifyOrder($order_id, $this->payment_params->invalid_status, true, true);
Two things happen ie
a) It does NOT change the order status to the defaut for cancellations ie CANCELLED, instead the order remains as CREATED
b) It prevent a redirect to the cancel_url, instead the user is brought back to the last stage of the shopping cart
If I replace the same line with this
//$this->modifyOrder($order_id, $this->payment_params->verified_status, true, true);
Everything works, but of course, that line makes cancelled orders become CONFIRMED. It also takes the user to the right cancel_url.
Here's the relevant codes
if($vars['EXECCODE'] != 0000)
{
// Here we display debug information which will be catched by HikaShop and stored in the payment log file available in the configuration's Files section.
//print "EXECCODE is non-zero";
if($this->payment_params->debug)
print 'payment '.$vars['MESSAGE']."\n\n\n";
// This function modifies the order with the id $order_id, to attribute it the status invalid_status.
//$this->modifyOrder($order_id, $this->payment_params->verified_status, true, true);
$this->modifyOrder($order_id, $this->payment_params->invalid_status, true, true);
//To redirect the user, if needed. Here the redirection is useless : we are on server side (and not user side, so the redirect won't work), and the cancel url has been set on the payment platform merchant account
$this->app->redirect($cancel_url);
return false;
}
//If everything's OK, the payment has been done. Order is validated -> success
else
{
//print "All OK";
$this->modifyOrder($order_id, $this->payment_params->verified_status, true, true);
$this->app->redirect($return_url);
return true;
}