*/
/**
- Note that in order to use FirstData / LinkPoint you need a certificate (.pem) file issued by them
- and a store number. You can configure the path to the certificate and the store number
- through the front end of civiCRM. The path is as seen by the server not the url
- -----------------------------------------------------------------------------------------------
- The basic functionality of this processor is that variables from the $params object are transformed
- into xml using a function provided by the processor. The xml is submitted to the processor's https site
- using curl and the response is translated back into an array using the processor's function.
-
- If an array ($params) is returned to the calling function it is treated as a success and the values from
- the array are merged into the calling functions array.
-
- If an result of class error is returned it is treated as a failure
-
- -----------------------------------------------------------------------------------------------
- **/
+ * Note that in order to use FirstData / LinkPoint you need a certificate (.pem) file issued by them
+ * and a store number. You can configure the path to the certificate and the store number
+ * through the front end of civiCRM. The path is as seen by the server not the url
+ * -----------------------------------------------------------------------------------------------
+ * The basic functionality of this processor is that variables from the $params object are transformed
+ * into xml using a function provided by the processor. The xml is submitted to the processor's https site
+ * using curl and the response is translated back into an array using the processor's function.
+ *
+ * If an array ($params) is returned to the calling function it is treated as a success and the values from
+ * the array are merged into the calling functions array.
+ *
+ * If an result of class error is returned it is treated as a failure
+ *
+ * -----------------------------------------------------------------------------------------------
+ */
/**
* From Payment processor documentation
* pattern and cache the instance in this variable
*
* @var object
- * @static
*/
static private $_singleton = NULL;
- /**********************************************************
+ /**
* Constructor
*
* @param string $mode
}
/**
- * 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_FirstData($mode, $paymentProcessor);
- }
- return self::$_singleton[$cacheKey];
- }
-
- /**********************************************************
* This function is set up and put here to make the mapping of fields
* from the params object as visually clear as possible for easy editing
*
* Comment out irrelevant fields
- **********************************************************/
+ */
public function mapProcessorFieldstoParams($params) {
/*concatenate full customer name first - code from EWAY gateway
*/
return $requestFields;
}
- /**********************************************************
+ /**
* This function sends request and receives response from
* the processor
- **********************************************************/
+ */
public function doDirectPayment(&$params) {
if ($params['is_recur'] == TRUE) {
CRM_Core_Error::fatal(ts('%1 - recurring payments not implemented', array(1 => $paymentProcessor)));
* @param int $invoiceId
* The ID to check.
*
- * @return bool True if ID exists, else false
+ * @return bool
+ * True if ID exists, else false
*/
public function _checkDupe($invoiceId) {
$contribution = new CRM_Contribute_DAO_Contribution();
return $contribution->find();
}
- /**************************************************
+ /**
* Produces error message and returns from class
- **************************************************/
+ */
public function &errorExit($errorCode = NULL, $errorMessage = NULL) {
$e = CRM_Core_Error::singleton();
return $e;
}
- /**************************************************
+ /**
* NOTE: 'doTransferCheckout' not implemented
- **************************************************/
+ */
public function doTransferCheckout(&$params, $component) {
CRM_Core_Error::fatal(ts('This function is not implemented'));
}
- /********************************************************************************************
+ /**
* This public function checks to see if we have the right processor config values set
*
* NOTE: Called by Events and Contribute to check config params are set prior to trying
*
* returns string $errorMsg if any errors found - null if OK
*
- ******************************************************************************************
+ * function checkConfig( $mode ) CiviCRM V1.9 Declaration
+ * CiviCRM V2.0 Declaration
*/
- // function checkConfig( $mode ) // CiviCRM V1.9 Declaration
- // CiviCRM V2.0 Declaration
public function checkConfig() {
$errorMsg = array();