3649403beaa74b45d8ac2445d60e2b0e523b7187
3 * Test Generated example demonstrating the Contribution.get API.
8 function contribution_get_example() {
10 'contribution_id' => 1,
14 $result = civicrm_api3('Contribution', 'get', $params);
16 catch (CiviCRM_API3_Exception
$e) {
18 $errorMessage = $e->getMessage();
19 $errorCode = $e->getErrorCode();
20 $errorData = $e->getExtraParams();
22 'error' => $errorMessage,
23 'error_code' => $errorCode,
24 'error_data' => $errorData,
32 * Function returns array of result expected from previous function.
37 function contribution_get_expectedresult() {
39 $expectedResult = array(
47 'contact_type' => 'Individual',
48 'contact_sub_type' => '',
49 'sort_name' => 'Anderson, Anthony',
50 'display_name' => 'Mr. Anthony Anderson II',
51 'contribution_id' => '1',
53 'receive_date' => '2010-01-20 00:00:00',
54 'non_deductible_amount' => '10.00',
55 'total_amount' => '100.00',
56 'fee_amount' => '5.00',
57 'net_amount' => '95.00',
59 'invoice_id' => '78910',
61 'cancel_reason' => '',
63 'thankyou_date' => '',
64 'contribution_source' => 'SSF',
68 'contribution_status_id' => '1',
70 'contribution_campaign_id' => '',
71 'financial_type_id' => '1',
72 'financial_type' => 'Donation',
76 'contribution_product_id' => '',
77 'product_option' => '',
78 'fulfilled_date' => '',
79 'contribution_start_date' => '',
80 'contribution_end_date' => '',
81 'contribution_recur_id' => '',
82 'financial_account_id' => '1',
83 'accounting_code' => '4200',
84 'contribution_note' => '',
85 'contribution_batch' => '',
86 'contribution_status' => 'Completed',
87 'payment_instrument' => 'Check',
88 'payment_instrument_id' => '4',
89 'instrument_id' => '4',
90 'contribution_check_number' => '',
92 'contribution_type_id' => '1',
97 return $expectedResult;
101 * This example has been generated from the API test suite.
102 * The test that created it is called "testGetContributionLegacyBehaviour"
103 * and can be found at:
104 * https://github.com/civicrm/civicrm-core/blob/master/tests/phpunit/api/v3/ContributionTest.php
106 * You can see the outcome of the API tests at
107 * https://test.civicrm.org/job/CiviCRM-master-git/
109 * To Learn about the API read
110 * http://wiki.civicrm.org/confluence/display/CRMDOC/Using+the+API
112 * Browse the api on your own site with the api explorer
113 * http://MYSITE.ORG/path/to/civicrm/api
115 * Read more about testing here
116 * http://wiki.civicrm.org/confluence/display/CRM/Testing
118 * API Standards documentation:
119 * http://wiki.civicrm.org/confluence/display/CRM/API+Architecture+Standards