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();
22 'error' => $errorMessage,
23 'error_code' => $errorCode,
24 'error_data' => $errorData,
32 * Function returns array of result expected from previous function.
37 function order_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' => '0.00',
55 'total_amount' => '100.00',
56 'fee_amount' => '0.00',
57 'net_amount' => '100.00',
61 'cancel_reason' => '',
63 'thankyou_date' => '',
64 'contribution_source' => '',
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',
85 'contribution_campaign_title' => '',
86 'contribution_note' => '',
87 'contribution_batch' => '',
88 'contribution_status' => 'Completed',
89 'payment_instrument' => 'Check',
90 'payment_instrument_id' => '4',
91 'instrument_id' => '4',
92 'contribution_check_number' => '',
94 'contribution_type_id' => '1',
95 'line_items' => array(
98 'entity_table' => 'civicrm_contribution',
100 'contribution_id' => '1',
101 'price_field_id' => '1',
102 'label' => 'Contribution Amount',
104 'unit_price' => '100.00',
105 'line_total' => '100.00',
106 'price_field_value_id' => '1',
107 'financial_type_id' => '1',
108 'deductible_amount' => '0.00',
115 return $expectedResult;
119 * This example has been generated from the API test suite.
120 * The test that created it is called "testGetOrder"
121 * and can be found at:
122 * https://github.com/civicrm/civicrm-core/blob/master/tests/phpunit/api/v3/OrderTest.php
124 * You can see the outcome of the API tests at
125 * https://test.civicrm.org/job/CiviCRM-master-git/
127 * To Learn about the API read
128 * http://wiki.civicrm.org/confluence/display/CRMDOC/Using+the+API
130 * Browse the api on your own site with the api explorer
131 * http://MYSITE.ORG/path/to/civicrm/api
133 * Read more about testing here
134 * http://wiki.civicrm.org/confluence/display/CRM/Testing
136 * API Standards documentation:
137 * http://wiki.civicrm.org/confluence/display/CRM/API+Architecture+Standards