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() {
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',
65 'cancel_reason' => '',
68 'payment_token_id' => '',
71 'contribution_status_id' => '1',
74 'next_sched_contribution_date' => '',
75 'failure_count' => '',
76 'failure_retry_date' => '',
78 'payment_processor_id' => '',
79 'financial_type_id' => '',
80 'payment_instrument_id' => '',
82 'is_email_receipt' => '',
87 return $expectedResult;
91 * This example has been generated from the API test suite.
92 * The test that created it is called "testCreateContributionRecur"
93 * and can be found at:
94 * https://github.com/civicrm/civicrm-core/blob/master/tests/phpunit/api/v3/ContributionRecurTest.php
96 * You can see the outcome of the API tests at
97 * https://test.civicrm.org/job/CiviCRM-Core-Matrix/
99 * To Learn about the API read
100 * https://docs.civicrm.org/dev/en/latest/api/
102 * Browse the API on your own site with the API Explorer. It is in the main
103 * CiviCRM menu, under: Support > Development > API Explorer.
105 * Read more about testing here
106 * https://docs.civicrm.org/dev/en/latest/testing/
108 * API Standards documentation:
109 * https://docs.civicrm.org/dev/en/latest/framework/api-architecture/