| GNU Affero General Public License or the licensing of CiviCRM, |
| see the CiviCRM license FAQ at http://civicrm.org/licensing |
+--------------------------------------------------------------------+
-*/
+ */
use Civi\Payment\System;
+
/**
*
* @package CRM
* $Id$
*
*/
-
abstract class CRM_Core_Payment {
/**
RECURRING_PAYMENT_START = 'START',
RECURRING_PAYMENT_END = 'END';
- protected $_paymentProcessor;
+ protected $_paymentProcessor;
/**
* Singleton function used to manage this object
*
* @return CRM_Core_Payment
* @throws \CRM_Core_Exception
- * @static
*/
public static function &singleton($mode = 'test', &$paymentProcessor, &$paymentForm = NULL, $force = FALSE) {
// make sure paymentProcessor is not empty
}
//we use two lines because we can't remove the '&singleton' without risking breakage
//of extension classes that extend this one
- $object = Civi\Payment\System::singleton()->getByProcessor($paymentProcessor);
+ $object = Civi\Payment\System::singleton()->getByProcessor($paymentProcessor);
return $object;
}
/**
* Getter for payment form that is using the processor
* @deprecated
- * @return CRM_Core_Form A form object
+ * @return CRM_Core_Form
+ * A form object
*/
public function getForm() {
return $this->_paymentForm;
'rule_message' => ts('Please enter a valid value for your card security code. This is usually the last 3-4 digits on the card\'s signature panel.'),
'rule_name' => 'integer',
'rule_parameters' => NULL,
- )),
+ ),
+ ),
),
'credit_card_exp_date' => array(
'htmlType' => 'date',
'rule_message' => ts('Card expiration date cannot be a past date.'),
'rule_name' => 'currentDate',
'rule_parameters' => TRUE,
- )),
+ ),
+ ),
),
'credit_card_type' => array(
'htmlType' => 'select',
'rule_message' => ts('Please enter a valid Bank Identification Number (value must not contain punctuation characters).'),
'rule_name' => 'nopunctuation',
'rule_parameters' => NULL,
- )),
+ ),
+ ),
'is_required' => TRUE,
),
//e.g. SWIFT-BIC can have maxlength of 11 digits
'rule_message' => ts('Please enter a valid Bank Identification Number (value must not contain punctuation characters).'),
'rule_name' => 'nopunctuation',
'rule_parameters' => NULL,
- )),
+ ),
+ ),
),
'bank_name' => array(
'htmlType' => 'text',
* the result in an nice formatted array (or an error object)
* @abstract
*/
- abstract function doDirectPayment(&$params);
+ abstract protected function doDirectPayment(&$params);
/**
* Process payment - this function wraps around both doTransferPayment and doDirectPayment
* @return string
* the error message if any
*/
- abstract function checkConfig();
+ abstract protected function checkConfig();
/**
* @param $paymentProcessor
* @param string $method
* Method to check for.
*
- * @return boolean
+ * @return bool
*/
public function isSupported($method = 'cancelSubscription') {
return method_exists(CRM_Utils_System::getClassName($this), $method);
break;
}
- $session = CRM_Core_Session::singleton();
- $userId = $session->get('userID');
- $contactID = 0;
+ $session = CRM_Core_Session::singleton();
+ $userId = $session->get('userID');
+ $contactID = 0;
$checksumValue = '';
- $entityArg = '';
+ $entityArg = '';
// Find related Contact
if ($entityID) {
// Else default
return $this->_paymentProcessor['url_recur'];
}
+
}