Uploaded image for project: 'CiviCRM'
  1. CiviCRM
  2. CRM-7696

Recurring contributions are created even if payment processor generates errors

    Details

    • Type: Bug
    • Status: Done/Fixed
    • Priority: Trivial
    • Resolution: Fixed/Completed
    • Affects Version/s: 3.2.2, 3.2.3, 3.2.4, 3.2.5, 3.3.0, 3.3.1, 3.3.2, 3.3.3, 3.3.5
    • Fix Version/s: 3.4.alpha
    • Component/s: None
    • Labels:
      None

      Description

      CRM_Contribute_BAO_Contribution_Utils::processConfirm()

      has a bug that causes contribution records to be created even if the transaction fails with the processor.

      It seems the original assumption was that no status would be received from the processor only through the IPN.

      Our payment processor implementation with Vanco does generate errors (bad card number, expired etc)
      on the initial recurring payment request.

      In the following code (approximately line 256)
      //Do not send an email if Recurring contribution is done via Direct Mode
      //Email will we send once the IPN will receive.
      if ( $paymentParams['is_recur'] && $form->_contributeMode == 'direct' )

      { return true; }

      is designed to avoid sending a confirmation. However since the transaction has already errored it causes the call process to proceed as if the transaction was successful.

      I thought this was handled correctly but then noticed the following at ~203

      if ( is_a( $result, 'CRM_Core_Error' ) ) {
      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']}" ) );
      }

      The code checks for core error but then only redirects if in membership.

      In our implementation we generate the error within doDirect payment - so we were see the error but then noticed transactions were also created.

      I haven't recreated on demo site - not sure there is a recurring payment processor available,

        Attachments

          Activity

            People

            • Assignee:
              kiran.jagtap Kiran Jagtap
              Reporter:
              dschafer Dave Schafer
            • Votes:
              0 Vote for this issue
              Watchers:
              0 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: