<?php
/*
+--------------------------------------------------------------------+
- | CiviCRM version 4.5 |
+ | CiviCRM version 4.6 |
+--------------------------------------------------------------------+
| Copyright CiviCRM LLC (c) 2004-2014 |
+--------------------------------------------------------------------+
*/
class CRM_Core_Payment_Moneris extends CRM_Core_Payment {
# (not used, implicit in the API, might need to convert?)
- CONST CHARSET = 'UFT-8';
+ const CHARSET = 'UFT-8';
/**
* We only need one instance of this object. So we use the singleton
*
* @return \CRM_Core_Payment_Moneris
*/
- function __construct($mode, &$paymentProcessor) {
+ function __construct($mode, &$paymentProcessor, &$paymentForm = NULL, $force = FALSE) {
$this->_mode = $mode;
$this->_paymentProcessor = $paymentProcessor;
$this->_processorName = ts('Moneris');
}
/**
- * singleton function used to manage this object
+ * Singleton function used to manage this object
*
* @param string $mode the mode of operation: live or test
*
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
+ *
+ * @return array the result in an nice formatted array (or an error object)
+ * @abstract
+ */
function doDirectPayment(&$params) {
//make sure i've been called correctly ...
if (!$this->_profile) {
return $params;
}
+ /**
+ * @param $response
+ *
+ * @return bool
+ */
function isError(&$response) {
$responseCode = $response->getResponseCode();
if (is_null($responseCode)) {
}
// ignore for now, more elaborate error handling later.
+ /**
+ * @param $response
+ *
+ * @return object
+ */
function &checkResult(&$response) {
return $response;
return $e;
}
+ /**
+ * @param null $error
+ *
+ * @return object
+ */
function &error($error = NULL) {
$e = CRM_Core_Error::singleton();
if (is_object($error)) {