Hi,
For the shopping cart to be emptied, either it has to be done manually by the payment plugin, or the payment plugin needs to redirect the customer to the after_end URL of HikaShop will will empty the cart automatically.
For example, in the "example" payment plugin we provide on our developer documentation, we have this piece of code:
$return_url = HIKASHOP_LIVE.'index.php?option=com_hikashop&ctrl=checkout&task=after_end&order_id='.$order_id.$this->url_itemid;
...
$this->app->redirect($return_url);
in the onPaymentNotification function which does that.
Regarding the notification email to the customer, it depends on the code in the onPaymentNotification function.
If you look again at the example payment plugin's code, you can see this call before the redirect:
$this->modifyOrder($order_id, $this->payment_params->verified_status, true, true);
This modifyOrder function is the function we recommend payment plugin developers to use in order to change the status of the order.
If the third parameter is set to true, HikaShop will notify the user with an "order status notification" email.
If the fourth parameter is set to true, HikaShop will notify the admin with a "payment notification" email.
If your customers don't get the email notification, then it means that either this function is called with wrong parameters, or that the order status is changed without using that function.