3 * Test Generated example of using contribution_recur create API
6 function contribution_recur_create_example(){
9 'installments' => '12',
10 'frequency_interval' => '1',
12 'contribution_status_id' => 1,
13 'start_date' => '2012-01-01 00:00:00',
15 'frequency_unit' => 'day',
19 $result = civicrm_api3('contribution_recur', 'create', $params);
21 catch (CiviCRM_API3_Exception
$e) {
23 $errorMessage = $e->getMessage();
24 $errorCode = $e->getErrorCode();
25 $errorData = $e->getExtraParams();
26 return array('error' => $errorMessage, 'error_code' => $errorCode, 'error_data' => $errorData);
33 * Function returns array of result expected from previous function
35 function contribution_recur_create_expectedresult(){
37 $expectedResult = array(
48 'frequency_unit' => 'day',
49 'frequency_interval' => '1',
50 'installments' => '12',
51 'start_date' => '2013-07-29 00:00:00',
52 'create_date' => '20120130621222105',
53 'modified_date' => '',
59 'contribution_status_id' => '1',
62 'next_sched_contribution_date' => '',
63 'failure_count' => '',
64 'failure_retry_date' => '',
66 'payment_processor_id' => '',
67 'financial_type_id' => '',
68 'payment_instrument_id' => '',
70 'is_email_receipt' => '',
75 return $expectedResult;
80 * This example has been generated from the API test suite. The test that created it is called
82 * testCreateContributionRecur and can be found in
83 * https://github.com/civicrm/civicrm-core/blob/master/tests/phpunit/api/v3/ContributionRecurTest.php
85 * You can see the outcome of the API tests at
86 * https://test.civicrm.org/job/CiviCRM-master-git/
88 * To Learn about the API read
89 * http://wiki.civicrm.org/confluence/display/CRMDOC/Using+the+API
91 * Browse the api on your own site with the api explorer
92 * http://MYSITE.ORG/path/to/civicrm/api/explorer
94 * Read more about testing here
95 * http://wiki.civicrm.org/confluence/display/CRM/Testing
97 * API Standards documentation:
98 * http://wiki.civicrm.org/confluence/display/CRM/API+Architecture+Standards