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


PHP EE_Transaction::is_completed方法代码示例

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


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

示例1: init

 /**
  * 	init
  *
  *  @access 	public
  *  @return 	void
  */
 public function init()
 {
     $this->_get_reg_url_link();
     if (!$this->get_txn()) {
         EE_Registry::instance()->load_helper('HTML');
         echo EEH_HTML::div(EEH_HTML::h4(__('We\'re sorry...', 'event_espresso'), '', '') . sprintf(__('This is a system page for displaying transaction information after a purchase.%1$sYou are most likely seeing this notice because you have navigated to this page%1$sthrough some means other than completing a transaction.%1$sSorry for the disappointment, but you will most likely find nothing of interest here.%1$s%1$s', 'event_espresso'), '<br/>'), '', 'ee-attention');
         return NULL;
     }
     // if we've made it to the Thank You page, then let's toggle any "Failed" transactions to "Incomplete"
     if ($this->_current_txn->status_ID() == EEM_Transaction::failed_status_code) {
         $this->_current_txn->set_status(EEM_Transaction::incomplete_status_code);
         $this->_current_txn->save();
     }
     $this->_primary_registrant = $this->_current_txn->primary_registration() instanceof EE_Registration ? $this->_current_txn->primary_registration() : NULL;
     $this->_is_primary = $this->_primary_registrant->reg_url_link() == $this->_reg_url_link ? TRUE : FALSE;
     $show_try_pay_again_link_default = apply_filters('AFEE__EES_Espresso_Thank_You__init__show_try_pay_again_link_default', TRUE);
     // txn status ?
     if ($this->_current_txn->is_completed()) {
         $this->_show_try_pay_again_link = $show_try_pay_again_link_default;
     } else {
         if ($this->_current_txn->is_incomplete() && ($this->_primary_registrant->is_approved() || $this->_primary_registrant->is_pending_payment())) {
             $this->_show_try_pay_again_link = TRUE;
         } else {
             if ($this->_primary_registrant->is_approved() || $this->_primary_registrant->is_pending_payment()) {
                 // its pending
                 $this->_show_try_pay_again_link = isset(EE_Registry::instance()->CFG->registration->show_pending_payment_options) && EE_Registry::instance()->CFG->registration->show_pending_payment_options ? TRUE : $show_try_pay_again_link_default;
             } else {
                 $this->_show_try_pay_again_link = $show_try_pay_again_link_default;
             }
         }
     }
     $this->_payments_closed = !$this->_current_txn->payment_method() instanceof EE_Payment_Method ? TRUE : FALSE;
     if (!$this->_current_txn->payment_method() instanceof EE_Payment_Method || $this->_current_txn->payment_method() instanceof EE_Payment_Method && $this->_current_txn->payment_method()->is_off_line()) {
         $this->_is_offline_payment_method = true;
     } else {
         $this->_is_offline_payment_method = false;
     }
     // link to SPCO
     $revisit_spco_url = add_query_arg(array('ee' => '_register', 'revisit' => TRUE, 'e_reg_url_link' => $this->_reg_url_link), EE_Registry::instance()->CFG->core->reg_page_url());
     // link to SPCO payment_options
     $this->_SPCO_payment_options_url = $this->_primary_registrant instanceof EE_Registration ? $this->_primary_registrant->payment_overview_url() : add_query_arg(array('step' => 'payment_options'), $revisit_spco_url);
     // link to SPCO attendee_information
     $this->_SPCO_attendee_information_url = $this->_primary_registrant instanceof EE_Registration ? $this->_primary_registrant->edit_attendee_information_url() : FALSE;
     EE_Registry::instance()->load_helper('Template');
     EE_Registry::instance()->load_helper('Template_Validator');
     do_action('AHEE__EES_Espresso_Thank_You__init_end', $this->_current_txn);
     // set no cache headers and constants
     EE_System::do_not_cache();
 }
开发者ID:kaffiemetsuker,项目名称:event-espresso-core,代码行数:55,代码来源:EES_Espresso_Thank_You.shortcode.php

