3 * Test Generated example demonstrating the ContributionRecur.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('ContributionRecur', 'create', $params);
23 catch (CiviCRM_API3_Exception
$e) {
25 $errorMessage = $e->getMessage();
26 $errorCode = $e->getErrorCode();
27 $errorData = $e->getExtraParams();
30 'error_message' => $errorMessage,
31 'error_code' => $errorCode,
32 'error_data' => $errorData,
40 * Function returns array of result expected from previous function.
45 function contribution_recur_create_expectedresult() {
47 $expectedResult = array(
58 'frequency_unit' => 'day',
59 'frequency_interval' => '1',
60 'installments' => '12',
61 'start_date' => '2013-07-29 00:00:00',
62 'create_date' => '20120130621222105',
63 'modified_date' => '2012-11-14 16:02:35',
67 'payment_token_id' => '',
70 'contribution_status_id' => '1',
73 'next_sched_contribution_date' => '',
74 'failure_count' => '',
75 'failure_retry_date' => '',
77 'payment_processor_id' => '',
78 'financial_type_id' => '',
79 'payment_instrument_id' => '',
81 'is_email_receipt' => '',
86 return $expectedResult;
90 * This example has been generated from the API test suite.
91 * The test that created it is called "testCreateContributionRecur"
92 * and can be found at:
93 * https://github.com/civicrm/civicrm-core/blob/master/tests/phpunit/api/v3/ContributionRecurTest.php
95 * You can see the outcome of the API tests at
96 * https://test.civicrm.org/job/CiviCRM-master-git/
98 * To Learn about the API read
99 * http://wiki.civicrm.org/confluence/display/CRMDOC/Using+the+API
101 * Browse the api on your own site with the api explorer
102 * http://MYSITE.ORG/path/to/civicrm/api
104 * Read more about testing here
105 * http://wiki.civicrm.org/confluence/display/CRM/Testing
107 * API Standards documentation:
108 * http://wiki.civicrm.org/confluence/display/CRM/API+Architecture+Standards