3 * Test Generated example demonstrating the PaymentProcessor.create API.
8 function payment_processor_create_example() {
10 'name' => 'API Test PP',
11 'payment_processor_type_id' => 1,
12 'class_name' => 'CRM_Core_Payment_APITest',
18 $result = civicrm_api3('PaymentProcessor', 'create', $params);
20 catch (CiviCRM_API3_Exception
$e) {
22 $errorMessage = $e->getMessage();
23 $errorCode = $e->getErrorCode();
24 $errorData = $e->getExtraParams();
27 'error_message' => $errorMessage,
28 'error_code' => $errorCode,
29 'error_data' => $errorData,
37 * Function returns array of result expected from previous function.
42 function payment_processor_create_expectedresult() {
53 'name' => 'API Test PP',
55 'payment_processor_type_id' => '1',
67 'class_name' => 'CRM_Core_Payment_APITest',
68 'billing_mode' => '1',
70 'payment_type' => '1',
71 'payment_instrument_id' => '1',
72 'accepted_credit_cards' => '',
77 return $expectedResult;
81 * This example has been generated from the API test suite.
82 * The test that created it is called "testPaymentProcessorCreate"
83 * and can be found at:
84 * https://github.com/civicrm/civicrm-core/blob/master/tests/phpunit/api/v3/PaymentProcessorTest.php
86 * You can see the outcome of the API tests at
87 * https://test.civicrm.org/job/CiviCRM-master-git/
89 * To Learn about the API read
90 * http://wiki.civicrm.org/confluence/display/CRMDOC/Using+the+API
92 * Browse the api on your own site with the api explorer
93 * http://MYSITE.ORG/path/to/civicrm/api
95 * Read more about testing here
96 * http://wiki.civicrm.org/confluence/display/CRM/Testing
98 * API Standards documentation:
99 * http://wiki.civicrm.org/confluence/display/CRM/API+Architecture+Standards