4 Demonstrates creating contribution with Note Entity
6 function contribution_create_example(){
9 'receive_date' => '2012-01-01',
10 'total_amount' => '100',
11 'financial_type_id' => 1,
12 'payment_instrument_id' => 1,
13 'non_deductible_amount' => '10',
17 'invoice_id' => 67890,
19 'contribution_status_id' => 1,
21 'note' => 'my contribution note',
24 $result = civicrm_api( 'contribution','create',$params );
30 * Function returns array of result expected from previous function
32 function contribution_create_expectedresult(){
34 $expectedResult = array(
43 'financial_type_id' => '1',
44 'contribution_page_id' => '',
45 'payment_instrument_id' => '1',
46 'receive_date' => '20120101000000',
47 'non_deductible_amount' => '10',
48 'total_amount' => '100',
52 'invoice_id' => '67890',
55 'cancel_reason' => '',
57 'thankyou_date' => '',
60 'contribution_recur_id' => '',
61 'honor_contact_id' => '',
64 'contribution_status_id' => '1',
65 'honor_type_id' => '',
67 'check_number' => 'null',
69 'contribution_type_id' => '1',
74 return $expectedResult ;
79 * This example has been generated from the API test suite. The test that created it is called
81 * testCreateContributionWithNote and can be found in
82 * http://svn.civicrm.org/civicrm/trunk/tests/phpunit/CiviTest/api/v3/ContributionTest.php
84 * You can see the outcome of the API tests at
85 * http://tests.dev.civicrm.org/trunk/results-api_v3
87 * To Learn about the API read
88 * http://book.civicrm.org/developer/current/techniques/api/
90 * and review the wiki at
91 * http://wiki.civicrm.org/confluence/display/CRMDOC/CiviCRM+Public+APIs
93 * Read more about testing here
94 * http://wiki.civicrm.org/confluence/display/CRM/Testing
96 * API Standards documentation:
97 * http://wiki.civicrm.org/confluence/display/CRM/API+Architecture+Standards