当前位置: 首页>>代码示例>>PHP>>正文


PHP CRM_Contribute_Form_Contribution_Confirm::set方法代码示例

本文整理汇总了PHP中CRM_Contribute_Form_Contribution_Confirm::set方法的典型用法代码示例。如果您正苦于以下问题:PHP CRM_Contribute_Form_Contribution_Confirm::set方法的具体用法?PHP CRM_Contribute_Form_Contribution_Confirm::set怎么用?PHP CRM_Contribute_Form_Contribution_Confirm::set使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在CRM_Contribute_Form_Contribution_Confirm的用法示例。


在下文中一共展示了CRM_Contribute_Form_Contribution_Confirm::set方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: processSecondaryFinancialTransaction

 /**
  * Where a second separate financial transaction is supported we will process it here.
  *
  * @param int $contactID
  * @param CRM_Contribute_Form_Contribution_Confirm $form
  * @param array $tempParams
  * @param bool $isTest
  * @param array $lineItems
  * @param $minimumFee
  * @param int $financialTypeID
  *
  * @throws CRM_Core_Exception
  * @throws Exception
  * @return CRM_Contribute_BAO_Contribution
  */
 protected function processSecondaryFinancialTransaction($contactID, &$form, $tempParams, $isTest, $lineItems, $minimumFee, $financialTypeID)
 {
     $financialType = new CRM_Financial_DAO_FinancialType();
     $financialType->id = $financialTypeID;
     $financialType->find(TRUE);
     $tempParams['amount'] = $minimumFee;
     $tempParams['invoiceID'] = md5(uniqid(rand(), TRUE));
     $isRecur = CRM_Utils_Array::value('is_recur', $tempParams);
     //assign receive date when separate membership payment
     //and contribution amount not selected.
     if ($form->_amount == 0) {
         $now = date('YmdHis');
         $form->_params['receive_date'] = $now;
         $receiveDate = CRM_Utils_Date::mysqlToIso($now);
         $form->set('params', $form->_params);
         $form->assign('receive_date', $receiveDate);
     }
     $form->set('membership_amount', $minimumFee);
     $form->assign('membership_amount', $minimumFee);
     // we don't need to create the user twice, so lets disable cms_create_account
     // irrespective of the value, CRM-2888
     $tempParams['cms_create_account'] = 0;
     //set this variable as we are not creating pledge for
     //separate membership payment contribution.
     //so for differentiating membership contribution from
     //main contribution.
     $form->_params['separate_membership_payment'] = 1;
     $contributionParams = array('contact_id' => $contactID, 'line_item' => $lineItems, 'is_test' => $isTest, 'campaign_id' => CRM_Utils_Array::value('campaign_id', $tempParams, CRM_Utils_Array::value('campaign_id', $form->_values)), 'contribution_page_id' => $form->_id, 'source' => CRM_Utils_Array::value('source', $tempParams, CRM_Utils_Array::value('description', $tempParams)));
     $isMonetary = !empty($form->_values['is_monetary']);
     if ($isMonetary) {
         if (empty($paymentParams['is_pay_later'])) {
             $contributionParams['payment_instrument_id'] = $form->_paymentProcessor['payment_instrument_id'];
         }
     }
     $membershipContribution = CRM_Contribute_Form_Contribution_Confirm::processFormContribution($form, $tempParams, $tempParams, $contributionParams, $financialType, TRUE, $form->_bltID, $isRecur);
     $result = array();
     if ($form->_values['is_monetary'] && !$form->_params['is_pay_later'] && $minimumFee > 0.0) {
         // At the moment our tests are calling this form in a way that leaves 'object' empty. For
         // now we compensate here.
         if (empty($form->_paymentProcessor['object'])) {
             $payment = Civi\Payment\System::singleton()->getByProcessor($this->_paymentProcessor);
         } else {
             $payment = $form->_paymentProcessor['object'];
         }
         $result = $payment->doPayment($tempParams, 'contribute');
         $form->set('membership_trx_id', $result['trxn_id']);
         $form->assign('membership_trx_id', $result['trxn_id']);
     }
     return array($membershipContribution, $result);
 }
开发者ID:hyebahi,项目名称:civicrm-core,代码行数:65,代码来源:Confirm.php

示例2: processSecondaryFinancialTransaction

 /**
  * Where a second separate financial transaction is supported we will process it here.
  *
  * @param int $contactID
  * @param CRM_Contribute_Form_Contribution_Confirm $form
  * @param array $tempParams
  * @param bool $isTest
  * @param array $lineItems
  * @param $minimumFee
  * @param int $financialTypeID
  *
  * @throws CRM_Core_Exception
  * @throws Exception
  * @return CRM_Contribute_BAO_Contribution
  */
 protected function processSecondaryFinancialTransaction($contactID, &$form, $tempParams, $isTest, $lineItems, $minimumFee, $financialTypeID)
 {
     $financialType = new CRM_Financial_DAO_FinancialType();
     $financialType->id = $financialTypeID;
     $financialType->find(TRUE);
     $tempParams['amount'] = $minimumFee;
     $tempParams['invoiceID'] = md5(uniqid(rand(), TRUE));
     $result = NULL;
     if ($form->_values['is_monetary'] && !$form->_params['is_pay_later'] && $minimumFee > 0.0) {
         // At the moment our tests are calling this form in a way that leaves 'object' empty. For
         // now we compensate here.
         if (empty($form->_paymentProcessor['object'])) {
             $payment = Civi\Payment\System::singleton()->getByProcessor($this->_paymentProcessor);
         } else {
             $payment = $form->_paymentProcessor['object'];
         }
         $result = $payment->doPayment($tempParams, 'contribute');
     }
     //assign receive date when separate membership payment
     //and contribution amount not selected.
     if ($form->_amount == 0) {
         $now = date('YmdHis');
         $form->_params['receive_date'] = $now;
         $receiveDate = CRM_Utils_Date::mysqlToIso($now);
         $form->set('params', $form->_params);
         $form->assign('receive_date', $receiveDate);
     }
     $form->set('membership_trx_id', $result['trxn_id']);
     $form->set('membership_amount', $minimumFee);
     $form->assign('membership_trx_id', $result['trxn_id']);
     $form->assign('membership_amount', $minimumFee);
     // we don't need to create the user twice, so lets disable cms_create_account
     // irrespective of the value, CRM-2888
     $tempParams['cms_create_account'] = 0;
     //CRM-16165, scenarios are
     // 1) If contribution is_pay_later and if contribution amount is > 0.0 we set pending = TRUE, vice-versa FALSE
     // 2) If not pay later but auto-renewal membership is chosen then pending = TRUE as it later triggers
     //   pending recurring contribution, vice-versa FALSE
     $pending = $form->_params['is_pay_later'] ? $minimumFee > 0.0 ? TRUE : FALSE : (!empty($form->_params['auto_renew']) ? TRUE : FALSE);
     //set this variable as we are not creating pledge for
     //separate membership payment contribution.
     //so for differentiating membership contribution from
     //main contribution.
     $form->_params['separate_membership_payment'] = 1;
     $membershipContribution = CRM_Contribute_Form_Contribution_Confirm::processFormContribution($form, $tempParams, $result, $contactID, $financialType, $pending, TRUE, $isTest, $lineItems, $form->_bltID);
     return $membershipContribution;
 }
开发者ID:rajeshrhino,项目名称:civicrm-core,代码行数:62,代码来源:Confirm.php


注:本文中的CRM_Contribute_Form_Contribution_Confirm::set方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。