X-Git-Url: https://vcs.fsf.org/?p=trustcommerce.git;a=blobdiff_plain;f=trustcommerce.php;fp=trustcommerce.php;h=c4bec8d53951f33999fa6b65a09a6f7b53aa7d50;hp=e7ab62139f1ef960be2a1d01a9c061af8c8a132e;hb=a8b99ee32fd13cb48e5d6a9e4bec0051d847ae7a;hpb=75718d1f1404c2ac6f81cf5eefc49bf30f7f280b diff --git a/trustcommerce.php b/trustcommerce.php index e7ab621..c4bec8d 100644 --- a/trustcommerce.php +++ b/trustcommerce.php @@ -122,7 +122,7 @@ class org_fsf_payment_trustcommerce extends CRM_Core_Payment { * @return void */ function __construct($mode, &$paymentProcessor) { - $this->_mode = $mode; + self::$_mode = $mode; $this->_paymentProcessor = $paymentProcessor; @@ -139,23 +139,6 @@ class org_fsf_payment_trustcommerce extends CRM_Core_Payment { } - /** - * The singleton function used to manage this object - * - * @param string $mode the mode of operation: live or test - * @param CRM_Core_Payment The payment processor object. - * - * @return object - * @static - */ - static function &singleton($mode, &$paymentProcessor) { - $processorName = $paymentProcessor['name']; - if (self::$_singleton[$processorName] === NULL) { - self::$_singleton[$processorName] = new org_fsf_payment_trustcommerce($mode, $paymentProcessor); - } - return self::$_singleton[$processorName]; - } - /** * Submit a payment using the TC API * @@ -539,7 +522,7 @@ class org_fsf_payment_trustcommerce extends CRM_Core_Payment { $exp_year = substr($this->_getParam('year'),-2); $fields['exp'] = "$exp_month$exp_year"; - if ($this->_mode != 'live') { + if (self::$_mode != 'live') { $fields['demo'] = 'y'; } return $fields; @@ -568,7 +551,7 @@ class org_fsf_payment_trustcommerce extends CRM_Core_Payment { * not set */ function _getParam($field) { - return CRM_Utils_Array::value($field, $this->_params, ''); + return CRM_Utils_Array::value($field, self::$_params, ''); } /** @@ -604,7 +587,7 @@ class org_fsf_payment_trustcommerce extends CRM_Core_Payment { return FALSE; } else { - $this->_params[$field] = $value; + self::$_params[$field] = $value; } }