Merge pull request #1046 from colemanw/showHide
[civicrm-core.git] / api / v3 / examples / ContributionPageCreate.php
1 <?php
2
3 /*
4
5 */
6 function contribution_page_create_example(){
7 $params = array(
8 'version' => 3,
9 'title' => 'Test Contribution Page',
10 'financial_type_id' => 1,
11 'currency' => 'NZD',
12 'goal_amount' => 34567,
13 );
14
15 $result = civicrm_api( 'contribution_page','create',$params );
16
17 return $result;
18 }
19
20 /*
21 * Function returns array of result expected from previous function
22 */
23 function contribution_page_create_expectedresult(){
24
25 $expectedResult = array(
26 'is_error' => 0,
27 'version' => 3,
28 'count' => 1,
29 'id' => 1,
30 'values' => array(
31 '1' => array(
32 'id' => '1',
33 'title' => 'Test Contribution Page',
34 'intro_text' => '',
35 'financial_type_id' => '1',
36 'payment_processor' => '',
37 'is_credit_card_only' => '',
38 'is_monetary' => '',
39 'is_recur' => '',
40 'is_confirm_enabled' => '',
41 'recur_frequency_unit' => '',
42 'is_recur_interval' => '',
43 'is_recur_installments' => '',
44 'is_pay_later' => '',
45 'pay_later_text' => '',
46 'pay_later_receipt' => '',
47 'is_partial_payment' => '',
48 'initial_amount_label' => '',
49 'initial_amount_help_text' => '',
50 'min_initial_amount' => '',
51 'is_allow_other_amount' => '',
52 'default_amount_id' => '',
53 'min_amount' => '',
54 'max_amount' => '',
55 'goal_amount' => '34567',
56 'thankyou_title' => '',
57 'thankyou_text' => '',
58 'thankyou_footer' => '',
59 'is_for_organization' => '',
60 'for_organization' => '',
61 'is_email_receipt' => '',
62 'receipt_from_name' => '',
63 'receipt_from_email' => '',
64 'cc_receipt' => '',
65 'bcc_receipt' => '',
66 'receipt_text' => '',
67 'is_active' => '',
68 'footer_text' => '',
69 'amount_block_is_active' => '',
70 'honor_block_is_active' => '',
71 'honor_block_title' => '',
72 'honor_block_text' => '',
73 'start_date' => '',
74 'end_date' => '',
75 'created_id' => '',
76 'created_date' => '20120130621222105',
77 'currency' => 'NZD',
78 'campaign_id' => '',
79 'is_share' => '',
80 ),
81 ),
82 );
83
84 return $expectedResult ;
85 }
86
87
88 /*
89 * This example has been generated from the API test suite. The test that created it is called
90 *
91 * testCreateContributionPage and can be found in
92 * http://svn.civicrm.org/civicrm/trunk/tests/phpunit/CiviTest/api/v3/ContributionPageTest.php
93 *
94 * You can see the outcome of the API tests at
95 * http://tests.dev.civicrm.org/trunk/results-api_v3
96 *
97 * To Learn about the API read
98 * http://book.civicrm.org/developer/current/techniques/api/
99 *
100 * and review the wiki at
101 * http://wiki.civicrm.org/confluence/display/CRMDOC/CiviCRM+Public+APIs
102 *
103 * Read more about testing here
104 * http://wiki.civicrm.org/confluence/display/CRM/Testing
105 *
106 * API Standards documentation:
107 * http://wiki.civicrm.org/confluence/display/CRM/API+Architecture+Standards
108 */