4 * Test Generated API Example.
5 * See bottom of this file for more detail.
9 * Test Generated example of using tax_contribution_page create API.
15 function tax_contribution_page_create_example() {
18 'receive_date' => '20120511',
19 'total_amount' => '100',
20 'financial_type_id' => 11,
21 'contribution_page_id' => 1,
23 'invoice_id' => 67890,
25 'contribution_status_id' => 2,
29 $result = civicrm_api3('tax_contribution_page', 'create', $params);
31 catch (CiviCRM_API3_Exception
$e) {
33 $errorMessage = $e->getMessage();
34 $errorCode = $e->getErrorCode();
35 $errorData = $e->getExtraParams();
37 'error' => $errorMessage,
38 'error_code' => $errorCode,
39 'error_data' => $errorData,
47 * Function returns array of result expected from previous function.
52 function tax_contribution_page_create_expectedresult() {
54 $expectedResult = array(
63 'financial_type_id' => '11',
64 'contribution_page_id' => '1',
65 'payment_instrument_id' => '4',
66 'receive_date' => '20120511000000',
67 'non_deductible_amount' => '',
68 'total_amount' => '120',
70 'net_amount' => '120',
72 'invoice_id' => '67890',
75 'cancel_reason' => '',
77 'thankyou_date' => '',
80 'contribution_recur_id' => '',
83 'contribution_status_id' => '2',
87 'creditnote_id' => '',
89 'contribution_type_id' => '11',
94 return $expectedResult;
98 * This example has been generated from the API test suite.
99 * The test that created it is called
100 * testCreateContributionPendingOnline
101 * and can be found in
102 * https://github.com/civicrm/civicrm-core/blob/master/tests/phpunit/api/v3/TaxContributionPageTest.php
104 * You can see the outcome of the API tests at
105 * https://test.civicrm.org/job/CiviCRM-master-git/
107 * To Learn about the API read
108 * http://wiki.civicrm.org/confluence/display/CRMDOC/Using+the+API
110 * Browse the api on your own site with the api explorer
111 * http://MYSITE.ORG/path/to/civicrm/api/explorer
113 * Read more about testing here
114 * http://wiki.civicrm.org/confluence/display/CRM/Testing
116 * API Standards documentation:
117 * http://wiki.civicrm.org/confluence/display/CRM/API+Architecture+Standards