3 * Test Generated example of using pledge get API
6 function pledge_get_example(){
12 $result = civicrm_api3('pledge', 'get', $params);
14 catch (CiviCRM_API3_Exception
$e) {
16 $errorMessage = $e->getMessage();
17 $errorCode = $e->getErrorCode();
18 $errorData = $e->getExtraParams();
19 return array('error' => $errorMessage, 'error_code' => $errorCode, 'error_data' => $errorData);
26 * Function returns array of result expected from previous function
28 function pledge_get_expectedresult(){
30 $expectedResult = array(
38 'contact_type' => 'Individual',
39 'contact_sub_type' => '',
40 'sort_name' => 'Anderson, Anthony',
41 'display_name' => 'Mr. Anthony Anderson II',
43 'pledge_amount' => '100.00',
44 'pledge_create_date' => '2013-08-03 00:00:00',
45 'pledge_status' => 'Pending',
46 'pledge_total_paid' => '',
47 'pledge_next_pay_date' => '2013-08-05 00:00:00',
48 'pledge_next_pay_amount' => '20.00',
49 'pledge_outstanding_amount' => '',
50 'pledge_financial_type' => 'Donation',
51 'pledge_contribution_page_id' => '',
52 'pledge_frequency_interval' => '5',
53 'pledge_frequency_unit' => 'year',
54 'pledge_is_test' => 0,
55 'pledge_campaign_id' => '',
56 'pledge_currency' => 'USD',
62 return $expectedResult;
67 * This example has been generated from the API test suite. The test that created it is called
69 * testGetPledge and can be found in
70 * http://svn.civicrm.org/civicrm/trunk/tests/phpunit/CiviTest/api/v3/PledgeTest.php
72 * You can see the outcome of the API tests at
73 * http://tests.dev.civicrm.org/trunk/results-api_v3
75 * To Learn about the API read
76 * http://book.civicrm.org/developer/current/techniques/api/
78 * and review the wiki at
79 * http://wiki.civicrm.org/confluence/display/CRMDOC/CiviCRM+Public+APIs
81 * Read more about testing here
82 * http://wiki.civicrm.org/confluence/display/CRM/Testing
84 * API Standards documentation:
85 * http://wiki.civicrm.org/confluence/display/CRM/API+Architecture+Standards