6 class AuthorizeNet
extends PHPUnit_Framework_Testcase
{
8 * Helper function to create
9 * a payment processor of type Authorize.net
10 * @return CRM_Financial_DAO_PaymentProcessor
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',
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',
29 $paymentProcessor->copyValues($paymentParams);
30 $paymentProcessor->save();
31 return $paymentProcessor;
35 * Helper function to delete a PayPal Pro
37 * @param int $id - id of the PayPal Pro payment processor
39 * @return boolean true if payment processor deleted, false otherwise
42 function delete($id) {
43 $paymentProcessor = new CRM_Financial_DAO_PaymentProcessor();
44 $paymentProcessor->id
= $id;
45 if ($paymentProcessor->find(TRUE)) {
46 $result = $paymentProcessor->delete();