3 * Test Generated example of using contribution_page Submit API
4 * submit contribution page *
6 function contribution_page_submit_example(){
11 'billing_first_name' => 'Billy',
12 'billing_middle_name' => 'Goat',
13 'billing_last_name' => 'Gruff',
14 'email' => 'billy@goat.gruff',
15 'selectMembership' => array(
18 'payment_processor' => 1,
19 'credit_card_number' => '4111111111111111',
20 'credit_card_type' => 'Visa',
21 'credit_card_exp_date' => array(
27 'frequency_interval' => 1,
28 'frequency_unit' => 'month',
32 $result = civicrm_api3('contribution_page', 'Submit', $params);
34 catch (CiviCRM_API3_Exception
$e) {
36 $errorMessage = $e->getMessage();
37 $errorCode = $e->getErrorCode();
38 $errorData = $e->getExtraParams();
39 return array('error' => $errorMessage, 'error_code' => $errorCode, 'error_data' => $errorData);
46 * Function returns array of result expected from previous function
48 function contribution_page_submit_expectedresult(){
50 $expectedResult = array(
57 return $expectedResult;
62 * This example has been generated from the API test suite. The test that created it is called
64 * testSubmitMembershipPriceSetPaymentPaymentProcessorRecurDelayed and can be found in
65 * https://github.com/civicrm/civicrm-core/blob/master/tests/phpunit/api/v3/ContributionPageTest.php
67 * You can see the outcome of the API tests at
68 * https://test.civicrm.org/job/CiviCRM-master-git/
70 * To Learn about the API read
71 * http://wiki.civicrm.org/confluence/display/CRMDOC/Using+the+API
73 * Browse the api on your own site with the api explorer
74 * http://MYSITE.ORG/path/to/civicrm/api/explorer
76 * Read more about testing here
77 * http://wiki.civicrm.org/confluence/display/CRM/Testing
79 * API Standards documentation:
80 * http://wiki.civicrm.org/confluence/display/CRM/API+Architecture+Standards