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,
13 'is_monetary' => true,
17 $result = civicrm_api3('contribution_page', 'create', $params);
19 catch (CiviCRM_API3_Exception
$e) {
21 $errorMessage = $e->getMessage();
22 $errorCode = $e->getErrorCode();
23 $errorData = $e->getExtraParams();
24 return array('error' => $errorMessage, 'error_code' => $errorCode, 'error_data' => $errorData);
31 * Function returns array of result expected from previous function
33 function contribution_page_create_expectedresult(){
35 $expectedResult = array(
43 'title' => 'Test Contribution Page',
45 'financial_type_id' => '1',
46 'payment_processor' => '',
47 'is_credit_card_only' => '',
50 'is_confirm_enabled' => '',
51 'recur_frequency_unit' => '',
52 'is_recur_interval' => '',
53 'is_recur_installments' => '',
54 'is_pay_later' => '1',
55 'pay_later_text' => '',
56 'pay_later_receipt' => '',
57 'is_partial_payment' => '',
58 'initial_amount_label' => '',
59 'initial_amount_help_text' => '',
60 'min_initial_amount' => '',
61 'is_allow_other_amount' => '',
62 'default_amount_id' => '',
65 'goal_amount' => '34567',
66 'thankyou_title' => '',
67 'thankyou_text' => '',
68 'thankyou_footer' => '',
69 'is_for_organization' => '',
70 'for_organization' => '',
71 'is_email_receipt' => '',
72 'receipt_from_name' => '',
73 'receipt_from_email' => '',
79 'amount_block_is_active' => '',
87 'is_billing_required' => '',
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