/**
* Constructor
*
- * @param string $mode the mode of operation: live or test
+ * @param string $mode
+ * The mode of operation: live or test.
*
* @param $paymentProcessor
*
}
}
- /**
- * @param string $mode
- * @param array $paymentProcessor
- *
- * @return mixed
- */
- public static function &singleton($mode, &$paymentProcessor) {
- $processorName = $paymentProcessor['name'];
- if (self::$_singleton[$processorName] === NULL) {
- self::$_singleton[$processorName] = new CRM_Core_Payment_IATS($mode, $paymentProcessor);
- }
- return self::$_singleton[$processorName];
- }
-
/**
* 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) {
// beginning of modified sample code from IATS php api include IATS supplied api library
if ($isRecur) {
- include_once ('Services/IATS/iats_reoccur.php');
+ include_once 'Services/IATS/iats_reoccur.php';
$iatslink1 = new iatslinkReoccur;
}
else {
- include_once ('Services/IATS/iatslink.php');
+ include_once 'Services/IATS/iatslink.php';
$iatslink1 = new iatslink;
}
case 'week':
$scheduleType = 'WEEKLY';
$scheduleDate = $date['wday'] + 1;
- $endTime = $startTime + ($paymentsRecur * 7 * 24 * 60 * 60);
+ $endTime = $startTime + ($paymentsRecur * 7 * 24 * 60 * 60);
break;
case 'month':
// this just means we got some kind of answer, not necessarily approved
$result = $iatslink1->getAuthorizationResult();
//return self::error($result);
- $result = explode(':', $result, 2);
+ $result = explode(':', $result, 2);
$trxn_result = trim($result[0]);
- $trxn_id = trim($result[1]);
+ $trxn_id = trim($result[1]);
if ($trxn_result == 'OK') {
$params['trxn_id'] = $trxn_id . ':' . time();
$params['gross_amount'] = $amount;
*
* @internal param string $mode the mode we are operating in (live or test)
*
- * @return string the error message if any
+ * @return string
+ * the error message if any
*/
public function checkConfig() {
$error = array();