示例2: init

 /**
  * 	init
  *
  *  @access 	public
  *  @return 	void
  */
 public function init()
 {
     $this->_get_reg_url_link();
     if (!$this->get_txn()) {
         return NULL;
     }
     // if we've made it to the Thank You page, then let's toggle any "Failed" transactions to "Incomplete"
     if ($this->_current_txn->status_ID() == EEM_Transaction::failed_status_code) {
         $this->_current_txn->set_status(EEM_Transaction::incomplete_status_code);
         $this->_current_txn->save();
     }
     $this->_primary_registrant = $this->_current_txn->primary_registration() instanceof EE_Registration ? $this->_current_txn->primary_registration() : NULL;
     $this->_is_primary = $this->_primary_registrant->reg_url_link() == $this->_reg_url_link ? TRUE : FALSE;
     $show_try_pay_again_link_default = apply_filters('AFEE__EES_Espresso_Thank_You__init__show_try_pay_again_link_default', TRUE);
     // txn status ?
     if ($this->_current_txn->is_completed()) {
         $this->_show_try_pay_again_link = $show_try_pay_again_link_default;
     } else {
         if ($this->_current_txn->is_incomplete() && ($this->_primary_registrant->is_approved() || $this->_primary_registrant->is_pending_payment())) {
             $this->_show_try_pay_again_link = TRUE;
         } else {
             if ($this->_primary_registrant->is_approved() || $this->_primary_registrant->is_pending_payment()) {
                 // its pending
                 $this->_show_try_pay_again_link = isset(EE_Registry::instance()->CFG->registration->show_pending_payment_options) && EE_Registry::instance()->CFG->registration->show_pending_payment_options ? TRUE : $show_try_pay_again_link_default;
             } else {
                 $this->_show_try_pay_again_link = $show_try_pay_again_link_default;
             }
         }
     }
     $this->_payments_closed = !$this->_current_txn->payment_method() instanceof EE_Payment_Method ? TRUE : FALSE;
     if (!$this->_current_txn->payment_method() instanceof EE_Payment_Method || $this->_current_txn->payment_method() instanceof EE_Payment_Method && $this->_current_txn->payment_method()->is_off_line()) {
         $this->_is_offline_payment_method = true;
     } else {
         $this->_is_offline_payment_method = false;
     }
     // link to SPCO
     $revisit_spco_url = add_query_arg(array('ee' => '_register', 'revisit' => TRUE, 'e_reg_url_link' => $this->_reg_url_link), EE_Registry::instance()->CFG->core->reg_page_url());
     // link to SPCO payment_options
     $this->_SPCO_payment_options_url = $this->_primary_registrant instanceof EE_Registration ? $this->_primary_registrant->payment_overview_url() : add_query_arg(array('step' => 'payment_options'), $revisit_spco_url);
     // link to SPCO attendee_information
     $this->_SPCO_attendee_information_url = $this->_primary_registrant instanceof EE_Registration ? $this->_primary_registrant->edit_attendee_information_url() : FALSE;
     EE_Registry::instance()->load_helper('Template');
     EE_Registry::instance()->load_helper('Template_Validator');
     do_action('AHEE__EES_Espresso_Thank_You__init_end', $this->_current_txn);
     // set no cache headers and constants
     EE_System::do_not_cache();
 }
开发者ID:vinylthieves,项目名称:kaylyn-kyle,代码行数:53,代码来源:EES_Espresso_Thank_You.shortcode.php

