// Check pp is extension
$ext = CRM_Extension_System::singleton()->getMapper();
if ($ext->isExtensionKey($dao->class_name)) {
- $extension_instance_found = TRUE;
$paymentClass = $ext->keyToClass($dao->class_name, 'payment');
require_once $ext->classToPath($paymentClass);
}
else {
// Legacy or extension as module instance
- if(empty($paymentClass)) {
- $paymentClass = 'CRM_Core_' . $dao->class_name;
-
- }
+ $paymentClass = 'CRM_Core_' . $dao->class_name;
}
$paymentProcessor = CRM_Financial_BAO_PaymentProcessor::getPayment($dao->processor_id, $mode);
// Everything, it seems, is ok - execute pp callback handler
$processorInstance->$method();
+ $extension_instance_found = TRUE;
}
if (!$extension_instance_found) CRM_Core_Error::fatal(
*/
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 )"
+ "billing_mode IN ( 1, 3 ) AND payment_type = 1"
);
if (count($processors) > 0) {
$newCredit = TRUE;