本文整理汇总了PHP中CRM_Financial_BAO_PaymentProcessor::hasPaymentProcessorSupporting方法的典型用法代码示例。如果您正苦于以下问题:PHP CRM_Financial_BAO_PaymentProcessor::hasPaymentProcessorSupporting方法的具体用法?PHP CRM_Financial_BAO_PaymentProcessor::hasPaymentProcessorSupporting怎么用?PHP CRM_Financial_BAO_PaymentProcessor::hasPaymentProcessorSupporting使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类CRM_Financial_BAO_PaymentProcessor
的用法示例。
在下文中一共展示了CRM_Financial_BAO_PaymentProcessor::hasPaymentProcessorSupporting方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: assignProcessors
/**
* Assign $this->processors, $this->recurPaymentProcessors, and related Smarty variables
*/
public function assignProcessors()
{
//ensure that processor has a valid config
//only valid processors get display to user
if ($this->_mode) {
$this->assign('processorSupportsFutureStartDate', CRM_Financial_BAO_PaymentProcessor::hasPaymentProcessorSupporting(array('supportsFutureRecurStartDate')));
$this->_paymentProcessors = $this->getValidProcessors();
if (!isset($this->_paymentProcessor['id'])) {
// if the payment processor isn't set yet (as indicated by the presence of an id,) we'll grab the first one which should be the default
$this->_paymentProcessor = reset($this->_paymentProcessors);
}
if (empty($this->_paymentProcessors)) {
throw new CRM_Core_Exception(ts('You will need to configure the %1 settings for your Payment Processor before you can submit a credit card transactions.', array(1 => $this->_mode)));
}
$this->_processors = array();
foreach ($this->_paymentProcessors as $id => $processor) {
$this->_processors[$id] = ts($processor['name']);
if (!empty($processor['description'])) {
$this->_processors[$id] .= ' : ' . ts($processor['description']);
}
}
//get the valid recurring processors.
$test = strtolower($this->_mode) == 'test' ? TRUE : FALSE;
$recurring = CRM_Core_PseudoConstant::paymentProcessor(FALSE, $test, 'is_recur = 1');
$this->_recurPaymentProcessors = array_intersect_key($this->_processors, $recurring);
}
$this->assign('recurringPaymentProcessorIds', empty($this->_recurPaymentProcessors) ? '' : implode(',', array_keys($this->_recurPaymentProcessors)));
// this required to show billing block
// @todo remove this assignment the billing block is now designed to be always included but will not show fieldsets unless those sets of fields are assigned
$this->assign_by_ref('paymentProcessor', $processor);
}
示例2: isEnabledBackOfficeCreditCardPayments
/**
* Is back office credit card processing enabled for this site - ie are there any installed processors that support
* it?
* This function is used for determining whether to show the submit credit card link, not for determining which processors to show, hence
* it is a config var
* @return bool
*/
public static function isEnabledBackOfficeCreditCardPayments()
{
return CRM_Financial_BAO_PaymentProcessor::hasPaymentProcessorSupporting(array('BackOffice'));
}
示例3: assignProcessors
/**
* Assign $this->processors, $this->recurPaymentProcessors, and related Smarty variables
*/
public function assignProcessors()
{
//ensure that processor has a valid config
//only valid processors get display to user
if ($this->_mode) {
$this->assign('processorSupportsFutureStartDate', CRM_Financial_BAO_PaymentProcessor::hasPaymentProcessorSupporting(array('FutureRecurStartDate')));
$this->_paymentProcessors = $this->getValidProcessors();
if (!isset($this->_paymentProcessor['id'])) {
// if the payment processor isn't set yet (as indicated by the presence of an id,) we'll grab the first one which should be the default
$this->_paymentProcessor = reset($this->_paymentProcessors);
}
if (empty($this->_paymentProcessors)) {
throw new CRM_Core_Exception(ts('You will need to configure the %1 settings for your Payment Processor before you can submit a credit card transactions.', array(1 => $this->_mode)));
}
$this->_processors = array();
foreach ($this->_paymentProcessors as $id => $processor) {
// @todo review this. The inclusion of this IF was to address test processors being incorrectly loaded.
// However the function $this->getValidProcessors() is expected to only return the processors relevant
// to the mode (using the actual id - ie. the id of the test processor for the test processor).
// for some reason there was a need to filter here per commit history - but this indicates a problem
// somewhere else.
if ($processor['is_test'] == ($this->_mode == 'test')) {
$this->_processors[$id] = ts($processor['name']);
if (!empty($processor['description'])) {
$this->_processors[$id] .= ' : ' . ts($processor['description']);
}
if ($processor['is_recur']) {
$this->_recurPaymentProcessors[$id] = $this->_processors[$id];
}
}
}
CRM_Financial_Form_Payment::addCreditCardJs();
}
$this->assign('recurringPaymentProcessorIds', empty($this->_recurPaymentProcessors) ? '' : implode(',', array_keys($this->_recurPaymentProcessors)));
// this required to show billing block
// @todo remove this assignment the billing block is now designed to be always included but will not show fieldsets unless those sets of fields are assigned
$this->assign_by_ref('paymentProcessor', $processor);
}