What is the normal refund behaviour for VM2's shipping and payment plugins?

Started by cppl, October 10, 2012, 07:18:23 AM

Previous topic - Next topic

cppl

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
  • 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
Craig Phillips
craig@craigphillips.biz

Syd:     +61-2-8090-5408
Bris:     +61-7-3056-1992

bytelord

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
Production: Joomla 2.5.8 | VM 2.0.14 | PHP 5.3.13
Testing     : Joomla 2.5.8 | VM 2.0.16 | PHP 5.3.8
Testing     : Joomla 2.5.8 |    VM 2.1   | PHP 5.3.8

- Don't Forget to mark thread as solved when it is solved!
- Please do not PM with support questions, use the forum!

alatak

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.