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 'selectMembership' => array(
17 'payment_processor' => 1,
18 'credit_card_number' => '4111111111111111',
19 'credit_card_type' => 'Visa',
20 'credit_card_exp_date' => array(
28 $result = civicrm_api3('contribution_page', 'Submit', $params);
30 catch (CiviCRM_API3_Exception
$e) {
32 $errorMessage = $e->getMessage();
33 $errorCode = $e->getErrorCode();
34 $errorData = $e->getExtraParams();
35 return array('error' => $errorMessage, 'error_code' => $errorCode, 'error_data' => $errorData);
42 * Function returns array of result expected from previous function
44 function contribution_page_submit_expectedresult(){
46 $expectedResult = array(
53 return $expectedResult;
58 * This example has been generated from the API test suite. The test that created it is called
60 * testSubmitMembershipBlockIsSeparatePaymentPaymentProcessor and can be found in
61 * https://github.com/civicrm/civicrm-core/blob/master/tests/phpunit/api/v3/ContributionPageTest.php
63 * You can see the outcome of the API tests at
64 * https://test.civicrm.org/job/CiviCRM-master-git/
66 * To Learn about the API read
67 * http://wiki.civicrm.org/confluence/display/CRMDOC/Using+the+API
69 * Browse the api on your own site with the api explorer
70 * http://MYSITE.ORG/path/to/civicrm/api/explorer
72 * Read more about testing here
73 * http://wiki.civicrm.org/confluence/display/CRM/Testing
75 * API Standards documentation:
76 * http://wiki.civicrm.org/confluence/display/CRM/API+Architecture+Standards