CiviCRM Community Forums (archive)

*

News:

Have a question about CiviCRM?
Get it answered quickly at the new
CiviCRM Stack Exchange Q+A site

This forum was archived on 25 November 2017. Learn more.
How to get involved.
What to do if you think you've found a bug.



  • CiviCRM Community Forums (archive) »
  • Discussion »
  • Extensions (Moderators: mathieu, totten, kasiawaka) »
  • Can payment extensions participate in hooks?
Pages: [1]

Author Topic: Can payment extensions participate in hooks?  (Read 731 times)

donquixote

  • I post occasionally
  • **
  • Posts: 42
  • Karma: 3
  • CiviCRM version: none
  • CMS version: Drupal
  • MySQL version: 5
  • PHP version: 5.2
Can payment extensions participate in hooks?
April 16, 2013, 10:52:37 am
Hi,
I created a payment extension, and want to register a menu url for this extension.
(for the IPN - because the default one does not behave the way I want)

So I made a

function postfinance_civicrm_xmlMenu(&$files) {
  var_dump(__FUNCTION__);
  $files[] = __DIR__ . '/menu.xml';
}

and visited civicrm/menu/rebuild.

Unfortunately, it seems that the function never fires.
Some research reveals that only "module" type extensions participate in hooks. Payment extensions don't.
:(

See also
CRM_Utils_Hook::requireCiviModules()
Here it says
$civiModules = CRM_Core_PseudoConstant::getModuleExtensions();
so apparently only module extensions are considered.

Is this intended?

Donald Lobo

  • Administrator
  • I’m (like) Lobo ;)
  • *****
  • Posts: 15963
  • Karma: 470
    • CiviCRM site
  • CiviCRM version: 4.2+
  • CMS version: Drupal 7, Joomla 2.5+
  • MySQL version: 5.5.x
  • PHP version: 5.4.x
Re: Can payment extensions participate in hooks?
April 16, 2013, 01:36:18 pm

yes only module extensions are part of the hook ecosystem :)

You should be able to do a payment processor as a module extension. You just need to register your payment processor as part of the module install script

lobo
A new CiviCRM Q&A resource needs YOUR help to get started. Visit our StackExchange proposed site, sign up and vote on 5 questions

donquixote

  • I post occasionally
  • **
  • Posts: 42
  • Karma: 3
  • CiviCRM version: none
  • CMS version: Drupal
  • MySQL version: 5
  • PHP version: 5.2
Re: Can payment extensions participate in hooks?
April 16, 2013, 01:58:27 pm
ok, thanks!
for now i found my own solution to the problem, without the custom menu xml.
But it is good to know for the next time.

Pages: [1]
  • CiviCRM Community Forums (archive) »
  • Discussion »
  • Extensions (Moderators: mathieu, totten, kasiawaka) »
  • Can payment extensions participate in hooks?

This forum was archived on 2017-11-26.