當前位置: 首頁>>代碼示例>>PHP>>正文


PHP CRM_Contribute_BAO_ContributionPage::checkRecurPaymentProcessor方法代碼示例

本文整理匯總了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('&nbsp;&nbsp;', '&nbsp;&nbsp;', '&nbsp;&nbsp;', '<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('&nbsp;&nbsp;', '&nbsp;&nbsp;', '&nbsp;&nbsp;', '<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();
 }
開發者ID:ksecor,項目名稱:civicrm,代碼行數:63,代碼來源:Amount.php

示例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.');
 }
開發者ID:ksecor,項目名稱:civicrm,代碼行數:13,代碼來源:ContributionPageTest.php

示例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);
 }
開發者ID:prashantgajare,項目名稱:civicrm-core,代碼行數:15,代碼來源:ContributionPageTest.php


注:本文中的CRM_Contribute_BAO_ContributionPage::checkRecurPaymentProcessor方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。