projects
/
civicrm-core.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Merge pull request #9765 from monishdeb/CRM-19938
[civicrm-core.git]
/
api
/
v3
/
examples
/
Contribution
/
ContributionCreateWithSoftCreditDefaults.php
diff --git
a/api/v3/examples/Contribution/ContributionCreateWithSoftCreditDefaults.php
b/api/v3/examples/Contribution/ContributionCreateWithSoftCreditDefaults.php
index e7a8599e1812bb67f22f1c9625dac0c247098441..8d7126cb897de7c0f5218e7f9f9b630623beca52 100644
(file)
--- a/
api/v3/examples/Contribution/ContributionCreateWithSoftCreditDefaults.php
+++ b/
api/v3/examples/Contribution/ContributionCreateWithSoftCreditDefaults.php
@@
-1,15
+1,15
@@
<?php
/**
<?php
/**
- * Test Generated example
of using contribution
create API.
+ * Test Generated example
demonstrating the Contribution.
create API.
*
*
- * Demonstrates creating contribution with Soft Credit defaults for amount and type
+ * Demonstrates creating contribution with Soft Credit defaults for amount and type
.
*
* @return array
* API result array
*/
function contribution_create_example() {
$params = array(
*
* @return array
* API result array
*/
function contribution_create_example() {
$params = array(
- 'contact_id' => 2
2
,
+ 'contact_id' => 2
1
,
'receive_date' => '20120511',
'total_amount' => '100',
'financial_type_id' => 1,
'receive_date' => '20120511',
'total_amount' => '100',
'financial_type_id' => 1,
@@
-18,11
+18,11
@@
function contribution_create_example() {
'net_amount' => '95',
'source' => 'SSF',
'contribution_status_id' => 1,
'net_amount' => '95',
'source' => 'SSF',
'contribution_status_id' => 1,
- 'soft_credit_to' => 2
3
,
+ 'soft_credit_to' => 2
2
,
);
try{
);
try{
- $result = civicrm_api3('
c
ontribution', 'create', $params);
+ $result = civicrm_api3('
C
ontribution', 'create', $params);
}
catch (CiviCRM_API3_Exception $e) {
// Handle error here.
}
catch (CiviCRM_API3_Exception $e) {
// Handle error here.
@@
-55,7
+55,7
@@
function contribution_create_expectedresult() {
'values' => array(
'1' => array(
'id' => '1',
'values' => array(
'1' => array(
'id' => '1',
- 'contact_id' => '2
2
',
+ 'contact_id' => '2
1
',
'financial_type_id' => '1',
'contribution_page_id' => '',
'payment_instrument_id' => '4',
'financial_type_id' => '1',
'contribution_page_id' => '',
'payment_instrument_id' => '4',
@@
-90,11
+90,10
@@
function contribution_create_expectedresult() {
return $expectedResult;
}
return $expectedResult;
}
-/*
*
+/*
* This example has been generated from the API test suite.
* This example has been generated from the API test suite.
-* The test that created it is called
-* testCreateContributionWithSoftCreditDefaults
-* and can be found in
+* The test that created it is called "testCreateContributionWithSoftCreditDefaults"
+* and can be found at:
* https://github.com/civicrm/civicrm-core/blob/master/tests/phpunit/api/v3/ContributionTest.php
*
* You can see the outcome of the API tests at
* https://github.com/civicrm/civicrm-core/blob/master/tests/phpunit/api/v3/ContributionTest.php
*
* You can see the outcome of the API tests at
@@
-104,7
+103,7
@@
function contribution_create_expectedresult() {
* http://wiki.civicrm.org/confluence/display/CRMDOC/Using+the+API
*
* Browse the api on your own site with the api explorer
* http://wiki.civicrm.org/confluence/display/CRMDOC/Using+the+API
*
* Browse the api on your own site with the api explorer
-* http://MYSITE.ORG/path/to/civicrm/api
/explorer
+* http://MYSITE.ORG/path/to/civicrm/api
*
* Read more about testing here
* http://wiki.civicrm.org/confluence/display/CRM/Testing
*
* Read more about testing here
* http://wiki.civicrm.org/confluence/display/CRM/Testing