示例3: init

 /**
  * 	init
  *
  *  @access 	public
  *  @return 	void
  */
 public function init()
 {
     //get the transaction. yes, we may have just loaded it, but it may have been updated, or this may be via an ajax request
     $this->_current_txn = EE_Registry::instance()->load_model('Transaction')->get_transaction_from_reg_url_link($this->_reg_url_link);
     // verify TXN
     if (!$this->_current_txn instanceof EE_Transaction) {
         EE_Error::add_error(__('No transaction information could be retrieved or the transaction data is not of the correct type.', 'event_espresso'), __FILE__, __FUNCTION__, __LINE__);
         return;
     }
     // if we've made it to the Thank You page, then let's toggle any "Failed" transactions to "Incomplete"
     if ($this->_current_txn->status_ID() == EEM_Transaction::failed_status_code) {
         $this->_current_txn->set_status(EEM_Transaction::incomplete_status_code);
         $this->_current_txn->save();
     }
     $this->_primary_registrant = $this->_current_txn->primary_registration() instanceof EE_Registration ? $this->_current_txn->primary_registration() : NULL;
     $this->_is_primary = $this->_primary_registrant->reg_url_link() == $this->_reg_url_link ? TRUE : FALSE;
     // txn status ?
     if ($this->_current_txn->is_completed()) {
         $this->_show_try_pay_again_link = FALSE;
     } else {
         if ($this->_current_txn->is_incomplete() && ($this->_primary_registrant->is_approved() || $this->_primary_registrant->is_pending_payment())) {
             $this->_show_try_pay_again_link = TRUE;
         } else {
             if ($this->_primary_registrant->is_approved() || $this->_primary_registrant->is_pending_payment()) {
                 // its pending
                 $this->_show_try_pay_again_link = isset(EE_Registry::instance()->CFG->registration->show_pending_payment_options) && EE_Registry::instance()->CFG->registration->show_pending_payment_options ? TRUE : FALSE;
             } else {
                 $this->_show_try_pay_again_link = FALSE;
             }
         }
     }
     $this->_is_offline_payment_method = in_array($this->_current_txn->selected_gateway(TRUE), array('Bank', 'Check', 'Invoice'));
     if ($this->_current_txn->last_payment() instanceof EE_Payment && $this->_current_txn->last_payment()->gateway() != NULL) {
         $this->_is_offline_payment_method = in_array($this->_current_txn->last_payment()->gateway(), array('Bank', 'Check', 'Invoice'));
     }
     // link to SPCO
     $revisit_spco_url = add_query_arg(array('ee' => '_register', 'revisit' => TRUE, 'e_reg_url_link' => $this->_reg_url_link), EE_Registry::instance()->CFG->core->reg_page_url());
     // link to SPCO payment_options
     $this->_SPCO_payment_options_url = $this->_primary_registrant instanceof EE_Registration ? $this->_primary_registrant->payment_overview_url() : add_query_arg(array('step' => 'payment_options'), $revisit_spco_url);
     // link to SPCO attendee_information
     $this->_SPCO_attendee_information_url = $this->_primary_registrant instanceof EE_Registration ? $this->_primary_registrant->edit_attendee_information_url() : FALSE;
     EE_Registry::instance()->load_helper('Template');
     EE_Registry::instance()->load_helper('Template_Validator');
     do_action('AHEE__EES_Espresso_Thank_You__init_end', $this->_current_txn);
 }
开发者ID:antares-ff,项目名称:ANTARES-Test,代码行数:51,代码来源:EES_Espresso_Thank_You.shortcode.php

示例4: payment_required

 /**
  * payment_required
  * @return boolean
  */
 public function payment_required()
 {
     // if NOT:
     //		registration via admin
     //		completed TXN
     //		overpaid TXN
     //		free TXN ( total = 0.00 )
     // then payment required is TRUE
     return !($this->admin_request || $this->transaction->is_completed() || $this->transaction->is_overpaid() || $this->transaction->is_free()) ? TRUE : FALSE;
 }
开发者ID:rheator,项目名称:event-espresso-core,代码行数:14,代码来源:EE_Checkout.class.php

示例5: init


