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) »
  • Old sections (read-only, deprecated) »
  • Support »
  • Using CiviCRM »
  • Using CiviEvent (Moderator: Yashodha Chaku) »
  • Error with payment processor
Pages: [1]

Author Topic: Error with payment processor  (Read 973 times)

qjensen

  • I post frequently
  • ***
  • Posts: 141
  • Karma: 11
    • Scaled Solutions
  • CiviCRM version: 4.5
  • CMS version: Drupal 7
  • MySQL version: 5.5
  • PHP version: 5.3
Error with payment processor
January 25, 2011, 03:15:55 pm
I have created a payment processor plugin for Chase Paymentech that has been running well for about three months. I am now running into problems after upgrading to 3.3.3 from 3.2.3.

My upgrade process went off without any errors, but I am getting an error after upgrading
Code: [Select]
Fatal error: Maximum function nesting level of '100' reached, aborting! in \path\to\drupal\sites\all\modules\civicrm\CRM\Core\Config.php on line 95
It looks like
Code: [Select]
CRM_Core_Payment::singleton( ) is being called repeatedly until the max recursion level is reached, but I don't understand why.

In the release announcement for 3.3.3 there is a note that it includes the "First take on extension mechanism for CiviCRM, allowing creation and distribution of plugins (payment processors, custom search, custom report templates for now)". Does this effect the way payment processors are implemented? The documentation appears to be the same, but if it needs to be updated, I would be happy to help.

Thanks for any assistance.
« Last Edit: January 25, 2011, 03:19:30 pm by qjensen »
Quint Jensen
Web Developer
Scaled Solutions
--" Remove the 'I want you to like me' notes from your forehead and place them where they truly will do the most good -- on your mirror!" Author Unknown

Michał Mach

  • Ask me questions
  • ****
  • Posts: 748
  • Karma: 59
    • CiviCRM site
  • CiviCRM version: latest
  • CMS version: Drupal and Joomla latest
  • MySQL version: numerous
  • PHP version: 5.3 and 5.2
Re: Error with payment processor
January 26, 2011, 03:43:16 am
Hm, new extensions addition shouldn't have influenced existing payment processors - all our processors worked without changes, from what I remember. It looks rather like something connected to multiple payment processors functionality, but I might be wrong. Any chance you can retrieve some traceback from the log file (if there is any)?

Thx,
m
Found this reply helpful? Contribute NOW and help us improve CiviCRM with the Make it Happen! initiative.

My absolute favourite: Wordpress Integration!.

Donate Now!

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: Error with payment processor
January 26, 2011, 08:23:16 am

this came up on IRC recently. You need a singleton function in your payment code, something similar to:

Code: [Select]
    /**                                                                                                                                     
     * singleton function used to manage this object                                                                                       
     *                                                                                                                                     
     * @param string $mode the mode of operation: live or test                                                                             
     *                                                                                                                                     
     * @return object                                                                                                                       
     * @static                                                                                                                             
     *                                                                                                                                     
     */
    static function &singleton( $mode, &$paymentProcessor ) {
        $processorName = $paymentProcessor['name'];
        if (self::$_singleton[$processorName] === null ) {
            self::$_singleton[$processorName] = new CRM_Core_Payment_PaypalImpl( $mode, $paymentProcessor );
        }
        return self::$_singleton[$processorName];
    }

i'm not sure the history / origins of why this was introduced

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

qjensen

  • I post frequently
  • ***
  • Posts: 141
  • Karma: 11
    • Scaled Solutions
  • CiviCRM version: 4.5
  • CMS version: Drupal 7
  • MySQL version: 5.5
  • PHP version: 5.3
Re: Error with payment processor
January 27, 2011, 06:19:05 pm
I just walked through the code and compared my code to the PayflowPro implementation and found this out. I will work on updating the Wiki page to provide some additional information.

Thanks for all of your help today Lobo.
Quint Jensen
Web Developer
Scaled Solutions
--" Remove the 'I want you to like me' notes from your forehead and place them where they truly will do the most good -- on your mirror!" Author Unknown

Michał Mach

  • Ask me questions
  • ****
  • Posts: 748
  • Karma: 59
    • CiviCRM site
  • CiviCRM version: latest
  • CMS version: Drupal and Joomla latest
  • MySQL version: numerous
  • PHP version: 5.3 and 5.2
Re: Error with payment processor
January 31, 2011, 11:15:48 am
If the problem is the below, that has been introduced to get rid of CRM_Contribute_Payment_ProcessorName and CRM_Event_Payment_ProcessorName classes which basically contained the singleton methods only.

Thx,
m

Quote from: Donald Lobo on January 26, 2011, 08:23:16 am

this came up on IRC recently. You need a singleton function in your payment code, something similar to:

Code: [Select]
    /**                                                                                                                                     
     * singleton function used to manage this object                                                                                       
     *                                                                                                                                     
     * @param string $mode the mode of operation: live or test                                                                             
     *                                                                                                                                     
     * @return object                                                                                                                       
     * @static                                                                                                                             
     *                                                                                                                                     
     */
    static function &singleton( $mode, &$paymentProcessor ) {
        $processorName = $paymentProcessor['name'];
        if (self::$_singleton[$processorName] === null ) {
            self::$_singleton[$processorName] = new CRM_Core_Payment_PaypalImpl( $mode, $paymentProcessor );
        }
        return self::$_singleton[$processorName];
    }

i'm not sure the history / origins of why this was introduced

lobo
Found this reply helpful? Contribute NOW and help us improve CiviCRM with the Make it Happen! initiative.

My absolute favourite: Wordpress Integration!.

Donate Now!

Pages: [1]
  • CiviCRM Community Forums (archive) »
  • Old sections (read-only, deprecated) »
  • Support »
  • Using CiviCRM »
  • Using CiviEvent (Moderator: Yashodha Chaku) »
  • Error with payment processor

This forum was archived on 2017-11-26.