3 * Test Generated example demonstrating the Order.get API.
8 function order_get_example() {
10 'contribution_id' => 1,
14 $result = civicrm_api3('Order', 'get', $params);
16 catch (CiviCRM_API3_Exception
$e) {
18 $errorMessage = $e->getMessage();
19 $errorCode = $e->getErrorCode();
20 $errorData = $e->getExtraParams();
23 'error_message' => $errorMessage,
24 'error_code' => $errorCode,
25 'error_data' => $errorData,
33 * Function returns array of result expected from previous function.
38 function order_get_expectedresult() {
40 $expectedResult = array(
48 'contact_type' => 'Individual',
49 'contact_sub_type' => '',
50 'sort_name' => 'Anderson, Anthony',
51 'display_name' => 'Mr. Anthony Anderson II',
52 'contribution_id' => '1',
54 'receive_date' => '2010-01-20 00:00:00',
55 'non_deductible_amount' => '0.00',
56 'total_amount' => '100.00',
57 'fee_amount' => '0.00',
58 'net_amount' => '100.00',
62 'cancel_reason' => '',
64 'thankyou_date' => '',
65 'contribution_source' => '',
67 'contribution_recur_id' => '',
70 'contribution_status_id' => '1',
71 'contribution_check_number' => '',
72 'contribution_campaign_id' => '',
73 'financial_type_id' => '1',
74 'financial_type' => 'Donation',
78 'contribution_product_id' => '',
79 'product_option' => '',
80 'fulfilled_date' => '',
81 'contribution_start_date' => '',
82 'contribution_end_date' => '',
83 'financial_account_id' => '1',
84 'accounting_code' => '4200',
86 'contribution_campaign_title' => '',
87 'contribution_note' => '',
88 'contribution_batch' => '',
89 'contribution_status' => 'Completed',
90 'payment_instrument' => 'Check',
91 'payment_instrument_id' => '4',
92 'instrument_id' => '4',
95 'contribution_type_id' => '1',
96 'line_items' => array(
99 'entity_table' => 'civicrm_contribution',
101 'contribution_id' => '1',
102 'price_field_id' => '1',
103 'label' => 'Contribution Amount',
105 'unit_price' => '100.00',
106 'line_total' => '100.00',
107 'price_field_value_id' => '1',
108 'financial_type_id' => '1',
109 'non_deductible_amount' => '0.00',
110 'contribution_type_id' => '1',
117 return $expectedResult;
121 * This example has been generated from the API test suite.
122 * The test that created it is called "testGetOrder"
123 * and can be found at:
124 * https://github.com/civicrm/civicrm-core/blob/master/tests/phpunit/api/v3/OrderTest.php
126 * You can see the outcome of the API tests at
127 * https://test.civicrm.org/job/CiviCRM-master-git/
129 * To Learn about the API read
130 * http://wiki.civicrm.org/confluence/display/CRMDOC/Using+the+API
132 * Browse the api on your own site with the api explorer
133 * http://MYSITE.ORG/path/to/civicrm/api
135 * Read more about testing here
136 * http://wiki.civicrm.org/confluence/display/CRM/Testing
138 * API Standards documentation:
139 * http://wiki.civicrm.org/confluence/display/CRM/API+Architecture+Standards