Skip to content
Snippets Groups Projects
Commit 021e9a6d authored by drastik's avatar drastik
Browse files

Trying to solve:

Strict warning: Declaration of CRM_Core_Payment_Stripe::singleton() should be
compatible with & CRM_Core_Payment::singleton().

And:
Strict warning: Accessing static property CRM_Core_Payment_Stripe::$_mode as
non static in CRM_Core_Payment_Stripe->__construct().
parent 4f3631cf
Branches
Tags
No related merge requests found
......@@ -14,7 +14,7 @@ class CRM_Core_Payment_Stripe extends CRM_Core_Payment {
static private $_singleton = null;
/**
* mode of operation: live or test
* Mode of operation: live or test.
*
* @var object
* @static
......@@ -30,7 +30,7 @@ class CRM_Core_Payment_Stripe extends CRM_Core_Payment {
* @return void
*/
function __construct($mode, &$paymentProcessor) {
$this->_mode = $mode;
self::$_mode = $mode;
$this->_paymentProcessor = $paymentProcessor;
$this->_processorName = ts('Stripe');
}
......@@ -38,17 +38,18 @@ class CRM_Core_Payment_Stripe extends CRM_Core_Payment {
/**
* Singleton function used to manage this object.
*
* @param string $mode
* The mode of operation: live or test.
* @param string $mode the mode of operation: live or test
* @param object $paymentProcessor the details of the payment processor being invoked
* @param object $paymentForm reference to the form object if available
* @param boolean $force should we force a reload of this payment object
*
* @return object
*
* @static
*
*/
static function &singleton($mode, &$paymentProcessor) {
static function &singleton($mode = 'test', &$paymentProcessor, &$paymentForm = NULL, $force = FALSE) {
$processorName = $paymentProcessor['name'];
if (self::$_singleton[$processorName] === NULL ) {
if (self::$_singleton[$processorName] === NULL || $force) {
self::$_singleton[$processorName] = new self($mode, $paymentProcessor);
}
return self::$_singleton[$processorName];
......@@ -59,7 +60,7 @@ class CRM_Core_Payment_Stripe extends CRM_Core_Payment {
*
* @return string
* The error message if any.
*
*
* @public
*/
function checkConfig() {
......@@ -84,7 +85,7 @@ class CRM_Core_Payment_Stripe extends CRM_Core_Payment {
/**
* Helper log function.
*
*
* @param string $op
* The Stripe operation being performed.
* @param Exception $exception
......@@ -97,12 +98,12 @@ class CRM_Core_Payment_Stripe extends CRM_Core_Payment {
/**
* Run Stripe calls through this to catch exceptions gracefully.
*
*
* @param string $op
* Determine which operation to perform.
* @param array $params
* Parameters to run Stripe calls on.
*
*
* @return varies
* Response from gateway.
*/
......@@ -219,7 +220,7 @@ class CRM_Core_Payment_Stripe extends CRM_Core_Payment {
*
* @return array
* The result in a nice formatted array (or an error object).
*
*
* @public
*/
function doDirectPayment(&$params) {
......@@ -444,9 +445,9 @@ class CRM_Core_Payment_Stripe extends CRM_Core_Payment {
* @param object $stripe_customer
* Stripe customer object generated by Stripe API.
*
* @return array
* @return array
* The result in a nice formatted array (or an error object).
*
*
* @public
*/
function doRecurPayment(&$params, $amount, $stripe_customer) {
......@@ -583,7 +584,7 @@ class CRM_Core_Payment_Stripe extends CRM_Core_Payment {
* Name value pair of contribution data.
*
* @return void
*
*
* @access public
*
*/
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment