}
// Set $newCredit variable in template to control whether link to credit card mode is included
- CRM_Core_Payment::allowBackofficeCreditCard($this);
+ $this->assign('newCredit', CRM_Core_Config::isEnabledBackOfficeCreditCardPayments());
return $defaults;
}
}
// Set $newCredit variable in template to control whether link to credit card mode is included
- CRM_Core_Payment::allowBackofficeCreditCard($this);
+ $this->assign('newCredit', CRM_Core_Config::isEnabledBackOfficeCreditCardPayments());
// fix the display of the monetary value, CRM-4038
if (isset($defaults['total_amount'])) {
$this->preProcess();
// check if we can process credit card contribs
- CRM_Core_Payment::allowBackofficeCreditCard($this);
+ $this->assign('newCredit', CRM_Core_Config::isEnabledBackOfficeCreditCardPayments());
$this->setContext();
if (!empty($config->enableComponents)) {
// check if we can process credit card contribs
- $newCredit = CRM_Core_Payment::allowBackofficeCreditCard();
+ $newCredit = CRM_Core_Config::isEnabledBackOfficeCreditCardPayments();
foreach ($components as $componentName => $obj) {
if (in_array($componentName, $config->enableComponents)) {
$this->userFramework = $userFramework;
$this->_setUserFrameworkConfig($userFramework);
}
+
+ /**
+ * Is back office credit card processing enabled for this site - ie are there any installed processors that support
+ * on-site processing
+ * @return bool
+ */
+ static function isEnabledBackOfficeCreditCardPayments() {
+ // restrict to type=1 (credit card) payment processor payment_types and only include billing mode types 1 and 3
+ $processors = CRM_Core_PseudoConstant::paymentProcessor(FALSE, FALSE,
+ "billing_mode IN ( 1, 3 ) AND payment_type = 1"
+ );
+ if (count($processors) > 0) {
+ return TRUE;
+ }
+ return FALSE;
+ }
}
// end CRM_Core_Config
}
return $this->_paymentProcessor['url_recur'];
}
-
- /**
- * Check for presence of type 1 or type 3 enabled processors (means we can do back-office submit credit/debit card trxns)
- * @public
- */
- static function allowBackofficeCreditCard($template = NULL, $variableName = 'newCredit') {
- $newCredit = FALSE;
- // restrict to type=1 (credit card) payment processor payment_types and only include billing mode types 1 and 3
- $processors = CRM_Core_PseudoConstant::paymentProcessor(FALSE, FALSE,
- "billing_mode IN ( 1, 3 ) AND payment_type = 1"
- );
- if (count($processors) > 0) {
- $newCredit = TRUE;
- }
- if ($template) {
- $template->assign($variableName, $newCredit);
- }
- return $newCredit;
- }
-
}
$this->preProcess();
// check if we can process credit card registration
- CRM_Core_Payment::allowBackofficeCreditCard($this);
+ $this->assign('newCredit', CRM_Core_Config::isEnabledBackOfficeCreditCardPayments());
// Only show credit card registration button if user has CiviContribute permission
if (CRM_Core_Permission::access('CiviContribute')) {
$this->preProcess();
// check if we can process credit card membership
- $newCredit = CRM_Core_Payment::allowBackofficeCreditCard($this);
+ $newCredit = CRM_Core_Config::isEnabledBackOfficeCreditCardPayments();
+ $this->assign('newCredit', $newCredit);
+
if ($newCredit) {
$this->_isPaymentProcessor = TRUE;
}
$this->assign('contactId', $this->_contactId);
// check if we can process credit card contribs
- CRM_Core_Payment::allowBackofficeCreditCard($this);
+ $this->assign('newCredit', CRM_Core_Config::isEnabledBackOfficeCreditCardPayments());
// check is the user has view/edit signer permission
$permission = 'view';
$this->preProcess();
// check if we can process credit card registration
- CRM_Core_Payment::allowBackofficeCreditCard($this);
+ $this->assign('newCredit', CRM_Core_Config::isEnabledBackOfficeCreditCardPayments());
$this->setContext();