Skip to content

Commit

Permalink
Accept trxn_id to Payment.get
Browse files Browse the repository at this point in the history
Alternative to #15166 (incorporates #15229 )
  • Loading branch information
eileenmcnaughton committed Oct 7, 2019
1 parent 6045f2b commit c420454
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions api/v3/Payment.php
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,9 @@ function civicrm_api3_payment_get($params) {
$limit = CRM_Utils_Array::value('limit', $params['options']);
}
$params['options']['limit'] = 0;
if (isset($params['trxn_id'])) {
$params['financial_trxn_id.trxn_id'] = $params['trxn_id'];
}
$eft = civicrm_api3('EntityFinancialTrxn', 'get', $params);
if (!empty($eft['values'])) {
$eftIds = [];
Expand Down Expand Up @@ -210,6 +213,10 @@ function _civicrm_api3_payment_get_spec(&$params) {
'type' => CRM_Utils_Type::T_INT,
'api.aliases' => ['contribution_id'],
],
'trxn_id' => [
'title' => 'Transaction ID',
'type' => CRM_Utils_Type::T_STRING,
],
];
}

Expand Down

0 comments on commit c420454

Please sign in to comment.