Hi,
Well, yes, PayPal doesn't support negative prices.
Usually, in such cases, I would recommend to just turn off the "send order details" setting of the PayPal payment method.
Using the discount_amount_cart field for the shipping fee when the shipping fee is negative is something that could be implemented.
But then, the customer would see "discount" instead of "shipping" for the shipping fee, and if he has a coupon, the amount of the coupon would be summed together with the amount of the shipping fee.
And then, you would have the same query for payment fees, product prices (which can also be negative).
It looks like a hack of the API of PayPal. Ideally, it would be better that PayPal accept negative items as long as the total amount is positive. As that's not supported by PayPal I would recommend to just turn off the "send order details" option.
When the total order value is negative, HikaShop forces it to 0 when the cart is being loaded.
And when the total cart/order amount is 0, the payment method selector is removed from the checkout automatically and no call to the payment methods is done. At the end of the checkout the order will be created and if the "validate free order" plugin is activated, the order will be directly confirmed.
Most payment gateways don't accept transactions with a value of 0 or negative, so that's why we've done it like that as it wouldn't work otherwise.