/** * @return CRM_Financial_DAO_PaymentProcessor */ function create() { $paymentProcessor = new CRM_Financial_DAO_PaymentProcessor(); $paymentParams = array('name' => 'Authorize', 'domain_id' => CRM_Core_Config::domainID(), 'payment_processor_type' => 'AuthNet', 'is_active' => 1, 'is_default' => 0, 'is_test' => 1, 'user_name' => '4y5BfuW7jm', 'password' => '4cAmW927n8uLf5J8', 'url_site' => 'https://test.authorize.net/gateway/transact.dll', 'url_recur' => 'https://apitest.authorize.net/xml/v1/request.api', 'class_name' => 'Payment_AuthorizeNet', 'billing_mode' => 1); $paymentProcessor->copyValues($paymentParams); $paymentProcessor->save(); return $paymentProcessor; }
/** * Helper function to create * a payment processor of type Paypal Pro * * @return int $paymentProcessor id of created payment processor@todo this appears not to be working but because it doesn't extend the test class * callAPISuccess won't work * I have duplicated this on the main test class as a work around */ static function create() { $paymentProcessor = new CRM_Financial_DAO_PaymentProcessor(); $paymentParams = array('name' => 'demo', 'domain_id' => CRM_Core_Config::domainID(), 'payment_processor_type' => 'PayPal', 'is_active' => 1, 'is_default' => 0, 'is_test' => 1, 'user_name' => 'sunil._1183377782_biz_api1.webaccess.co.in', 'password' => '1183377788', 'signature' => 'APixCoQ-Zsaj-u3IH7mD5Do-7HUqA9loGnLSzsZga9Zr-aNmaJa3WGPH', 'url_site' => 'https://www.sandbox.paypal.com/', 'url_api' => 'https://api-3t.sandbox.paypal.com/', 'url_button' => 'https://www.paypal.com/en_US/i/btn/btn_xpressCheckout.gif', 'class_name' => 'Payment_PayPalImpl', 'billing_mode' => 3, 'financial_type_id' => 1); $paymentProcessor->copyValues($paymentParams); $paymentProcessor->save(); return $paymentProcessor->id; }
/** * Takes a bunch of params that are needed to match certain criteria and * retrieves the relevant objects. It also stores all the retrieved * values in the default array * * @param array $params (reference ) an assoc array of name/value pairs * @param array $defaults (reference ) an assoc array to hold the flattened values * * @return object CRM_Financial_DAO_PaymentProcessor object on success, null otherwise * @access public * @static */ static function retrieve(&$params, &$defaults) { $paymentProcessor = new CRM_Financial_DAO_PaymentProcessor(); $paymentProcessor->copyValues($params); if ($paymentProcessor->find(TRUE)) { CRM_Core_DAO::storeValues($paymentProcessor, $defaults); return $paymentProcessor; } return NULL; }