-- HikaShop version -- : 2.3.3
-- Joomla version -- : 3.3.6
Hello,
I am developing a payment plugin for a bank's payment gateway from the example one offered in the Hikashop site.
The problem comes at the moment of receiving the gateway's notification of the payment. The bank requests a "response to a notification" as "a URL-coded document which only contains one text line (no HTML tags, etc.) in the format parameter=value". This parameter is the url for the user to be redirected.
If I kill the application right after echoing such line, the redirection works out fine:
function onPaymentNotification(&$statuses)
{
...
else //If everything's OK, order is validated -> success
{
$this->modifyOrder($order_id, 'confirmed', true, true);
$requestURL = "rurls=".HIKASHOP_LIVE."index.php?option=com_hikashop&ctrl=checkout&task=after_end"; // successful transaction
echo $requestURL;
exit;
// return true;
};
}
If I use the "return true" (as other plugins do), I get an error from the payment gateway. Which makes me think that using "return" leads to other functions that write something else to that response.
So my question is: is it wrong to use "exit" there? The order status changes and the user is notified that the order is confirmed. So what am I preventing Hikashop of doing? I checked the
notify function in the
checkout.php, but it's not clear to me what exactly is it doing.
Thank you in advance!