Commit | Line | Data |
---|---|---|
21150aae CW |
1 | <?php |
2 | ||
3 | /* | |
4 | ||
5 | */ | |
6 | function payment_processor_create_example(){ | |
53ca8fd7 | 7 | $params = array( |
21150aae CW |
8 | 'version' => 3, |
9 | 'name' => 'API Test PP', | |
10 | 'payment_processor_type_id' => 1, | |
11 | 'class_name' => 'CRM_Core_Payment_APITest', | |
12 | 'is_recur' => 0, | |
13 | 'domain_id' => 1, | |
14 | ); | |
15 | ||
16 | $result = civicrm_api( 'payment_processor','create',$params ); | |
17 | ||
18 | return $result; | |
19 | } | |
20 | ||
21 | /* | |
22 | * Function returns array of result expected from previous function | |
23 | */ | |
24 | function payment_processor_create_expectedresult(){ | |
25 | ||
53ca8fd7 | 26 | $expectedResult = array( |
21150aae CW |
27 | 'is_error' => 0, |
28 | 'version' => 3, | |
29 | 'count' => 1, | |
30 | 'id' => 1, | |
53ca8fd7 | 31 | 'values' => array( |
32 | '1' => array( | |
21150aae CW |
33 | 'id' => '1', |
34 | 'domain_id' => '1', | |
35 | 'name' => 'API Test PP', | |
36 | 'description' => '', | |
37 | 'payment_processor_type_id' => '1', | |
38 | 'is_active' => '', | |
39 | 'is_default' => 0, | |
40 | 'is_test' => 0, | |
41 | 'user_name' => '', | |
42 | 'password' => '', | |
43 | 'signature' => '', | |
44 | 'url_site' => '', | |
45 | 'url_api' => '', | |
46 | 'url_recur' => '', | |
47 | 'url_button' => '', | |
48 | 'subject' => '', | |
49 | 'class_name' => 'CRM_Core_Payment_APITest', | |
50 | 'billing_mode' => '1', | |
51 | 'is_recur' => 0, | |
52 | 'payment_type' => '1', | |
53 | ), | |
54 | ), | |
55 | ); | |
56 | ||
57 | return $expectedResult ; | |
58 | } | |
59 | ||
60 | ||
61 | /* | |
62 | * This example has been generated from the API test suite. The test that created it is called | |
63 | * | |
64 | * testPaymentProcessorCreate and can be found in | |
65 | * http://svn.civicrm.org/civicrm/trunk/tests/phpunit/CiviTest/api/v3/PaymentProcessorTest.php | |
66 | * | |
67 | * You can see the outcome of the API tests at | |
68 | * http://tests.dev.civicrm.org/trunk/results-api_v3 | |
69 | * | |
70 | * To Learn about the API read | |
71 | * http://book.civicrm.org/developer/current/techniques/api/ | |
72 | * | |
73 | * and review the wiki at | |
74 | * http://wiki.civicrm.org/confluence/display/CRMDOC/CiviCRM+Public+APIs | |
75 | * | |
76 | * Read more about testing here | |
77 | * http://wiki.civicrm.org/confluence/display/CRM/Testing | |
78 | * | |
79 | * API Standards documentation: | |
80 | * http://wiki.civicrm.org/confluence/display/CRM/API+Architecture+Standards | |
81 | */ |