3 * Test Generated example demonstrating the Payment.create API.
10 function payment_create_example() {
12 'contribution_id' => 1,
13 'total_amount' => 100,
15 'check_permissions' => TRUE,
19 $result = civicrm_api3('Payment', 'create', $params);
21 catch (CiviCRM_API3_Exception
$e) {
23 $errorMessage = $e->getMessage();
24 $errorCode = $e->getErrorCode();
25 $errorData = $e->getExtraParams();
28 'error_message' => $errorMessage,
29 'error_code' => $errorCode,
30 'error_data' => $errorData,
38 * Function returns array of result expected from previous function.
43 function payment_create_expectedresult() {
53 'from_financial_account_id' => '7',
54 'to_financial_account_id' => '6',
55 'trxn_date' => '20170207024653',
56 'total_amount' => '100',
58 'net_amount' => '100',
62 'trxn_result_code' => '',
64 'payment_processor_id' => '',
69 return $expectedResult;
73 * This example has been generated from the API test suite.
74 * The test that created it is called "testUpdatePayment"
75 * and can be found at:
76 * https://github.com/civicrm/civicrm-core/blob/master/tests/phpunit/api/v3/PaymentTest.php
78 * You can see the outcome of the API tests at
79 * https://test.civicrm.org/job/CiviCRM-master-git/
81 * To Learn about the API read
82 * http://wiki.civicrm.org/confluence/display/CRMDOC/Using+the+API
84 * Browse the api on your own site with the api explorer
85 * http://MYSITE.ORG/path/to/civicrm/api
87 * Read more about testing here
88 * http://wiki.civicrm.org/confluence/display/CRM/Testing
90 * API Standards documentation:
91 * http://wiki.civicrm.org/confluence/display/CRM/API+Architecture+Standards