4 * Test Generated API Example.
5 * See bottom of this file for more detail.
9 * Test Generated example of using contribution_recur create API.
15 function contribution_recur_create_example() {
18 'installments' => '12',
19 'frequency_interval' => '1',
21 'contribution_status_id' => 1,
22 'start_date' => '2012-01-01 00:00:00',
24 'frequency_unit' => 'day',
28 $result = civicrm_api3('contribution_recur', 'create', $params);
30 catch (CiviCRM_API3_Exception
$e) {
32 $errorMessage = $e->getMessage();
33 $errorCode = $e->getErrorCode();
34 $errorData = $e->getExtraParams();
36 'error' => $errorMessage,
37 'error_code' => $errorCode,
38 'error_data' => $errorData,
46 * Function returns array of result expected from previous function.
51 function contribution_recur_create_expectedresult() {
53 $expectedResult = array(
64 'frequency_unit' => 'day',
65 'frequency_interval' => '1',
66 'installments' => '12',
67 'start_date' => '2013-07-29 00:00:00',
68 'create_date' => '20120130621222105',
69 'modified_date' => '',
75 'contribution_status_id' => '1',
78 'next_sched_contribution_date' => '',
79 'failure_count' => '',
80 'failure_retry_date' => '',
82 'payment_processor_id' => '',
83 'financial_type_id' => '',
84 'payment_instrument_id' => '',
86 'is_email_receipt' => '',
91 return $expectedResult;
95 * This example has been generated from the API test suite.
96 * The test that created it is called
97 * testCreateContributionRecur
99 * https://github.com/civicrm/civicrm-core/blob/master/tests/phpunit/api/v3/ContributionRecurTest.php
101 * You can see the outcome of the API tests at
102 * https://test.civicrm.org/job/CiviCRM-master-git/
104 * To Learn about the API read
105 * http://wiki.civicrm.org/confluence/display/CRMDOC/Using+the+API
107 * Browse the api on your own site with the api explorer
108 * http://MYSITE.ORG/path/to/civicrm/api/explorer
110 * Read more about testing here
111 * http://wiki.civicrm.org/confluence/display/CRM/Testing
113 * API Standards documentation:
114 * http://wiki.civicrm.org/confluence/display/CRM/API+Architecture+Standards