From 7466454a7c72ee6fff8e5a1331a8fa5f70691269 Mon Sep 17 00:00:00 2001 From: Edsel Date: Wed, 27 Jan 2016 18:23:53 +0530 Subject: [PATCH] CRM-16259 CIVI-3 Switched to using API exception instead of API create error ---------------------------------------- * CRM-16259: Create Payment API https://issues.civicrm.org/jira/browse/CRM-16259 --- api/v3/Payment.php | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/api/v3/Payment.php b/api/v3/Payment.php index aec343105d..6f68fd8b34 100644 --- a/api/v3/Payment.php +++ b/api/v3/Payment.php @@ -42,7 +42,7 @@ */ function civicrm_api3_payment_get($params) { if (!CRM_Core_Permission::check('access CiviContribute')) { - return civicrm_api3_create_error('You do not have permission to access this api'); + throw new API_Exception('You do not have permission to access this api'); } $financialTrxn = array(); $limit = ''; @@ -89,7 +89,7 @@ function civicrm_api3_payment_get($params) { */ function civicrm_api3_payment_delete(&$params) { if (!CRM_Core_Permission::check('access CiviContribute') && !CRM_Core_Permission::check('delete in CiviContribute')) { - return civicrm_api3_create_error('You do not have permission to access this api'); + throw new API_Exception('You do not have permission to access this api'); } return civicrm_api3('FinancialTrxn', 'delete', $params); } @@ -106,7 +106,7 @@ function civicrm_api3_payment_delete(&$params) { */ function civicrm_api3_payment_cancel(&$params) { if (!CRM_Core_Permission::check('access CiviContribute') && !CRM_Core_Permission::check('edit contributions')) { - return civicrm_api3_create_error('You do not have permission to access this api'); + throw new API_Exception('You do not have permission to access this api'); } $eftParams = array( 'entity_table' => 'civicrm_contribution', @@ -136,7 +136,7 @@ function civicrm_api3_payment_cancel(&$params) { */ function civicrm_api3_payment_create(&$params) { if (!CRM_Core_Permission::check('access CiviContribute') && !CRM_Core_Permission::check('edit contributions')) { - return civicrm_api3_create_error('You do not have permission to access this api'); + throw new API_Exception('You do not have permission to access this api'); } // Check if it is an update if (CRM_Utils_Array::value('id', $params)) { -- 2.25.1