From cf33c6cb6e52160f3f7241970259c82331ca4146 Mon Sep 17 00:00:00 2001 From: Edsel Date: Mon, 18 Jan 2016 18:42:17 +0530 Subject: [PATCH] CRM-16259 CIVI-3 Fixed 0 rows fetched by payment API ---------------------------------------- * CRM-16259: Create Payment API https://issues.civicrm.org/jira/browse/CRM-16259 --- api/v3/Payment.php | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/api/v3/Payment.php b/api/v3/Payment.php index 5ff82cd492..f843ded7d2 100644 --- a/api/v3/Payment.php +++ b/api/v3/Payment.php @@ -42,6 +42,11 @@ */ function civicrm_api3_payment_get($params) { $financialTrxn = array(); + $limit = ''; + if (isset($params['options']) && CRM_Utils_Array::value('limit', $params['options'])) { + $limit = CRM_Utils_Array::value('limit', $params['options']); + } + $params['options']['limit'] = 0; $eft = civicrm_api3('EntityFinancialTrxn', 'get', $params); if (!empty($eft['values'])) { foreach ($eft['values'] as $efts) { @@ -52,6 +57,9 @@ function civicrm_api3_payment_get($params) { 'id' => array('IN' => $eftIds), 'is_payment' => 1, ); + if ($limit) { + $ftParams['options']['limit'] = $limit; + } $financialTrxn = civicrm_api3('FinancialTrxn', 'get', $ftParams); foreach ($financialTrxn['values'] as &$values) { $values['contribution_id'] = $map[$values['id']]; -- 2.25.1