Hi,
The issue is probably that you're not able to retrieve the order_id for some reason.
The code:
$app =& JFactory::getApplication();
$order_id = $app->getUserState('com_hikashop.order_id');
will retrieve the order_id from the user session. This variable is normally set by HikaShop when it creates the order, before redirecting to the payment gateway.
If the user session changes for whatever reason between the order creation and the redirection to the return page, it's possible this will set $order_id to "null".
You added the tag {order_id} to the return URL to add the order_id in the URL.
For example, suppose you've used the return URL :
https://www.hikashop.com/extensions/hika-business.html?my_variable={order_id}
In that case, you can use this code to get the order_id:
$order_id = (int)$_REQUEST['my_variable'];