As per the subject, I need to understand what is expected to happen with the refund process in respect to the shipping costs and payment gateway.
Specifically:
- are shipping plugins called during the refund process? (I can't find a suitably named method to indicate it is, unless getCosts() is called in shipping.)
- similarly for payment plugins, I can see a method to cancel but not just to refund in the Payment plugin Wiki (http://dev.virtuemart.net/projects/virtuemart/wiki/Payment_Plugins)
- is there a way to control if shipping is refunded or not when and order is cancelled/refunded?
The reason I need to understand this one of our clients has installed a shipping plugin that when orders are refunded that used the particular plugin only the value of the good is refunded not the shipping costs. Yet the two other shipping plugins have their shipping costs refunded - so which behaviour is correct(?) way.
Cheers
Craig
Hello,
Method Cancel is triggered when the user cancel at the moment of checkout (bank, pay site) the transaction, so the order never made.
The custom plugin that your customer uses should receive those price from the orders. Also vm2 have the functions when selecting payment and shipment methods the costs are been saved in the database. Please take a look inside xxxx_virtuemart_payment_plg_NameOfYourPlugin to and also xxxx_virtuemart_shipping_plg_NameOfYourPlugin for your shipment plugin is the costs are been saved. If are not saved then there is a problem i suppose with the custom plugins.
So your refund plugin should take the order from order and also check the cost of payment and shipment and refund it also.
Regards
Hello
You can use this trigger for the refund
plgVmOnUpdateOrderPayment (&$order, $old_order_status)
You have an example of how to use it in the klarna payment plugin.