Merge branch 'crm-13089-CRM_Core_BAO_CustomField_overrides_name' of git://github...
[civicrm-core.git] / api / v3 / examples / ParticipantPaymentDelete.php
index dbe31358733177d854bbe3e02994b2f06934cdb7..b0a938ff2ca63bad0ffbdb2ac64b9ba5b382e054 100644 (file)
@@ -1,20 +1,28 @@
 <?php
-
-/*
+/**
+ * Test Generated example of using participant_payment delete API
+ * *
  */
 function participant_payment_delete_example(){
 $params = array(
   'id' => 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;
 }