6 class AuthorizeNet
extends PHPUnit_Framework_Testcase
{
8 * Helper function to create
9 * a payment processor of type Authorize.net
11 * @return $paymentProcessor id of created payment processor
14 * @return CRM_Financial_DAO_PaymentProcessor
18 $paymentProcessor = new CRM_Financial_DAO_PaymentProcessor();
19 $paymentParams = array(
20 'name' => 'Authorize',
21 'domain_id' => CRM_Core_Config
::domainID(),
22 'payment_processor_type' => 'AuthNet',
26 'user_name' => '4y5BfuW7jm',
27 'password' => '4cAmW927n8uLf5J8',
28 'url_site' => 'https://test.authorize.net/gateway/transact.dll',
29 'url_recur' => 'https://apitest.authorize.net/xml/v1/request.api',
30 'class_name' => 'Payment_AuthorizeNet',
33 $paymentProcessor->copyValues($paymentParams);
34 $paymentProcessor->save();
35 return $paymentProcessor;
39 * Helper function to delete a PayPal Pro
41 * @param int $id - id of the PayPal Pro payment processor
43 * @return boolean true if payment processor deleted, false otherwise
51 function delete($id) {
52 $paymentProcessor = new CRM_Financial_DAO_PaymentProcessor();
53 $paymentProcessor->id
= $id;
54 if ($paymentProcessor->find(TRUE)) {
55 $result = $paymentProcessor->delete();