X-Git-Url: https://vcs.fsf.org/?a=blobdiff_plain;f=api%2Fv3%2Fexamples%2FParticipantPaymentDelete.php;h=b0a938ff2ca63bad0ffbdb2ac64b9ba5b382e054;hb=4d32d50b462d76a14faf7a6f732816ee9fe40ee6;hp=dbe31358733177d854bbe3e02994b2f06934cdb7;hpb=4d20ef52acecafc3c3aa0f22b8268e5468352022;p=civicrm-core.git diff --git a/api/v3/examples/ParticipantPaymentDelete.php b/api/v3/examples/ParticipantPaymentDelete.php index dbe3135873..b0a938ff2c 100644 --- a/api/v3/examples/ParticipantPaymentDelete.php +++ b/api/v3/examples/ParticipantPaymentDelete.php @@ -1,20 +1,28 @@ 1, - 'version' => 3, ); - $result = civicrm_api( 'participant_payment','delete',$params ); +try{ + $result = civicrm_api3('participant_payment', 'delete', $params); +} +catch (CiviCRM_API3_Exception $e) { + // handle error here + $errorMessage = $e->getMessage(); + $errorCode = $e->getErrorCode(); + $errorData = $e->getExtraParams(); + return array('error' => $errorMessage, 'error_code' => $errorCode, 'error_data' => $errorData); +} - return $result; +return $result; } -/* +/** * Function returns array of result expected from previous function */ function participant_payment_delete_expectedresult(){ @@ -26,7 +34,7 @@ function participant_payment_delete_expectedresult(){ 'values' => 1, ); - return $expectedResult ; + return $expectedResult; }