Commit | Line | Data |
---|---|---|
6a488035 | 1 | <?php |
627456b5 EM |
2 | |
3 | /** | |
4 | * Class AuthorizeNet | |
5 | */ | |
6a488035 | 6 | class AuthorizeNet extends PHPUnit_Framework_Testcase { |
aba1cd8b | 7 | /** |
c490a46a CW |
8 | * Helper function to create |
9 | * a payment processor of type Authorize.net | |
aba1cd8b EM |
10 | * @return CRM_Financial_DAO_PaymentProcessor |
11 | */ | |
00be9182 | 12 | public function create() { |
6a488035 TO |
13 | |
14 | $paymentProcessor = new CRM_Financial_DAO_PaymentProcessor(); | |
15 | $paymentParams = array( | |
16 | 'name' => 'Authorize', | |
17 | 'domain_id' => CRM_Core_Config::domainID(), | |
18 | 'payment_processor_type' => 'AuthNet', | |
19 | 'is_active' => 1, | |
20 | 'is_default' => 0, | |
21 | 'is_test' => 1, | |
22 | 'user_name' => '4y5BfuW7jm', | |
23 | 'password' => '4cAmW927n8uLf5J8', | |
24 | 'url_site' => 'https://test.authorize.net/gateway/transact.dll', | |
25 | 'url_recur' => 'https://apitest.authorize.net/xml/v1/request.api', | |
26 | 'class_name' => 'Payment_AuthorizeNet', | |
27 | 'billing_mode' => 1, | |
28 | ); | |
29 | $paymentProcessor->copyValues($paymentParams); | |
30 | $paymentProcessor->save(); | |
31 | return $paymentProcessor; | |
32 | } | |
33 | ||
4cbe18b8 | 34 | /** |
c490a46a CW |
35 | * Helper function to delete a PayPal Pro |
36 | * payment processor | |
e16033b4 TO |
37 | * @param int $id |
38 | * Id of the PayPal Pro payment processor. | |
16b10e64 | 39 | * to be deleted |
c301f76e | 40 | * @return bool |
a6c01b45 | 41 | * true if payment processor deleted, false otherwise |
4cbe18b8 | 42 | */ |
00be9182 | 43 | public function delete($id) { |
6a488035 TO |
44 | $paymentProcessor = new CRM_Financial_DAO_PaymentProcessor(); |
45 | $paymentProcessor->id = $id; | |
46 | if ($paymentProcessor->find(TRUE)) { | |
47 | $result = $paymentProcessor->delete(); | |
48 | } | |
49 | return $result; | |
50 | } | |
96025800 | 51 | |
6a488035 | 52 | } |