$this->_setParam('sequence', rand(1, 1000));
}
- /**
- * Singleton function used to manage this object
- *
- * @param string $mode
- * The mode of operation: live or test.
- * @param array $paymentProcessor
- * The details of the payment processor being invoked.
- * @param CRM_Core_Form $paymentForm
- * Reference to the form object if available.
- * @param bool $force
- * Should we force a reload of this payment object.
- *
- * @return object
- * @static
- *
- */
- public static function &singleton($mode, &$paymentProcessor, &$paymentForm = NULL, $force = FALSE) {
- if (!empty($paymentProcessor['id'])) {
- $cacheKey = $paymentProcessor['id'];
- }
- else {
- //@todo eliminated instances of this in favour of id-specific instances.
- $cacheKey = $mode . '_' . $paymentProcessor['name'];
- }
- if (!isset(self::$_singleton[$cacheKey]) || self::$_singleton[$cacheKey] === NULL) {
- self::$_singleton[$cacheKey] = new CRM_Core_Payment_AuthorizeNet($mode, $paymentProcessor);
- }
- return self::$_singleton[$cacheKey];
- }
-
/**
* Should the first payment date be configurable when setting up back office recurring payments
* In the case of Authorize.net this is an option
$this->_processorName = ts('Dummy Processor');
}
- /**
- * Singleton function used to manage this object
- *
- * @param string $mode
- * The mode of operation: live or test.
- *
- * @param object $paymentProcessor
- * @param null $paymentForm
- * @param bool $force
- *
- * @return object
- * @static
- */
- public static function &singleton($mode, &$paymentProcessor, &$paymentForm = NULL, $force = FALSE) {
- if (!empty($paymentProcessor['id'])) {
- $cacheKey = $paymentProcessor['id'];
- }
- else {
- //@todo eliminated instances of this in favour of id-specific instances.
- $cacheKey = $mode . '_' . $paymentProcessor['name'];
- }
- if (CRM_Utils_Array::value($cacheKey, self::$_singleton) === NULL) {
- self::$_singleton[$cacheKey] = new CRM_Core_Payment_Dummy($mode, $paymentProcessor);
- }
- return self::$_singleton[$cacheKey];
- }
-
/**
* Submit a payment using Advanced Integration Method
*
$this->_processorName = ts('Elavon');
}
- /**
- * 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_Elavon($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
$this->_paymentProcessor = $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_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
$this->_processorName = ts('Google Checkout');
}
- /**
- * 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 (!isset(self::$_singleton[$cacheKey]) || self::$_singleton[$cacheKey] === NULL) {
- self::$_singleton[$cacheKey] = new CRM_Core_Payment_Google($mode, $paymentProcessor);
- }
- return self::$_singleton[$cacheKey];
- }
-
/**
* This function checks to see if we have the right config values
*
}
/**
+ * @deprecated
+ * Payment processor singletons removed - this is an IPN so left but probably can go
* Singleton function used to manage this object
*
* @param string $mode
}
}
- /**
- * @param string $mode
- * @param array $paymentProcessor
- *
- * @return mixed
- */
- 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_IATS($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
}
}
- /**
- * 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
$this->_processorName = ts('PayJunction');
}
- /**
- * Singleton function used to manage this object
- *
- * @param string $mode
- * The mode of operation: live or test.
- *
- * @param object $paymentProcessor
- * @param null $paymentForm
- * @param bool $force
- *
- * @return object
- * @static
- */
- public static function &singleton($mode, &$paymentProcessor, &$paymentForm = NULL, $force = FALSE) {
- 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_PayJunction($mode, $paymentProcessor);
- }
- return self::$_singleton[$cacheKey];
- }
-
/*
* This function sends request and receives response from
* PayJunction payment process
}
}
- /**
- * Singleton function used to manage this object
- *
- * @param string $mode
- * The mode of operation: live or test.
- *
- * @param object $paymentProcessor
- * @param null $paymentForm
- * @param bool $force
- *
- * @return object
- * @static
- */
- public static function &singleton($mode, &$paymentProcessor, &$paymentForm = NULL, $force = FALSE) {
- if (!empty($paymentProcessor['id'])) {
- $cacheKey = $paymentProcessor['id'];
- }
- else {
- //@todo eliminated instances of this in favour of id-specific instances.
- $cacheKey = $mode . '_' . $paymentProcessor['name'];
- }
- if (!isset(self::$_singleton[$cacheKey]) || self::$_singleton[$cacheKey] === NULL) {
- self::$_singleton[$cacheKey] = new CRM_Core_Payment_PaypalImpl($mode, $paymentProcessor);
- }
- return self::$_singleton[$cacheKey];
- }
-
/**
* Are back office payments supported - e.g paypal standard won't permit you to enter a credit card associated with someone else's login
* @return bool
$this->_processorName = ts('Payflow Pro');
}
- /**
- * 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_PayflowPro($mode, $paymentProcessor);
- }
- return self::$_singleton[$cacheKey];
- }
-
/*
* This function sends request and receives response from
* the processor. It is the main function for processing on-server
$this->_processorName = ts('DPS Payment Express');
}
- /**
- * Singleton function used to manage this object
- *
- * @param string $mode
- * The mode of operation: live or test.
- *
- * @param object $paymentProcessor
- * @param null $paymentForm
- * @param bool $force
- *
- * @return object
- * @static
- */
- public static function &singleton($mode = 'test', &$paymentProcessor, &$paymentForm = NULL, $force = FALSE) {
- 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_PaymentExpress($mode, $paymentProcessor);
- }
- return self::$_singleton[$cacheKey];
- }
-
/**
* This function checks to see if we have the right config values
*
$this->_paymentProcessor = $paymentProcessor;
}
- /**
- * Singleton function used to manage this object
- *
- * @param string $mode
- * The mode of operation: live or test.
- *
- * @param $paymentProcessor
- * @param null $paymentForm
- * @param bool $force
- *
- * @return object
- * @static
- */
- public static function &singleton($mode = 'test', &$paymentProcessor, &$paymentForm = NULL, $force = FALSE) {
- if (self::$_singleton === NULL) {
- self::$_singleton = new CRM_Core_Payment_PaymentExpressIPN($mode, $paymentProcessor);
- }
- return self::$_singleton;
- }
-
/**
* The function gets called when a new order takes place.
*
// also set cancel subscription url
if (!empty($form->_paymentProcessor['is_recur']) && !empty($form->_values['is_recur'])) {
- $form->_paymentObject = &CRM_Core_Payment::singleton($mode, $form->_paymentProcessor, $form);
+ $form->_paymentObject = CRM_Core_Payment::singleton($mode, $form->_paymentProcessor, $form);
$form->_values['cancelSubscriptionUrl'] = $form->_paymentObject->subscriptionURL();
}
$this->_setParam('sequence', rand(1, 1000));
}
- /**
- * 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, &$paymentForm = NULL, $force = FALSE) {
- 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_Realex($mode, $paymentProcessor);
- }
- return self::$_singleton[$cacheKey];
- }
-
/**
* @param array $params
*
$this->_processorName = ts('eWay');
}
- /**
- * Singleton function used to manage this object
- *
- * @param string $mode
- * The mode of operation: live or test.
- *
- * @param object $paymentProcessor
- * @param null $paymentForm
- * @param bool $force
- *
- * @return object
- * @static
- */
- public static function &singleton($mode, &$paymentProcessor, &$paymentForm = NULL, $force = FALSE) {
- 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_eWAY($mode, $paymentProcessor);
- }
- return self::$_singleton[$cacheKey];
- }
-
/**********************************************************
* This function sends request and receives response from
* eWAY payment process