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 CiviContribute (Moderator: Donald Lobo) »
  • Core error - deleted contribution
Pages: [1]

Author Topic: Core error - deleted contribution  (Read 1097 times)

Eileen

  • Forum Godess / God
  • I’m (like) Lobo ;)
  • *****
  • Posts: 4195
  • Karma: 218
    • Fuzion
Core error - deleted contribution
May 04, 2011, 12:04:33 am
I have a situation where a contribution is being made & accepted by paypal but it isn't in Civi

I think it is being deleted in this bit of code & I wanted to suggest that if there is a Core Error the contribution is set to failed rather than deleted so a trace of it remains. I think it's more accurate too

CRM_Contribute_BAO_Contribution_Utils


       if ( is_a( $result, 'CRM_Core_Error' ) ) {
           
            //make sure to cleanup db for recurring case.
            if ( CRM_Utils_Array::value( 'contributionID', $paymentParams ) ) {
                CRM_Contribute_BAO_Contribution::deleteContribution( $paymentParams['contributionID'] );
            }
            if ( CRM_Utils_Array::value( 'contributionRecurID', $paymentParams ) ) {
                CRM_Contribute_BAO_ContributionRecur::deleteRecurContribution( $paymentParams['contributionRecurID'] );
            }
           
            if ( $component !== 'membership' ) {
                CRM_Core_Error::displaySessionError( $result );
                CRM_Utils_System::redirect( CRM_Utils_System::url( 'civicrm/contribute/transact',
                                                                   "_qf_Main_display=true&qfKey={$form->_params['qfKey']}" ) );
            }
            $membershipResult[1] = $result;
        } else {
            if ( $result ) {
                $form->_params = array_merge( $form->_params, $result );
            }
            $form->_params['receive_date'] = $now;
            $form->set( 'params', $form->_params );
            $form->assign( 'trxn_id', $result['trxn_id'] );
            $form->assign( 'receive_date',
                           CRM_Utils_Date::mysqlToIso( $form->_params['receive_date']) );
       
            // result has all the stuff we need
            // lets archive it to a financial transaction
            if ( $contributionType->is_deductible ) {
                $form->assign('is_deductible',  true );
                $form->set('is_deductible',  true);
            }

            if ( isset( $paymentParams['contribution_source'] ) ) {
                $form->_params['source'] = $paymentParams['contribution_source'];
            }
           
            // check if pending was set to true by payment processor
            $pending = false;
            if ( CRM_Utils_Array::value( 'contribution_status_pending',
                                         $form->_params ) ) {
                $pending = true;
            }
            if ( !($paymentParams['is_recur'] && $form->_contributeMode == 'direct') ) {
                $contribution =
                    CRM_Contribute_Form_Contribution_Confirm::processContribution( $form,
                                                                                   $form->_params, $result,
                                                                                   $contactID, $contributionType,
                                                                                   true, $pending, true );
            }
            $form->postProcessPremium( $premiumParams, $contribution );
           
            $membershipResult[1] = $contribution;
        }
   
Make today the day you step up to support CiviCRM and all the amazing organisations that are using it to improve our world - http://civicrm.org/contribute

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: Core error - deleted contribution
May 04, 2011, 10:06:16 am

would be great if you can figure out when and why paypal accepts and recognizes the contribution, but indicates to CiviCRM that it is an error

will probably give us more insight into what is happening and why

a bit split on whether we should record all attempts at a contribution as failed.

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

Eileen

  • Forum Godess / God
  • I’m (like) Lobo ;)
  • *****
  • Posts: 4195
  • Karma: 218
    • Fuzion
Re: Core error - deleted contribution
May 04, 2011, 02:20:22 pm
From my usage knowing that someone tried to pay by credit card but failed is useful information as it helps me to interpret what went on when they tell me about it later. Often they fail because we don't accept AMEX (ie. we haven't forked out the extra dosh to do so) but this is something I only discovered recently & would have discovered a lot sooner had the failed transactions shown in Civi
Make today the day you step up to support CiviCRM and all the amazing organisations that are using it to improve our world - http://civicrm.org/contribute

Eileen

  • Forum Godess / God
  • I’m (like) Lobo ;)
  • *****
  • Posts: 4195
  • Karma: 218
    • Fuzion
Re: Core error - deleted contribution
May 04, 2011, 02:21:47 pm
Re the error that is causing the deletion - It seems to be getting a Core Error when it tries to send out receipts - some mail config problem
Make today the day you step up to support CiviCRM and all the amazing organisations that are using it to improve our world - http://civicrm.org/contribute

Eileen

  • Forum Godess / God
  • I’m (like) Lobo ;)
  • *****
  • Posts: 4195
  • Karma: 218
    • Fuzion
Re: Core error - deleted contribution
May 04, 2011, 02:27:20 pm
OK - here is the Core Error that is causing the contributions to be cancelled. We have recently changed servers so the problem will be to do with that but the real problem for us is not that the receipts didn;t go out  -but that we have lost the contributions out of CiviCRM


   $Ignoring exception thrown here = PEAR_Error Object ( [error_message_prefix] => [mode] => 16 [level] => 1024
Code: [Select]
=> [message] => mail() returned failure [userinfo] => [backtrace] => Array ( [0] => Array ( [file] => /var/www/mprc/sites/all/modules/civicrm/packages/PEAR.php [line] => 566 [function] => PEAR_Error [class] => PEAR_Error [type] => -> [args] => Array ( [0] => mail() returned failure [1] => [2] => 16 [3] => Array ( [0] => CRM_Core_Error [1] => nullHandler ) [4] => ) ) [1] => Array ( [file] => /var/www/mprc/sites/all/modules/civicrm/packages/Mail/mail.php [line] => 174 [function] => raiseError [class] => PEAR [object] => Mail_mail Object ( [_params] => -f@localhost [sep] => ) [type] => -> [args] => Array ( [0] => mail() returned failure )
Make today the day you step up to support CiviCRM and all the amazing organisations that are using it to improve our world - http://civicrm.org/contribute

Pages: [1]
  • CiviCRM Community Forums (archive) »
  • Old sections (read-only, deprecated) »
  • Support »
  • Using CiviCRM »
  • Using CiviContribute (Moderator: Donald Lobo) »
  • Core error - deleted contribution

This forum was archived on 2017-11-26.