* API result array
*/
function order_get_example() {
- $params = array(
+ $params = [
'contribution_id' => 1,
- );
+ ];
try{
$result = civicrm_api3('Order', 'get', $params);
$errorMessage = $e->getMessage();
$errorCode = $e->getErrorCode();
$errorData = $e->getExtraParams();
- return array(
+ return [
'is_error' => 1,
'error_message' => $errorMessage,
'error_code' => $errorCode,
'error_data' => $errorData,
- );
+ ];
}
return $result;
*/
function order_get_expectedresult() {
- $expectedResult = array(
+ $expectedResult = [
'is_error' => 0,
'version' => 3,
'count' => 1,
'id' => 1,
- 'values' => array(
- '1' => array(
+ 'values' => [
+ '1' => [
'contact_id' => '3',
'contact_type' => 'Individual',
'contact_sub_type' => '',
'thankyou_date' => '',
'contribution_source' => '',
'amount_level' => '',
+ 'contribution_recur_id' => '',
'is_test' => 0,
'is_pay_later' => 0,
'contribution_status_id' => '1',
- 'check_number' => '',
+ 'contribution_check_number' => '',
'contribution_campaign_id' => '',
'financial_type_id' => '1',
'financial_type' => 'Donation',
'fulfilled_date' => '',
'contribution_start_date' => '',
'contribution_end_date' => '',
- 'contribution_recur_id' => '',
'financial_account_id' => '1',
'accounting_code' => '4200',
'campaign_id' => '',
'payment_instrument' => 'Check',
'payment_instrument_id' => '4',
'instrument_id' => '4',
- 'contribution_check_number' => '',
+ 'check_number' => '',
'id' => '1',
'contribution_type_id' => '1',
- 'line_items' => array(
- '0' => array(
+ 'line_items' => [
+ '0' => [
'id' => '1',
'entity_table' => 'civicrm_contribution',
'entity_id' => '1',
'line_total' => '100.00',
'price_field_value_id' => '1',
'financial_type_id' => '1',
- 'deductible_amount' => '0.00',
- ),
- ),
- ),
- ),
- );
+ 'non_deductible_amount' => '0.00',
+ 'contribution_type_id' => '1',
+ ],
+ ],
+ ],
+ ],
+ ];
return $expectedResult;
}