本文整理汇总了PHP中EE_Transaction::status_ID方法的典型用法代码示例。如果您正苦于以下问题:PHP EE_Transaction::status_ID方法的具体用法?PHP EE_Transaction::status_ID怎么用?PHP EE_Transaction::status_ID使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类EE_Transaction
的用法示例。
在下文中一共展示了EE_Transaction::status_ID方法的7个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: log
/**
* debug
*
* @param string $class
* @param string $func
* @param string $line
* @param \EE_Transaction $transaction
* @param array $info
* @param bool $display_request
*/
protected function log($class = '', $func = '', $line = '', EE_Transaction $transaction, $info = array(), $display_request = false)
{
if (WP_DEBUG && false) {
if ($transaction instanceof EE_Transaction) {
// don't serialize objects
$info = EEH_Debug_Tools::strip_objects($info);
if ($transaction->ID()) {
$info['TXN_status'] = $transaction->status_ID();
$info['TXN_reg_steps'] = $transaction->reg_steps();
$index = 'EE_Transaction: ' . $transaction->ID();
EEH_Debug_Tools::log($class, $func, $line, $info, $display_request, $index);
}
}
}
}
示例2: log
/**
* debug
*
* @param string $class
* @param string $func
* @param string $line
* @param array $info
* @param bool $display_request
*/
function log($class = '', $func = '', $line = '', $info = array(), $display_request = false)
{
if (WP_DEBUG && false) {
$debug_data = get_option('EE_DEBUG_SPCO_' . EE_Session::instance()->id(), array());
$default_data = array($class => $func . '() : ' . $line, 'request->step' => $this->step, 'request->action' => $this->action, 'current_step->slug' => $this->current_step instanceof EE_SPCO_Reg_Step ? $this->current_step->slug() : '', 'current_step->completed' => $this->current_step instanceof EE_SPCO_Reg_Step ? $this->current_step->completed() : '', 'txn_status_updated' => $this->txn_status_updated, 'reg_status_updated' => $this->reg_status_updated, 'reg_url_link' => $this->reg_url_link, 'REQ' => $display_request ? $_REQUEST : '');
if ($this->transaction instanceof EE_Transaction) {
$default_data['TXN_status'] = $this->transaction->status_ID();
$default_data['TXN_reg_steps'] = $this->transaction->reg_steps();
foreach ($this->transaction->registrations($this->reg_cache_where_params) as $REG_ID => $registration) {
$default_data['registrations'][$REG_ID] = $registration->status_ID();
}
if ($this->transaction->ID()) {
$TXN_ID = 'EE_Transaction: ' . $this->transaction->ID();
// don't serialize objects
$info = $this->_strip_objects($info);
if (!isset($debug_data[$TXN_ID])) {
$debug_data[$TXN_ID] = array();
}
$debug_data[$TXN_ID][microtime()] = array_merge($default_data, $info);
update_option('EE_DEBUG_SPCO_' . EE_Session::instance()->id(), $debug_data);
}
}
}
}
示例3: update_transaction_status_based_on_total_paid
/**
* possibly toggles TXN status
*
* @param EE_Transaction $transaction
* @param boolean $update_txn whether to save the TXN
* @return boolean whether the TXN was saved
* @throws \EE_Error
*/
public function update_transaction_status_based_on_total_paid(EE_Transaction $transaction, $update_txn = TRUE)
{
// verify transaction
if (!$transaction instanceof EE_Transaction) {
EE_Error::add_error(__('Please provide a valid EE_Transaction object.', 'event_espresso'), __FILE__, __FUNCTION__, __LINE__);
return FALSE;
}
// set incoming TXN_Status
$this->set_old_txn_status($transaction->status_ID());
// set transaction status based on comparison of TXN_paid vs TXN_total
if (EEH_Money::compare_floats($transaction->paid(), $transaction->total(), '>')) {
$new_txn_status = EEM_Transaction::overpaid_status_code;
} else {
if (EEH_Money::compare_floats($transaction->paid(), $transaction->total())) {
$new_txn_status = EEM_Transaction::complete_status_code;
} else {
if (EEH_Money::compare_floats($transaction->paid(), $transaction->total(), '<')) {
$new_txn_status = EEM_Transaction::incomplete_status_code;
} else {
EE_Error::add_error(__('The total paid calculation for this transaction is inaccurate.', 'event_espresso'), __FILE__, __FUNCTION__, __LINE__);
return FALSE;
}
}
}
if ($new_txn_status !== $transaction->status_ID()) {
// set incoming TXN_Status
$this->set_new_txn_status($new_txn_status);
$transaction->set_status($new_txn_status);
if ($update_txn) {
return $transaction->save() ? TRUE : FALSE;
}
}
return FALSE;
}
示例4: _update_server_wait_time
/**
* _update_server_wait_time
*
* @access public
* @param array $thank_you_page_data thank you page portion of the incoming JSON array from the WP heartbeat data
* @return array
*/
private function _update_server_wait_time($thank_you_page_data = array())
{
$response['espresso_thank_you_page'] = array('still_waiting' => isset($thank_you_page_data['initial_access']) ? time() - $thank_you_page_data['initial_access'] : 0, 'txn_status' => $this->_current_txn->status_ID());
return $response;
}
示例5: update_transaction_and_registrations_after_checkout_or_payment
/**
* update_transaction_and_registrations_after_checkout_or_payment
* cycles thru related registrations and calls update_registration_after_checkout_or_payment() on each
*
* @param EE_Transaction $transaction
* @param \EE_Payment | NULL $payment
* @param array $registration_query_params - array of query WHERE params to use when retrieving cached registrations from a transaction
* @throws \EE_Error
* @return array
*/
public function update_transaction_and_registrations_after_checkout_or_payment(EE_Transaction $transaction, $payment = NULL, $registration_query_params = array())
{
// set incoming TXN_Status, and consider it new since old status should have been set
$this->set_new_txn_status($transaction->status_ID());
do_action('AHEE_log', __FILE__, __FUNCTION__, $transaction->status_ID(), '$transaction->status_ID()');
// make sure some query params are set for retrieving registrations
$this->_set_registration_query_params($registration_query_params);
// get final reg step status
$finalized = $this->final_reg_step_completed($transaction);
// if the 'finalize_registration' step has been initiated (has a timestamp) but has not yet been fully completed (TRUE)
if (is_numeric($finalized) && $finalized !== true) {
$this->set_reg_step_completed($transaction, 'finalize_registration');
$finalized = true;
}
$transaction->save();
// array of details to aid in decision making by systems
$update_params = array('old_txn_status' => $this->old_txn_status(), 'new_txn_status' => $this->new_txn_status(), 'finalized' => $finalized, 'revisit' => $this->_revisit, 'payment_updates' => $payment instanceof EE_Payment ? TRUE : FALSE, 'last_payment' => $payment);
// now update the registrations and add the results to our $update_params
$update_params['status_updates'] = $this->_call_method_on_registrations_via_Registration_Processor('update_registration_after_checkout_or_payment', $transaction, $this->_registration_query_params, $update_params);
// send messages
/** @type EE_Registration_Processor $registration_processor */
$registration_processor = EE_Registry::instance()->load_class('Registration_Processor');
$registration_processor->trigger_registration_update_notifications($transaction->primary_registration(), $update_params);
do_action('AHEE__EE_Transaction_Processor__update_transaction_and_registrations_after_checkout_or_payment', $transaction, $update_params);
return $update_params;
}
示例6:
/**
* column_STS_ID
* @param \EE_Transaction $item
* @return string
*/
function column_STS_ID(EE_Transaction $item)
{
return '<span class="ee-status-strip ee-status-strip-td txn-status-' . $item->status_ID() . '"></span>';
}
开发者ID:robert-osborne,项目名称:event-espresso-core-1,代码行数:9,代码来源:EE_Admin_Transactions_List_Table.class.php
示例7: check_for_completed_transaction
/**
* Checks if the provided transaction is completed. If so, clears the session and handles
* the logic of finalizing the transaction
* @param EE_Transaction $transaction
*/
public function check_for_completed_transaction(EE_Transaction $transaction)
{
//throw new Exception("unfinished. This function should check for a completed transaction. If completed, clear some session etc
require_once EE_MODELS . 'EEM_Transaction.model.php';
if ($transaction->status_ID() == EEM_Transaction::complete_status_code) {
$this->reset_session_data();
}
}