VirtueMart Forum

VirtueMart 2 + 3 + 4 => Plugins: Payment, Shipment and others => Topic started by: likrish on December 04, 2015, 15:45:02 PM

Title: Performing partial refunds in payment plugin
Post by: likrish on December 04, 2015, 15:45:02 PM
Hi,

I have created an extended Authorize.net payment plugin that also handles stores customer information, credit cards and line items from Virtuemart orders.

One of the key features I am trying to implement is partial refunds. My plugin uses the plgVmOnUpdateOrderPayment function hook to intercept changes made to the order status and perform various tasks. If I change an order status to refunded, I can perform a full refund via the Authorize.net API. However I am unable to get the value of a line item when changing a line item status to refunded and perform a partial refund.

My Question...
The function is working and firing in my payment plugin as expected, however when changing a line item I do not know hot to the line item id and value (only the full order).

Any help greatly appreciated...
Title: Re: Performing partial refunds in payment plugin
Post by: GJC Web Design on December 04, 2015, 22:46:56 PM
have you looked at function plgVmOnUpdateSingleItem ($data, $order)

Ouch... just double checked .. is removed now... was last in VM3.0.2..  :(

was in public function updateSingleItem($virtuemart_order_item_id, &$orderdata, $orderUpdate = false)

/*
//       JPluginHelper::importPlugin('vmcustom');
//       $_dispatcher = JDispatcher::getInstance();
//       $_returnValues = $_dispatcher->trigger('plgVmOnUpdateSingleItem',array($table,&$orderdata));
*/

Maybe Max can tell us why it was removed?