VirtueMart Forum

VirtueMart 2 + 3 + 4 => Plugins: Payment, Shipment and others => Topic started by: cppl on October 10, 2012, 07:18:23 AM

Title: What is the normal refund behaviour for VM2's shipping and payment plugins?
Post by: cppl on October 10, 2012, 07:18:23 AM
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:

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
Title: Re: What is the normal refund behaviour for VM2's shipping and payment plugins?
Post by: bytelord on October 10, 2012, 12:00:30 PM
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
Title: Re: What is the normal refund behaviour for VM2's shipping and payment plugins?
Post by: alatak on October 11, 2012, 20:04:20 PM
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.