本文整理汇总了PHP中CRM_Contribute_BAO_ContributionPage::checkRecurPaymentProcessor方法的典型用法代码示例。如果您正苦于以下问题:PHP CRM_Contribute_BAO_ContributionPage::checkRecurPaymentProcessor方法的具体用法?PHP CRM_Contribute_BAO_ContributionPage::checkRecurPaymentProcessor怎么用?PHP CRM_Contribute_BAO_ContributionPage::checkRecurPaymentProcessor使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类CRM_Contribute_BAO_ContributionPage
的用法示例。
在下文中一共展示了CRM_Contribute_BAO_ContributionPage::checkRecurPaymentProcessor方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: buildQuickForm
/**
* Function to actually build the form
*
* @return void
* @access public
*/
public function buildQuickForm()
{
require_once 'CRM/Utils/Money.php';
// do u want to allow a free form text field for amount
$this->addElement('checkbox', 'is_allow_other_amount', ts('Allow other amounts'), null, array('onclick' => "minMax(this);showHideAmountBlock( this, 'is_allow_other_amount' );"));
$this->add('text', 'min_amount', ts('Minimum Amount'), array('size' => 8, 'maxlength' => 8));
$this->addRule('min_amount', ts('Please enter a valid money value (e.g. %1).', array(1 => CRM_Utils_Money::format('9.99', ' '))), 'money');
$this->add('text', 'max_amount', ts('Maximum Amount'), array('size' => 8, 'maxlength' => 8));
$this->addRule('max_amount', ts('Please enter a valid money value (e.g. %1).', array(1 => CRM_Utils_Money::format('99.99', ' '))), 'money');
$default = array();
for ($i = 1; $i <= self::NUM_OPTION; $i++) {
// label
$this->add('text', "label[{$i}]", ts('Label'), CRM_Core_DAO::getAttribute('CRM_Core_DAO_OptionValue', 'label'));
// value
$this->add('text', "value[{$i}]", ts('Value'), CRM_Core_DAO::getAttribute('CRM_Core_DAO_OptionValue', 'value'));
$this->addRule("value[{$i}]", ts('Please enter a valid money value (e.g. %1).', array(1 => CRM_Utils_Money::format('99.99', ' '))), 'money');
// default
$default[] = $this->createElement('radio', null, null, null, $i);
}
$this->addGroup($default, 'default');
$this->addElement('checkbox', 'amount_block_is_active', ts('Contribution Amounts section enabled'), null, array('onclick' => "showHideAmountBlock( this, 'amount_block_is_active' );"));
$this->addElement('checkbox', 'is_monetary', ts('Execute real-time monetary transactions'));
$paymentProcessor =& CRM_Core_PseudoConstant::paymentProcessor();
if (count($paymentProcessor)) {
$this->assign('paymentProcessor', $paymentProcessor);
}
$this->add('select', 'payment_processor_id', ts('Payment Processor'), array('' => ts('- select -')) + $paymentProcessor);
require_once "CRM/Contribute/BAO/ContributionPage.php";
//check if selected payment processor supports recurring payment
if (CRM_Contribute_BAO_ContributionPage::checkRecurPaymentProcessor($this->_id)) {
$this->addElement('checkbox', 'is_recur', ts('Recurring contributions'), null, array('onclick' => "return showHideByValue('is_recur',true,'recurFields','table-row','radio',false);"));
require_once 'CRM/Core/OptionGroup.php';
$this->addCheckBox('recur_frequency_unit', ts('Supported recurring units'), CRM_Core_OptionGroup::values('recur_frequency_units', false, false, false, null, 'name'), null, null, null, null, array(' ', ' ', ' ', '<br/>'));
$this->addElement('checkbox', 'is_recur_interval', ts('Support recurring intervals'));
}
// add pay later options
$this->addElement('checkbox', 'is_pay_later', ts('Pay later option'), null, array('onclick' => "payLater(this);"));
$this->addElement('textarea', 'pay_later_text', ts('Pay later label'), CRM_Core_DAO::getAttribute('CRM_Contribute_DAO_ContributionPage', 'pay_later_text'), false);
$this->addElement('textarea', 'pay_later_receipt', ts('Pay later instructions'), CRM_Core_DAO::getAttribute('CRM_Contribute_DAO_ContributionPage', 'pay_later_receipt'), false);
// add price set fields
require_once 'CRM/Price/BAO/Set.php';
$this->add('select', 'price_set_id', ts('Price Set'), array('' => ts('- none -')) + CRM_Price_BAO_Set::getAssoc(false, 'Contribution'), null, array('onchange' => "showHideAmountBlock( this.value, 'price_set_id' );"));
//CiviPledge fields.
$config =& CRM_Core_Config::singleton();
if (in_array('CiviPledge', $config->enableComponents)) {
$this->assign('civiPledge', true);
require_once 'CRM/Core/OptionGroup.php';
$this->addElement('checkbox', 'is_pledge_active', ts('Pledges'), null, array('onclick' => "showHideAmountBlock( this, 'is_pledge_active' ); return showHideByValue('is_pledge_active',true,'pledgeFields','table-row','radio',false);"));
$this->addCheckBox('pledge_frequency_unit', ts('Supported pledge frequencies'), CRM_Core_OptionGroup::values("recur_frequency_units", false, false, false, null, 'name'), null, null, null, null, array(' ', ' ', ' ', '<br/>'));
$this->addElement('checkbox', 'is_pledge_interval', ts('Allow frequency intervals'));
$this->addElement('text', 'initial_reminder_day', ts('Send payment reminder'), array('size' => 3));
$this->addElement('text', 'max_reminders', ts('Send up to'), array('size' => 3));
$this->addElement('text', 'additional_reminder_day', ts('Send additional reminders'), array('size' => 3));
}
$this->addFormRule(array('CRM_Contribute_Form_ContributionPage_Amount', 'formRule'), $this);
parent::buildQuickForm();
}
示例2: testcheckRecurPaymentProcessor
/**
* test checkRecurPaymentProcessor() method
*/
function testcheckRecurPaymentProcessor()
{
$paymentProcessor = PaypalPro::create();
$params = array('title' => 'Test Cotribution Page', 'contribution_type_id' => $this->_contributionTypeID, 'is_active' => 1, 'payment_processor_id' => $paymentProcessor);
require_once 'CRM/Contribute/BAO/ContributionPage.php';
$contributionpage = CRM_Contribute_BAO_ContributionPage::create($params, $ids);
$id = $contributionpage->id;
$checkRecurring = CRM_Contribute_BAO_ContributionPage::checkRecurPaymentProcessor($id);
$this->assertEquals($checkRecurring, false, 'Check for false return.');
}
示例3: testcheckRecurPaymentProcessor
/**
* test checkRecurPaymentProcessor() method
*/
function testcheckRecurPaymentProcessor()
{
//@todo paypalpro create seems to fail silently without causing this class to fail
// $this->paymentProcessorCreate may be a better option
$paymentProcessor = PaypalPro::create();
$params = array('title' => 'Test Contribution Page', 'financial_type_id' => $this->_financialTypeID, 'is_active' => 1, 'payment_processor_id' => $paymentProcessor);
$contributionpage = CRM_Contribute_BAO_ContributionPage::create($params);
$id = $contributionpage->id;
$checkRecurring = CRM_Contribute_BAO_ContributionPage::checkRecurPaymentProcessor($id);
$this->assertEquals($checkRecurring, FALSE, 'Check for false return.');
ContributionPage::delete($contributionpage->id);
}