Merge pull request #13689 from eileenmcnaughton/no_record_payment
authorMonish Deb <deb.monish@gmail.com>
Thu, 25 Apr 2019 11:24:25 +0000 (16:54 +0530)
committerGitHub <noreply@github.com>
Thu, 25 Apr 2019 11:24:25 +0000 (16:54 +0530)
Call Payment.create from payment.cancel

1  2 
CRM/Contribute/BAO/Contribution.php
CRM/Financial/BAO/Payment.php
api/v3/Payment.php
tests/phpunit/api/v3/PaymentTest.php

Simple merge
index fbb3e58de800cf03a6b1db3909c4f987f54b722f,268d2a746adad116bd0d86e53dd09da41f06d2dc..e743d2d796851b6e7983565a65cb1345fdc4b371
@@@ -99,9 -99,12 +99,12 @@@ class CRM_Financial_BAO_Payment 
          CRM_Contribute_BAO_Contribution::assignProportionalLineItems($params, $trxn->id, $contribution['total_amount']);
        }
      }
+     elseif ($params['total_amount'] < 0) {
+       $trxn = self::recordRefundPayment($params['contribution_id'], $params, FALSE);
+     }
  
      if ($isPaymentCompletesContribution) {
 -      civicrm_api3('Contribution', 'completetransaction', array('id' => $contribution['id']));
 +      civicrm_api3('Contribution', 'completetransaction', ['id' => $contribution['id']]);
        // Get the trxn
        $trxnId = CRM_Core_BAO_FinancialTrxn::getFinancialTrxnId($contribution['id'], 'DESC');
        $ftParams = ['id' => $trxnId['financialTrxnId']];
Simple merge
Simple merge