本文整理匯總了PHP中CRM_Contribute_Form_Contribution_Confirm::processFormSubmission方法的典型用法代碼示例。如果您正苦於以下問題:PHP CRM_Contribute_Form_Contribution_Confirm::processFormSubmission方法的具體用法?PHP CRM_Contribute_Form_Contribution_Confirm::processFormSubmission怎麽用?PHP CRM_Contribute_Form_Contribution_Confirm::processFormSubmission使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類CRM_Contribute_Form_Contribution_Confirm
的用法示例。
在下文中一共展示了CRM_Contribute_Form_Contribution_Confirm::processFormSubmission方法的1個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。
示例1: submit
/**
* Submit function.
*
* @param array $params
*
* @throws CiviCRM_API3_Exception
*/
public 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'];
// hack these in for test support.
$form->_fields['billing_first_name'] = 1;
$form->_fields['billing_last_name'] = 1;
$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_id'])) {
$form->_paymentProcessor = civicrm_api3('payment_processor', 'getsingle', array('id' => $params['payment_processor_id']));
// The concept of contributeMode is deprecated as is the billing_mode concept.
if ($form->_paymentProcessor['billing_mode'] == 1) {
$form->_contributeMode = 'direct';
} else {
$form->_contributeMode = 'notify';
}
} else {
$form->_params['payment_processor_id'] = 0;
}
$priceFields = $priceFields[$priceSetID]['fields'];
CRM_Price_BAO_PriceSet::processAmount($priceFields, $paramsProcessedForForm, $lineItems, 'civicrm_contribution');
$form->_lineItem = array($priceSetID => $lineItems);
$form->processFormSubmission(CRM_Utils_Array::value('contact_id', $params));
}