3 * Test Generated example of using pledge create API.
9 function pledge_create_example() {
12 'pledge_create_date' => '20150115',
13 'start_date' => '20150115',
14 'scheduled_date' => '20150117',
16 'pledge_status_id' => '2',
17 'pledge_financial_type_id' => '1',
18 'pledge_original_installment_amount' => 20,
19 'frequency_interval' => 5,
20 'frequency_unit' => 'year',
21 'frequency_day' => 15,
27 $result = civicrm_api3('pledge', 'create', $params);
29 catch (CiviCRM_API3_Exception
$e) {
31 $errorMessage = $e->getMessage();
32 $errorCode = $e->getErrorCode();
33 $errorData = $e->getExtraParams();
35 'error' => $errorMessage,
36 'error_code' => $errorCode,
37 'error_data' => $errorData,
45 * Function returns array of result expected from previous function.
50 function pledge_create_expectedresult() {
52 $expectedResult = array(
61 'financial_type_id' => '1',
62 'contribution_page_id' => '',
64 'original_installment_amount' => '20',
66 'frequency_unit' => 'year',
67 'frequency_interval' => '5',
68 'frequency_day' => '15',
69 'installments' => '5',
70 'start_date' => '2013-07-29 00:00:00',
71 'create_date' => '20120130621222105',
72 'acknowledge_date' => '',
73 'modified_date' => '',
76 'max_reminders' => '',
77 'initial_reminder_day' => '',
78 'additional_reminder_day' => '',
86 return $expectedResult;
90 * This example has been generated from the API test suite.
91 * The test that created it is called
94 * https://github.com/civicrm/civicrm-core/blob/master/tests/phpunit/api/v3/PledgeTest.php
96 * You can see the outcome of the API tests at
97 * https://test.civicrm.org/job/CiviCRM-master-git/
99 * To Learn about the API read
100 * http://wiki.civicrm.org/confluence/display/CRMDOC/Using+the+API
102 * Browse the api on your own site with the api explorer
103 * http://MYSITE.ORG/path/to/civicrm/api
105 * Read more about testing here
106 * http://wiki.civicrm.org/confluence/display/CRM/Testing
108 * API Standards documentation:
109 * http://wiki.civicrm.org/confluence/display/CRM/API+Architecture+Standards