3 * Test Generated example of using contribution_page create API
6 function contribution_page_create_example(){
8 'title' => 'Test Contribution Page',
9 'financial_type_id' => 1,
11 'goal_amount' => 34567,
15 $result = civicrm_api3('contribution_page', 'create', $params);
17 catch (CiviCRM_API3_Exception
$e) {
19 $errorMessage = $e->getMessage();
20 $errorCode = $e->getErrorCode();
21 $errorData = $e->getExtraParams();
22 return array('error' => $errorMessage, 'error_code' => $errorCode, 'error_data' => $errorData);
29 * Function returns array of result expected from previous function
31 function contribution_page_create_expectedresult(){
33 $expectedResult = array(
41 'title' => 'Test Contribution Page',
43 'financial_type_id' => '1',
44 'payment_processor' => '',
45 'is_credit_card_only' => '',
48 'is_confirm_enabled' => '',
49 'recur_frequency_unit' => '',
50 'is_recur_interval' => '',
51 'is_recur_installments' => '',
53 'pay_later_text' => '',
54 'pay_later_receipt' => '',
55 'is_partial_payment' => '',
56 'initial_amount_label' => '',
57 'initial_amount_help_text' => '',
58 'min_initial_amount' => '',
59 'is_allow_other_amount' => '',
60 'default_amount_id' => '',
63 'goal_amount' => '34567',
64 'thankyou_title' => '',
65 'thankyou_text' => '',
66 'thankyou_footer' => '',
67 'is_for_organization' => '',
68 'for_organization' => '',
69 'is_email_receipt' => '',
70 'receipt_from_name' => '',
71 'receipt_from_email' => '',
77 'amount_block_is_active' => '',
78 'honor_block_is_active' => '',
79 'honor_block_title' => '',
80 'honor_block_text' => '',
92 return $expectedResult;
97 * This example has been generated from the API test suite. The test that created it is called
99 * testCreateContributionPage and can be found in
100 * https://github.com/civicrm/civicrm-core/blob/master/tests/phpunit/api/v3/ContributionPageTest.php
102 * You can see the outcome of the API tests at
103 * https://test.civicrm.org/job/CiviCRM-master-git/
105 * To Learn about the API read
106 * http://wiki.civicrm.org/confluence/display/CRMDOC/Using+the+API
108 * Browse the api on your own site with the api explorer
109 * http://MYSITE.ORG/path/to/civicrm/api/explorer
111 * Read more about testing here
112 * http://wiki.civicrm.org/confluence/display/CRM/Testing
114 * API Standards documentation:
115 * http://wiki.civicrm.org/confluence/display/CRM/API+Architecture+Standards