Unverified Commit 2f4be90a authored by Seamus Lee's avatar Seamus Lee Committed by GitHub

Merge pull request #11749 from eileenmcnaughton/4.7.31-rc

CRM-21771: error when viewing event registration with linked contribu…
parents 8272de2c 6e751b14
......@@ -4106,7 +4106,7 @@ WHERE eft.financial_trxn_id IN ({$trxnId}, {$baseTrxnId['financialTrxnId']})
}
$paymentBalance = CRM_Core_BAO_FinancialTrxn::getPartialPaymentWithType($id, $entity, FALSE, $total);
$contribution = civicrm_api3('Contribution', 'getsingle', array('id' => $id, 'return' => array('is_pay_later', 'contribution_status_id', 'financial_type_id')));
$contribution = civicrm_api3('Contribution', 'getsingle', array('id' => $contributionId, 'return' => array('is_pay_later', 'contribution_status_id', 'financial_type_id')));
$info['payLater'] = $contribution['is_pay_later'];
$info['contribution_status'] = $contribution['contribution_status'];
......
......@@ -123,6 +123,27 @@ class api_v3_ParticipantPaymentTest extends CiviUnitTestCase {
$this->contributionDelete($contributionID);
}
/**
* Test getPaymentInfo() returns correct
* information of the participant payment
*/
public function testPaymentInfoForEvent() {
//Create Contribution & get contribution ID
$contributionID = $this->contributionCreate(array('contact_id' => $this->_contactID));
//Create Participant Payment record With Values
$params = array(
'participant_id' => $this->_participantID4,
'contribution_id' => $contributionID,
);
$this->callAPISuccess('participant_payment', 'create', $params);
//Check if participant payment is correctly retrieved.
$paymentInfo = CRM_Contribute_BAO_Contribution::getPaymentInfo($this->_participantID4, 'event');
$this->assertEquals('Completed', $paymentInfo['contribution_status']);
$this->assertEquals('100.00', $paymentInfo['total']);
}
///////////////// civicrm_participant_payment_create methods
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment