CRM-16737 code coments
authorEileen McNaughton <eileen@fuzion.co.nz>
Tue, 7 Jul 2015 10:35:33 +0000 (22:35 +1200)
committerEileen McNaughton <eileen@fuzion.co.nz>
Tue, 7 Jul 2015 10:35:33 +0000 (22:35 +1200)
CRM/Member/BAO/Membership.php

index bc51d8effb155b7e26e25b4240fbaa64c8e342c2..fcce6d2285d81053633d94e3dabc7ce1f0a5bd39 100644 (file)
@@ -1449,8 +1449,13 @@ AND civicrm_membership.is_test = %2";
       $form->_values['contribution_id'] = $membershipContributionID;
     }
 
-    // Do not send an email if Recurring transaction is done via Direct Mode
-    // Email will we sent when the IPN is received.
+    // Refer to CRM-16737. Payment processors 'should' return payment_status_id
+    // to denote the outcome of the transaction.
+    //
+    // In 4.7 trxn_id will no longer denote the outcome & all processor transactions must return an array
+    // containing payment_status_id.
+    // In 4.6 support (such as there was) for other ways of denoting payment outcome is retained but the use
+    // of payment_status_id is strongly encouraged.
     if (!empty($form->_params['is_recur']) && $form->_contributeMode == 'direct') {
       if (!empty($membershipContribution->trxn_id) && !isset($membershipContribution->payment_status_id)
         || (!empty($membershipContribution->payment_status_id) && $membershipContribution->payment_status_id == 1)) {
@@ -1466,6 +1471,8 @@ AND civicrm_membership.is_test = %2";
           CRM_Core_Error::debug_log_message('contribution ' . $membershipContribution->id . ' not completed with trxn_id ' . $membershipContribution->trxn_id . ' and message ' . $e->getMessage());
         }
       }
+      // Do not send an email if Recurring transaction is done via Direct Mode
+      // Email will we sent when the IPN is received.
       return;
     }