Skip to content
Snippets Groups Projects
Unverified Commit fbc5b5bf authored by mattwire's avatar mattwire Committed by GitHub
Browse files

Merge pull request #14452 from eileenmcnaughton/payment_activity

Create payment activity when creating a payment via the api, test
parents 0da77514 8d54448e
Branches
Tags
No related merge requests found
......@@ -102,7 +102,6 @@ class CRM_Financial_BAO_Payment {
}
elseif ($params['total_amount'] < 0) {
$trxn = self::recordRefundPayment($params['contribution_id'], $params, FALSE);
CRM_Contribute_BAO_Contribution::recordPaymentActivity($params['contribution_id'], CRM_Utils_Array::value('participant_id', $params), $params['total_amount'], $trxn->currency, $trxn->trxn_date);
}
if ($isPaymentCompletesContribution) {
......@@ -133,7 +132,7 @@ class CRM_Financial_BAO_Payment {
]
);
}
CRM_Contribute_BAO_Contribution::recordPaymentActivity($params['contribution_id'], CRM_Utils_Array::value('participant_id', $params), $params['total_amount'], $trxn->currency, $trxn->trxn_date);
return $trxn;
}
......
......@@ -633,7 +633,9 @@ class api_v3_PaymentTest extends CiviUnitTestCase {
}
/**
* Test create payment api for paylater contribution with partial payment.
* Test create payment api for pay later contribution with partial payment.
*
* @throws \Exception
*/
public function testCreatePaymentPayLaterPartialPayment() {
$this->createLoggedInUser();
......@@ -717,7 +719,7 @@ class api_v3_PaymentTest extends CiviUnitTestCase {
'id' => $contribution['id'],
]);
$this->callAPISuccess('OptionValue', 'get', ['name' => 'Completed', 'option_group_id' => 'contribution_status', 'api.OptionValue.create' => ['label' => 'Completed']]);
$this->callAPISuccessGetCount('Activity', ['target_contact_id' => $this->_individualId, 'activity_type_id' => 'Payment'], 2);
}
/**
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment