3 * Test Generated example of using contribution_recur create API.
8 function contribution_recur_create_example() {
11 'installments' => '12',
12 'frequency_interval' => '1',
14 'contribution_status_id' => 1,
15 'start_date' => '2012-01-01 00:00:00',
17 'frequency_unit' => 'day',
21 $result = civicrm_api3('contribution_recur', 'create', $params);
23 catch (CiviCRM_API3_Exception
$e) {
25 $errorMessage = $e->getMessage();
26 $errorCode = $e->getErrorCode();
27 $errorData = $e->getExtraParams();
29 'error' => $errorMessage,
30 'error_code' => $errorCode,
31 'error_data' => $errorData,
39 * Function returns array of result expected from previous function.
44 function contribution_recur_create_expectedresult() {
46 $expectedResult = array(
57 'frequency_unit' => 'day',
58 'frequency_interval' => '1',
59 'installments' => '12',
60 'start_date' => '2013-07-29 00:00:00',
61 'create_date' => '20120130621222105',
62 'modified_date' => '',
68 'contribution_status_id' => '1',
71 'next_sched_contribution_date' => '',
72 'failure_count' => '',
73 'failure_retry_date' => '',
75 'payment_processor_id' => '',
76 'financial_type_id' => '',
77 'payment_instrument_id' => '',
79 'is_email_receipt' => '',
84 return $expectedResult;
88 * This example has been generated from the API test suite.
89 * The test that created it is called
90 * testCreateContributionRecur
92 * https://github.com/civicrm/civicrm-core/blob/master/tests/phpunit/api/v3/ContributionRecurTest.php
94 * You can see the outcome of the API tests at
95 * https://test.civicrm.org/job/CiviCRM-master-git/
97 * To Learn about the API read
98 * http://wiki.civicrm.org/confluence/display/CRMDOC/Using+the+API
100 * Browse the api on your own site with the api explorer
101 * http://MYSITE.ORG/path/to/civicrm/api
103 * Read more about testing here
104 * http://wiki.civicrm.org/confluence/display/CRM/Testing
106 * API Standards documentation:
107 * http://wiki.civicrm.org/confluence/display/CRM/API+Architecture+Standards