//.........这里部分代码省略.........
     // load classes
     if (!isset(EE_Registry::instance()->REQ)) {
         EE_Registry::instance()->load_core('Request_Handler');
     }
     EE_Registry::instance()->REQ->set_espresso_page(TRUE);
     //		printr( EE_Registry::instance()->REQ, 'EE_Registry::instance()->REQ  <br /><span style="font-size:10px;font-weight:normal;">' . __FILE__ . '<br />line no: ' . __LINE__ . '</span>', 'auto' );
     // make sure reg steps array is setup
     if (empty(self::$_reg_steps)) {
         EED_Single_Page_Checkout::setup_reg_steps_array();
     }
     $this->_continue_reg = apply_filters('FHEE__EED_Single_Page_Checkout__init___continue_reg', TRUE);
     $this->set_templates();
     $this->_reg_page_base_url = get_permalink(EE_Registry::instance()->CFG->core->reg_page_id);
     // grab what step we're on
     $this->_current_step = !empty($this->_current_step) ? $this->_current_step : 'attendee_information';
     $this->_current_step = EE_Registry::instance()->REQ->is_set('step') ? EE_Registry::instance()->REQ->get('step') : $this->_current_step;
     // returning from the thank you page ?
     $this->_reg_url_link = EE_Registry::instance()->REQ->is_set('e_reg_url_link') ? EE_Registry::instance()->REQ->get('e_reg_url_link') : FALSE;
     // if reg_url_link is present in the request, then we are only being sent back to SPCO to retry the payment
     if ($this->_reg_url_link) {
         // are we returning to the page to edit attendee info or retry a payment?
         $this->_revisit = EE_Registry::instance()->REQ->is_set('revisit') && EE_Registry::instance()->REQ->get('revisit') == 1 ? TRUE : FALSE;
         if ($this->_revisit) {
             // remove all other pages from the reg steps array except the one required by the revisit
             self::$_reg_steps = array_intersect_key(self::$_reg_steps, array($this->_current_step => TRUE));
         }
         // let's get that transaction data
         $this->_transaction = EE_Registry::instance()->load_model('Transaction')->get_transaction_from_reg_url_link();
         //			printr( $this->_transaction, 'transaction_from_reg_url_link  <br /><span style="font-size:10px;font-weight:normal;">' . __FILE__ . '<br />line no: ' . __LINE__ . '</span>', 'auto' );
         //			d( $this->_transaction );
         // verify transaction
         if ($this->_transaction instanceof EE_Transaction) {
             //				d( $this->_transaction );
             // and get the cart that was used in the original txn
             $this->_cart = EE_Cart::get_cart_from_txn($this->_transaction);
             //				if (  $this->_transaction instanceof EE_Transaction && $this->_revisit ) {
             $registrations = $this->_transaction->registrations(array(), TRUE);
             usort($registrations, array('EED_Single_Page_Checkout', 'sort_registrations_by_REG_count'));
             foreach ($registrations as $registration) {
                 //d( $registration );
                 // verify registration
                 if ($registration instanceof EE_Registration) {
                     // we display all attendee info for the primary registrant
                     if ($this->_reg_url_link == $registration->reg_url_link() && $registration->is_primary_registrant()) {
                         $this->_primary_revisit = TRUE;
                         break;
                     } else {
                         if ($this->_reg_url_link != $registration->reg_url_link()) {
                             // but hide info if it doesn't belong to you
                             $this->_transaction->clear_cache('Registration', $registration->ID());
                         }
                     }
                 }
             }
             //				}
         } else {
             EE_Error::add_error(__('Your Registration and Transaction information could not be retrieved from the db.', 'event_espresso'), __FILE__, __FUNCTION__, __LINE__);
         }
     } else {
         $this->_transaction = EE_Registry::instance()->SSN->get_session_data('transaction');
         //			printr( $this->_transaction, '$this->_transaction <br /><span style="font-size:10px;font-weight:normal;">' . __FILE__ . '<br />line no: ' . __LINE__ . '</span>', 'auto' );
         $this->_cart = EE_Registry::instance()->load_core('Cart');
         //			printr( $this->_transaction->registrations(), '$this->_transaction->registrations()  <br /><span style="font-size:10px;font-weight:normal;">' . __FILE__ . '<br />line no: ' . __LINE__ . '</span>', 'auto' );
     }
     // verify cart
     if (!$this->_cart instanceof EE_Cart) {
         $this->_cart = EE_Registry::instance()->load_core('Cart');
     }
     // verify transaction
     if ($this->_transaction instanceof EE_Transaction) {
         //printr( $this->_transaction->registrations(), '$transaction->registrations() <br /><span style="font-size:10px;font-weight:normal;">' . __FILE__ . '<br />line no: ' . __LINE__ . '</span>', 'auto' );
         $ID = $this->_transaction->ID();
         if (!$this->_revisit && $ID) {
             // but if this transaction has already been saved to the db earlier in the same session (ie: it's not a revisit)... then let's pull that
             if (!($this->_transaction = EEM_Transaction::instance()->get_one_by_ID($ID))) {
                 EE_Error::add_error(__('The Transaction could not be retrieved from the db when attempting to process your registration information', 'event_espresso'), __FILE__, __FUNCTION__, __LINE__);
                 return;
             }
         }
     } elseif (!$this->_revisit) {
         $this->_initialize_transaction();
     } else {
     }
     // and verify registrations have been set (first check cached REGs)
     if ($this->_transaction instanceof EE_Transaction && $this->_transaction->registrations(array(), TRUE) == NULL) {
         // then check the db
         if ($this->_transaction->registrations() == NULL) {
             $this->_initialize_registrations();
         }
     }
     // don't need payment options for a completed transaction (note: if we ever implement donations, then this will need overriding)
     if ($this->_transaction->is_completed() || $this->_transaction->is_overpaid()) {
         unset(self::$_reg_steps['payment_options']);
     }
     // and the next step
     $this->_set_next_step();
     // load css and js
     add_action('wp_enqueue_scripts', array('EED_Single_Page_Checkout', 'load_css'), 10);
     add_action('wp_enqueue_scripts', array('EED_Single_Page_Checkout', 'load_js'), 10);
 }
开发者ID:antares-ff,项目名称:ANTARES-Test,代码行数:101,代码来源:EED_Single_Page_Checkout.module.php


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