News:

Looking for documentation? Take a look on our wiki

Main Menu

plgVmOnPaymentNotification() not getting called

Started by PeteST, June 18, 2012, 15:39:46 PM

Previous topic - Next topic

PeteST

I am developing a payment module.  I have inserted the method plgVmOnPaymentNotification() into my class and have put a call to exit('custom text here') at the top of this method so that I know when it is called correctly.  I am attempting to run this method by accessing the following URL:

index.php?option=com_virtuemart&view=pluginresponse&task=pluginnotification&tmpl=component

Nothing is printed, however; the call to $dispatcher->trigger('plgVmOnPaymentNotifcation'...) in pluginresponse.php, pluginNotification() does not appear to call my method (although it does call other payment modules, which I understand is correct behavior).

Why might this payment method not be registered as an observer for the event 'plgVmOnPaymentNotification'?

NB: I recently developed another payment module for VM2 and cannot recall having to do anything to attach the observers/get the URL to call my payment method...

Any help would be great - I'm working on quiet a short deadline!  Thank you.

PeteST

I've just solved the problem.  It wasn't actually a problem with the new payment module, but with the one I had previously written that was still installed.  The old module did not check to see if it should run plugVmOnPaymentNotification() with something like this:

if (!($method = $this->getVmPluginMethod($order['details']['BT']->virtuemart_paymentmethod_id))) {
         return NULL;
      }

A conditional inside this module subsequently failed; its block then called exit; with no error message.  Very silly.

This thread may want to be deleted since it did not detail a legitimate VirtueMart 2 problem but a silly coding error on my part.