2 class AuthorizeNet
extends PHPUnit_Framework_Testcase
{
4 * Helper function to create
5 * a payment processor of type Authorize.net
7 * @return $paymentProcessor id of created payment processor
11 $paymentProcessor = new CRM_Financial_DAO_PaymentProcessor();
12 $paymentParams = array(
13 'name' => 'Authorize',
14 'domain_id' => CRM_Core_Config
::domainID(),
15 'payment_processor_type' => 'AuthNet',
19 'user_name' => '4y5BfuW7jm',
20 'password' => '4cAmW927n8uLf5J8',
21 'url_site' => 'https://test.authorize.net/gateway/transact.dll',
22 'url_recur' => 'https://apitest.authorize.net/xml/v1/request.api',
23 'class_name' => 'Payment_AuthorizeNet',
26 $paymentProcessor->copyValues($paymentParams);
27 $paymentProcessor->save();
28 return $paymentProcessor;
32 * Helper function to delete a PayPal Pro
34 * @param int $id - id of the PayPal Pro payment processor
36 * @return boolean true if payment processor deleted, false otherwise
39 function delete($id) {
40 $paymentProcessor = new CRM_Financial_DAO_PaymentProcessor();
41 $paymentProcessor->id
= $id;
42 if ($paymentProcessor->find(TRUE)) {
43 $result = $paymentProcessor->delete();