本文整理汇总了PHP中CRM_Contribute_Form_Contribution_Confirm::postProcess方法的典型用法代码示例。如果您正苦于以下问题:PHP CRM_Contribute_Form_Contribution_Confirm::postProcess方法的具体用法?PHP CRM_Contribute_Form_Contribution_Confirm::postProcess怎么用?PHP CRM_Contribute_Form_Contribution_Confirm::postProcess使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类CRM_Contribute_Form_Contribution_Confirm
的用法示例。
在下文中一共展示了CRM_Contribute_Form_Contribution_Confirm::postProcess方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: submit
/**
* Static submit function allowing tests (& api access although this is being built slowly)
* @param $params
*/
static function submit($params)
{
$form = new CRM_Contribute_Form_Contribution_Confirm();
$form->_id = $params['id'];
CRM_Contribute_BAO_ContributionPage::setValues($form->_id, $form->_values);
$form->_separateMembershipPayment = CRM_Contribute_BAO_ContributionPage::getIsMembershipPayment($form->_id);
//this way the mocked up controller ignores the session stuff
$_SERVER['REQUEST_METHOD'] = 'GET';
$form->controller = new CRM_Contribute_Controller_Contribution();
$params['invoiceID'] = md5(uniqid(rand(), TRUE));
$paramsProcessedForForm = $form->_params = self::getFormParams($params['id'], $params);
$form->_amount = $params['amount'];
$priceSetID = $form->_params['priceSetId'] = $paramsProcessedForForm['price_set_id'];
$priceFields = CRM_Price_BAO_PriceSet::getSetDetail($priceSetID);
$priceSetFields = reset($priceFields);
$form->_values['fee'] = $priceSetFields['fields'];
$form->_priceSetId = $priceSetID;
$form->setFormAmountFields($priceSetID);
if (!empty($params['payment_processor'])) {
$form->_paymentProcessor = civicrm_api3('payment_processor', 'getsingle', array('id' => $params['payment_processor']));
}
$priceFields = $priceFields[$priceSetID]['fields'];
CRM_Price_BAO_PriceSet::processAmount($priceFields, $paramsProcessedForForm, $lineItems, 'civicrm_contribution');
$form->_lineItem = array($priceSetID => $lineItems);
$form->postProcess();
}