/**
* Constructor
*
- * @param string $mode the mode of operation: live or test
+ * @param string $mode
+ * The mode of operation: live or test.
*
* @param $paymentProcessor
*
}
}
- /**
- * Singleton function used to manage this object
- *
- * @param string $mode the mode of operation: live or test
- *
- * @param object $paymentProcessor
- *
- * @return object
- * @static
- */
- public static function &singleton($mode, &$paymentProcessor) {
- if (!empty($paymentProcessor['id'])) {
- $cacheKey = $paymentProcessor['id'];
- }
- else {
- //@todo eliminated instances of this in favour of id-specific instances.
- $cacheKey = $mode . '_' . $paymentProcessor['name'];
- }
- if (self::$_singleton[$cacheKey] === NULL) {
- self::$_singleton[$cacheKey] = new CRM_Core_Payment_Moneris($mode, $paymentProcessor);
- }
- return self::$_singleton[$cacheKey];
- }
-
/**
* This function collects all the information from a web/api form and invokes
* the relevant payment processor specific functions to perform the transaction
*
- * @param array $params assoc array of input parameters for this transaction
+ * @param array $params
+ * Assoc array of input parameters for this transaction.
*
- * @return array the result in an nice formatted array (or an error object)
+ * @return array
+ * the result in an nice formatted array (or an error object)
* @abstract
*/
public function doDirectPayment(&$params) {
// add a recurring payment if requested
if ($params['is_recur'] && $params['installments'] > 1) {
//Recur Variables
- $recurUnit = $params['frequency_unit'];
+ $recurUnit = $params['frequency_unit'];
$recurInterval = $params['frequency_interval'];
- $next = time();
- $day = 60 * 60 * 24;
+ $next = time();
+ $day = 60 * 60 * 24;
switch ($recurUnit) {
case 'day':
$next += $recurInterval * $day;
return TRUE;
}
- // ignore for now, more elaborate error handling later.
/**
+ * ignore for now, more elaborate error handling later.
* @param $response
*
* @return object
/**
* This function checks to see if we have the right config values
*
- * @return string the error message if any
+ * @return string
+ * the error message if any
*/
public function checkConfig() {
$error = array();