3da279757f7ce3d03d77b84461c04f3cbedc7230
3 * Test Generated example demonstrating the ContributionPage.create API.
8 function contribution_page_create_example() {
10 'title' => 'Test Contribution Page',
11 'financial_type_id' => 1,
13 'goal_amount' => 34567,
15 'is_monetary' => TRUE,
19 $result = civicrm_api3('ContributionPage', 'create', $params);
21 catch (CiviCRM_API3_Exception
$e) {
23 $errorMessage = $e->getMessage();
24 $errorCode = $e->getErrorCode();
25 $errorData = $e->getExtraParams();
27 'error' => $errorMessage,
28 'error_code' => $errorCode,
29 'error_data' => $errorData,
37 * Function returns array of result expected from previous function.
42 function contribution_page_create_expectedresult() {
44 $expectedResult = array(
52 'title' => 'Test Contribution Page',
54 'financial_type_id' => '1',
55 'payment_processor' => '',
56 'is_credit_card_only' => '',
59 'is_confirm_enabled' => '',
60 'recur_frequency_unit' => '',
61 'is_recur_interval' => '',
62 'is_recur_installments' => '',
63 'is_pay_later' => '1',
64 'pay_later_text' => '',
65 'pay_later_receipt' => '',
66 'is_partial_payment' => '',
67 'initial_amount_label' => '',
68 'initial_amount_help_text' => '',
69 'min_initial_amount' => '',
70 'is_allow_other_amount' => '',
71 'default_amount_id' => '',
74 'goal_amount' => '34567',
75 'thankyou_title' => '',
76 'thankyou_text' => '',
77 'thankyou_footer' => '',
78 'is_for_organization' => '',
79 'for_organization' => '',
80 'is_email_receipt' => '',
81 'receipt_from_name' => '',
82 'receipt_from_email' => '',
88 'amount_block_is_active' => '',
96 'is_billing_required' => '',
101 return $expectedResult;
105 * This example has been generated from the API test suite.
106 * The test that created it is called "testCreateContributionPage"
107 * and can be found at:
108 * https://github.com/civicrm/civicrm-core/blob/master/tests/phpunit/api/v3/ContributionPageTest.php
110 * You can see the outcome of the API tests at
111 * https://test.civicrm.org/job/CiviCRM-master-git/
113 * To Learn about the API read
114 * http://wiki.civicrm.org/confluence/display/CRMDOC/Using+the+API
116 * Browse the api on your own site with the api explorer
117 * http://MYSITE.ORG/path/to/civicrm/api
119 * Read more about testing here
120 * http://wiki.civicrm.org/confluence/display/CRM/Testing
122 * API Standards documentation:
123 * http://wiki.civicrm.org/confluence/display/CRM/API+Architecture+Standards