From c4204541d0a197ee87128d7f8305e0db13d2d2a8 Mon Sep 17 00:00:00 2001 From: eileen Date: Mon, 7 Oct 2019 13:22:42 +0200 Subject: [PATCH] Accept trxn_id to Payment.get Alternative to #15166 (incorporates #15229 ) --- api/v3/Payment.php | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/api/v3/Payment.php b/api/v3/Payment.php index 4ac10c070fc8..4ec6647c22d3 100644 --- a/api/v3/Payment.php +++ b/api/v3/Payment.php @@ -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 = []; @@ -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, + ], ]; }