本文整理汇总了PHP中EE_Transaction::set_txn_session_data方法的典型用法代码示例。如果您正苦于以下问题:PHP EE_Transaction::set_txn_session_data方法的具体用法?PHP EE_Transaction::set_txn_session_data怎么用?PHP EE_Transaction::set_txn_session_data使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类EE_Transaction
的用法示例。
在下文中一共展示了EE_Transaction::set_txn_session_data方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: process_registration_from_admin
/**
* This processes the registration form from the admin and returns either the true or false depending on the success of the process.
*
* Note that this method handles not only validating the registration form but also saving to the database all the data in the session.
*
* @access public
* @return mixed bool|int (either false on fail OR TXN id on success)
*/
public function process_registration_from_admin()
{
//nonce check was done in admin so no need to do here.
//first lets validate the registration form
$this->init_for_admin();
//if failure in processing attendee info then let's get out early
if (!$this->_process_attendee_information()) {
return FALSE;
}
// same deal when saving everything
if (!$this->_save_all_registration_information()) {
return FALSE;
}
//all is good so let's continue with finalizing the registration.
EE_Registry::instance()->SSN->set_session_data(array('transaction', NULL));
$this->_transaction->set_txn_session_data(EE_Registry::instance()->SSN->get_session_data());
$this->_cart->get_grand_total()->save_this_and_descendants_to_txn($this->_transaction->ID());
//is this free event?
if ($this->_cart->get_grand_total()->total() == EEH_Template::format_currency(0, TRUE)) {
$this->_transaction->set_status(EEM_Transaction::complete_status_code);
} else {
$this->_transaction->set_status(EEM_Transaction::incomplete_status_code);
}
$this->_transaction->finalize(TRUE);
EE_Registry::instance()->SSN->clear_session(__CLASS__, __FUNCTION__);
return $this->_transaction->ID();
}
示例2: set_transaction
/**
* @param \EE_Transaction $transaction
* @return bool
*/
public function set_transaction(EE_Transaction $transaction)
{
// first remove the session from the transaction before we save the transaction in the session
$transaction->set_txn_session_data(NULL);
$this->_session_data['transaction'] = $transaction;
return TRUE;
}
示例3: _clean_billing_info_in_session
/**
* Cleans the session so that it doesn't store the credit card or CVV to the DB
* @param EE_Transaction $transaction to also update
* @return void
*/
protected function _clean_billing_info_in_session($transaction)
{
$session_data = EE_Registry::instance()->SSN->get_session_data();
if (isset($session_data['billing_info']) && is_array($session_data['billing_info'])) {
foreach ($session_data['billing_info'] as $name => $billing_input_array) {
if ($billing_input_array['sanitize'] == 'ccard') {
$session_data['billing_info'][$name]['value'] = $this->MaskCreditCard($billing_input_array['value']);
} elseif ($billing_input_array['sanitize'] == 'ccv') {
$session_data['billing_info'][$name]['value'] = '';
}
}
}
$success = EE_Registry::instance()->SSN->update($session_data);
unset($session_data['transaction']);
$transaction->set_txn_session_data($session_data);
$transaction->save();
}