4c9df79844e832e03dd1ee80f771c307bcca4614
4 single function to create contact w partipation & contribution. Note that in the
5 case of 'contribution' the 'create' is implied (api.contribution.create)
7 function participant_create_example(){
9 'contact_type' => 'Individual',
10 'display_name' => 'dlobo',
12 'api.participant' => array(
16 'format.only_id' => 1,
18 'api.contribution.create' => array(
19 'financial_type_id' => 1,
20 'total_amount' => 100,
21 'format.only_id' => 1,
23 'api.participant_payment.create' => array(
24 'contribution_id' => '$value.api.contribution.create',
25 'participant_id' => '$value.api.participant',
29 $result = civicrm_api( 'participant','create',$params );
35 * Function returns array of result expected from previous function
37 function participant_create_expectedresult(){
39 $expectedResult = array(
47 'contact_type' => 'Individual',
48 'contact_sub_type' => '',
55 'legal_identifier' => '',
56 'external_identifier' => '',
58 'display_name' => 'dlobo',
62 'preferred_communication_method' => '',
63 'preferred_language' => 'en_US',
64 'preferred_mail_format' => 'Both',
65 'hash' => '67eac7789eaee00',
72 'email_greeting_id' => '1',
73 'email_greeting_custom' => '',
74 'email_greeting_display' => '',
75 'postal_greeting_id' => '1',
76 'postal_greeting_custom' => '',
77 'postal_greeting_display' => '',
78 'addressee_id' => '1',
79 'addressee_custom' => '',
80 'addressee_display' => '',
85 'deceased_date' => '',
86 'household_name' => '',
87 'primary_contact_id' => '',
88 'organization_name' => '',
90 'user_unique_id' => '',
91 'created_date' => '20120130621222105',
92 'modified_date' => '2012-11-14 16:02:35',
93 'api.participant' => 4,
94 'api.contribution.create' => 1,
95 'api.participant_payment.create' => array(
103 'participant_id' => '4',
104 'contribution_id' => '1',
112 return $expectedResult ;
117 * This example has been generated from the API test suite. The test that created it is called
119 * testCreateParticipantWithPayment and can be found in
120 * http://svn.civicrm.org/civicrm/trunk/tests/phpunit/CiviTest/api/v3/ParticipantTest.php
122 * You can see the outcome of the API tests at
123 * http://tests.dev.civicrm.org/trunk/results-api_v3
125 * To Learn about the API read
126 * http://book.civicrm.org/developer/current/techniques/api/
128 * and review the wiki at
129 * http://wiki.civicrm.org/confluence/display/CRMDOC/CiviCRM+Public+APIs
131 * Read more about testing here
132 * http://wiki.civicrm.org/confluence/display/CRM/Testing
134 * API Standards documentation:
135 * http://wiki.civicrm.org/confluence/display/CRM/API+Architecture+Standards