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


PHP EE_Transaction类代码示例

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


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

示例1: get_cart_from_txn

 /**
  *	get_cart_from_reg_url_link
  *	@access public
  *	@return class instance
  */
 public static function get_cart_from_txn(EE_Transaction $transaction)
 {
     $grand_total = $transaction->total_line_item();
     $grand_total->get_items();
     $grand_total->tax_descendants();
     return EE_Cart::instance($grand_total);
 }
开发者ID:antares-ff,项目名称:ANTARES-Test,代码行数:12,代码来源:EE_Cart.core.php

示例2: thank_you_page_logic

 /**
  * Updates the transaction in the session to acknowledge the registrant is done
  * the registration process, all that remains is for them ot make the offline
  * payment. Was renamed from 'set_transaction_details' to 'thank_you_page()', because it served the same purpose
  * as it's parent's 'thank_you_page()', which is to update the transaction (but not the payment
  * because in this case no payment has been made)
  * @global type $EE_Session
  * @param EE_Transaction
  * @return void
  */
 public function thank_you_page_logic(EE_Transaction $transaction)
 {
     do_action('AHEE_log', __FILE__, __FUNCTION__, '');
     //check for an existing payment from this gateway
     $payments = $this->_PAY->get_all(array(array('PAY_gateway' => $this->gateway(), 'TXN_ID' => $transaction->ID())));
     //if it already exists, short-circuit updating the transaction
     if (empty($payments)) {
         $this->update_transaction_with_payment($transaction, null);
         $transaction->save();
     }
     //createa hackey payment object, but dont save it
     $payment = EE_Payment::new_instance(array('TXN_ID' => $transaction->ID(), 'STS_ID' => EEM_Payment::status_id_pending, 'PAY_timestamp' => current_time('timestamp'), 'PAY_amount' => $transaction->total(), 'PAY_gateway' => $this->_gateway_name));
     do_action('AHEE_EE_Gateway__update_transaction_with_payment__done', $transaction, $payment);
     parent::thank_you_page_logic($transaction);
 }
开发者ID:antares-ff,项目名称:ANTARES-Test,代码行数:25,代码来源:EE_Offline_Gateway.class.php

示例3: 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);
             }
         }
     }
 }
开发者ID:aaronfrey,项目名称:PepperLillie-GSP,代码行数:25,代码来源:EE_Processor_Base.class.php

示例4: generate_ONE_registration_from_line_item

 /**
  * generate_ONE_registration_from_line_item
  *
  * Although a ticket line item may have a quantity greater than 1,
  * this method will ONLY CREATE ONE REGISTRATION !!!
  * Regardless of the ticket line item quantity.
  * This means that any code calling this method is responsible for ensuring
  * that the final registration count matches the ticket line item quantity.
  * This was done to make it easier to match the number of registrations
  * to the number of tickets in the cart, when the cart has been edited
  * after SPCO has already been initialized. So if an additional ticket was added to the cart, you can simply pass
  * the line item to this method to add a second ticket, and in this case, you would not want to add 2 tickets.
  *
  * @param EE_Line_Item $line_item
  * @param \EE_Transaction $transaction
  * @param int $att_nmbr
  * @param int $total_ticket_count
  * @return \EE_Registration | null
  * @throws \EE_Error
  */
 public function generate_ONE_registration_from_line_item(EE_Line_Item $line_item, EE_Transaction $transaction, $att_nmbr = 1, $total_ticket_count = 1)
 {
     // grab the related ticket object for this line_item
     $ticket = $line_item->ticket();
     if (!$ticket instanceof EE_Ticket) {
         EE_Error::add_error(sprintf(__("Line item %s did not contain a valid ticket", "event_espresso"), $line_item->ID()), __FILE__, __FUNCTION__, __LINE__);
         return null;
     }
     $first_datetime = $ticket->get_first_related('Datetime');
     if (!$first_datetime instanceof EE_Datetime) {
         EE_Error::add_error(sprintf(__("The ticket (%s) is not associated with any valid datetimes.", "event_espresso"), $ticket->name()), __FILE__, __FUNCTION__, __LINE__);
         return null;
     }
     $event = $first_datetime->get_first_related('Event');
     if (!$event instanceof EE_Event) {
         EE_Error::add_error(sprintf(__("The ticket (%s) is not associated with a valid event.", "event_espresso"), $ticket->name()), __FILE__, __FUNCTION__, __LINE__);
         return null;
     }
     $reg_url_link = $this->generate_reg_url_link($att_nmbr, $line_item);
     // now create a new registration for the ticket
     $registration = EE_Registration::new_instance(array('EVT_ID' => $event->ID(), 'TXN_ID' => $transaction->ID(), 'TKT_ID' => $ticket->ID(), 'STS_ID' => EEM_Registration::status_id_incomplete, 'REG_date' => $transaction->datetime(), 'REG_final_price' => $ticket->get_ticket_total_with_taxes(), 'REG_session' => EE_Registry::instance()->SSN->id(), 'REG_count' => $att_nmbr, 'REG_group_size' => $total_ticket_count, 'REG_url_link' => $reg_url_link));
     $registration->set_reg_code($this->generate_reg_code($registration));
     $registration->save();
     $registration->_add_relation_to($event, 'Event', array(), $event->ID());
     $registration->_add_relation_to($line_item->ticket(), 'Ticket', array(), $line_item->ticket()->ID());
     $transaction->_add_relation_to($registration, 'Registration');
     return $registration;
 }
开发者ID:robert-osborne,项目名称:event-espresso-core-1,代码行数:48,代码来源:EE_Registration_Processor.class.php

示例5: test_generate_code

 function test_generate_code()
 {
     $t = EE_Transaction::new_instance();
     $t->save();
     $l = EE_Line_Item::new_instance(array('OBJ_type' => 'Transaction', 'OBJ_ID' => $t->ID()));
     $this->assertNotNull($l->generate_code());
 }
开发者ID:kaffiemetsuker,项目名称:event-espresso-core,代码行数:7,代码来源:EE_Line_Item_Test.php

示例6: get_payment_details

 /**
  *    get_payment_details
  *
  * @access    public
  * @param    array $payments
  * @return    string
  */
 public function get_payment_details($payments = array())
 {
     //prepare variables for displaying
     $template_args = array();
     $template_args['transaction'] = $this->_current_txn;
     $template_args['reg_url_link'] = $this->_reg_url_link;
     $template_args['payments'] = array();
     foreach ($payments as $payment) {
         $template_args['payments'][] = $this->get_payment_row_html($payment);
     }
     //create a hacky payment object, but dont save it
     $payment = EE_Payment::new_instance(array('TXN_ID' => $this->_current_txn->ID(), 'STS_ID' => EEM_Payment::status_id_pending, 'PAY_timestamp' => time(), 'PAY_amount' => $this->_current_txn->total(), 'PMD_ID' => $this->_current_txn->payment_method_ID()));
     $payment_method = $this->_current_txn->payment_method();
     if ($payment_method instanceof EE_Payment_Method && $payment_method->type_obj() instanceof EE_PMT_Base) {
         $template_args['gateway_content'] = $payment_method->type_obj()->payment_overview_content($payment);
     } else {
         $template_args['gateway_content'] = '';
     }
     // link to SPCO payment_options
     $template_args['show_try_pay_again_link'] = $this->_show_try_pay_again_link;
     $template_args['SPCO_payment_options_url'] = $this->_SPCO_payment_options_url;
     // verify template arguments
     EEH_Template_Validator::verify_instanceof($template_args['transaction'], '$transaction', 'EE_Transaction');
     EEH_Template_Validator::verify_isnt_null($template_args['payments'], '$payments');
     EEH_Template_Validator::verify_isnt_null($template_args['show_try_pay_again_link'], '$show_try_pay_again_link');
     EEH_Template_Validator::verify_isnt_null($template_args['gateway_content'], '$gateway_content');
     EEH_Template_Validator::verify_isnt_null($template_args['SPCO_payment_options_url'], '$SPCO_payment_options_url');
     return EEH_Template::locate_template(THANK_YOU_TEMPLATES_PATH . 'thank-you-page-payment-details.template.php', $template_args, TRUE, TRUE);
 }
开发者ID:kaffiemetsuker,项目名称:event-espresso-core,代码行数:36,代码来源:EES_Espresso_Thank_You.shortcode.php

示例7: transaction_list_table_events_column_content

 /**
  * Callback for transaction list table column action for new events column.
  *
  * @param EE_Transaction $transaction
  * @return string
  */
 public function transaction_list_table_events_column_content($transaction)
 {
     if (!$transaction instanceof EE_Transaction) {
         return;
     }
     //get event ids
     $registrations = $transaction->registrations();
     $event_IDs = array();
     foreach ($registrations as $registration) {
         if ($registration instanceof EE_Registration) {
             if ($registration->event_ID() && !in_array($registration->event_ID(), $event_IDs)) {
                 $event_IDs[] = $registration->event_ID();
             }
         }
     }
     if (!empty($event_IDs)) {
         $count = count($event_IDs);
         $event_IDs = implode(',', $event_IDs);
         $url = add_query_arg(array('EVT_IDs' => $event_IDs, 'TXN_ID' => $transaction->ID(), 'page' => 'espresso_events', 'action' => 'default'), admin_url('admin.php'));
         echo '<a href="' . $url . '">' . sprintf(_n('1 Event', '%d Events', $count, 'event_espresso'), $count) . '</a>';
     }
 }
开发者ID:adrianjonmiller,项目名称:hearts-being-healed,代码行数:28,代码来源:EE_MER_Transactions_Admin.class.php

示例8: test_finalize

 function test_finalize()
 {
     $t = EE_Transaction::new_instance(array('STS_ID' => EEM_Transaction::complete_status_code));
     $t->save();
     $e = EE_Event::new_instance();
     $e->save();
     $tkt = EE_Ticket::new_instance();
     $tkt->save();
     $d = EE_Datetime::new_instance(array('EVT_ID' => $e->ID()));
     $d->save();
     $tkt->_add_relation_to($d, 'Datetime');
     /** @type EE_Registration_Processor $registration_processor */
     $registration_processor = EE_Registry::instance()->load_class('Registration_Processor');
     $reg_url = $registration_processor->generate_reg_url_link(1, EE_Line_Item::new_instance(array('LIN_name' => $tkt->name(), 'LIN_desc' => $tkt->description(), 'LIN_unit_price' => $tkt->price(), 'LIN_quantity' => 1, 'LIN_is_taxable' => $tkt->taxable(), 'LIN_order' => 0, 'LIN_total' => $tkt->price(), 'LIN_type' => EEM_Line_Item::type_line_item, 'OBJ_ID' => $tkt->ID(), 'OBJ_type' => 'Ticket')));
     $r = EE_REgistration::new_instance(array('EVT_ID' => $e->ID(), 'TXN_ID' => $t->ID(), 'TKT_ID' => $tkt->ID(), 'STS_ID' => EEM_Registration::status_id_pending_payment, 'REG_url_link' => $reg_url));
     $r->set_reg_code($registration_processor->generate_reg_code($r));
     $registration_processor->update_registration_after_checkout_or_payment($r);
     $this->assertNotNull($r->reg_code());
     $this->assertEquals(EEM_Registration::status_id_approved, $r->status_ID());
 }
开发者ID:robert-osborne,项目名称:event-espresso-core-1,代码行数:20,代码来源:EE_Registration_Test.php

示例9: _reg_details_meta_box

 /**
  * 		generates HTML for the Registration main meta box
  *		@access public
  *		@return void
  */
 public function _reg_details_meta_box()
 {
     EEH_Autoloader::register_line_item_display_autoloaders();
     EEH_Autoloader::register_line_item_filter_autoloaders();
     EE_Registry::instance()->load_Helper('Line_Item');
     $transaction = $this->_registration->transaction() ? $this->_registration->transaction() : EE_Transaction::new_instance();
     $this->_session = $transaction->session_data();
     $filters = new EE_Line_Item_Filter_Collection();
     $filters->add(new EE_Single_Registration_Line_Item_Filter($this->_registration));
     $filters->add(new EE_Non_Zero_Line_Item_Filter());
     $line_item_filter_processor = new EE_Line_Item_Filter_Processor($filters, $transaction->total_line_item());
     $filtered_line_item_tree = $line_item_filter_processor->process();
     $this->_template_args['REG_ID'] = $this->_registration->ID();
     $line_item_display = new EE_Line_Item_Display('reg_admin_table', 'EE_Admin_Table_Registration_Line_Item_Display_Strategy');
     $this->_template_args['line_item_table'] = $line_item_display->display_line_item($filtered_line_item_tree, array('EE_Registration' => $this->_registration));
     $attendee = $this->_registration->attendee();
     $this->_template_args['view_transaction_button'] = EE_Registry::instance()->CAP->current_user_can('ee_read_transaction', 'espresso_transactions_view_transaction') ? EEH_Template::get_button_or_link(EE_Admin_Page::add_query_args_and_nonce(array('action' => 'view_transaction', 'TXN_ID' => $transaction->ID()), TXN_ADMIN_URL), __(' View Transaction'), 'button secondary-button right', 'dashicons dashicons-cart') : '';
     $this->_template_args['resend_registration_button'] = $attendee instanceof EE_Attendee && EE_Registry::instance()->CAP->current_user_can('ee_send_message', 'espresso_registrations_resend_registration') ? EEH_Template::get_button_or_link(EE_Admin_Page::add_query_args_and_nonce(array('action' => 'resend_registration', '_REG_ID' => $this->_registration->ID(), 'redirect_to' => 'view_registration'), REG_ADMIN_URL), __(' Resend Registration'), 'button secondary-button right', 'dashicons dashicons-email-alt') : '';
     $this->_template_args['currency_sign'] = EE_Registry::instance()->CFG->currency->sign;
     $payment = $transaction->get_first_related('Payment');
     $payment = !$payment instanceof EE_Payment ? EE_Payment::new_instance() : $payment;
     $payment_method = $payment->get_first_related('Payment_Method');
     $payment_method = !$payment_method instanceof EE_Payment_Method ? EE_Payment_Method::new_instance() : $payment_method;
     $reg_status_class = 'status-' . $this->_registration->status_ID();
     $reg_details = array('payment_method' => $payment_method->name(), 'response_msg' => $payment->gateway_response(), 'registration_id' => $this->_registration->get('REG_code'), 'registration_session' => $this->_registration->session_ID(), 'ip_address' => isset($this->_session['ip_address']) ? $this->_session['ip_address'] : '', 'user_agent' => isset($this->_session['user_agent']) ? $this->_session['user_agent'] : '');
     if (isset($reg_details['registration_id'])) {
         $this->_template_args['reg_details']['registration_id']['value'] = $reg_details['registration_id'];
         $this->_template_args['reg_details']['registration_id']['label'] = __('Registration ID', 'event_espresso');
         $this->_template_args['reg_details']['registration_id']['class'] = 'regular-text';
     }
     if (isset($reg_details['payment_method'])) {
         $this->_template_args['reg_details']['payment_method']['value'] = $reg_details['payment_method'];
         $this->_template_args['reg_details']['payment_method']['label'] = __('Most Recent Payment Method', 'event_espresso');
         $this->_template_args['reg_details']['payment_method']['class'] = 'regular-text';
         $this->_template_args['reg_details']['response_msg']['value'] = $reg_details['response_msg'];
         $this->_template_args['reg_details']['response_msg']['label'] = __('Payment method response', 'event_espresso');
         $this->_template_args['reg_details']['response_msg']['class'] = 'regular-text';
     }
     $this->_template_args['reg_details']['registration_session']['value'] = $reg_details['registration_session'];
     $this->_template_args['reg_details']['registration_session']['label'] = __('Registration Session', 'event_espresso');
     $this->_template_args['reg_details']['registration_session']['class'] = 'regular-text';
     $this->_template_args['reg_details']['ip_address']['value'] = $reg_details['ip_address'];
     $this->_template_args['reg_details']['ip_address']['label'] = __('Registration placed from IP', 'event_espresso');
     $this->_template_args['reg_details']['ip_address']['class'] = 'regular-text';
     $this->_template_args['reg_details']['user_agent']['value'] = $reg_details['user_agent'];
     $this->_template_args['reg_details']['user_agent']['label'] = __('Registrant User Agent', 'event_espresso');
     $this->_template_args['reg_details']['user_agent']['class'] = 'large-text';
     $this->_template_args['event_link'] = EE_Admin_Page::add_query_args_and_nonce(array('action' => 'default', 'event_id' => $this->_registration->event_ID()), REG_ADMIN_URL);
     $template_path = REG_TEMPLATE_PATH . 'reg_admin_details_main_meta_box_reg_details.template.php';
     echo EEH_Template::display_template($template_path, $this->_template_args, TRUE);
 }
开发者ID:adrianjonmiller,项目名称:hearts-being-healed,代码行数:56,代码来源:Registrations_Admin_Page.core.php

示例10: 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);
             }
         }
     }
 }
开发者ID:rheator,项目名称:event-espresso-core,代码行数:33,代码来源:EE_Checkout.class.php

示例11: process_registration_payments

 /**
  * update registrations REG_paid field after successful payment and link registrations with payment
  *
  * @param EE_Transaction $transaction
  * @param EE_Payment $payment
  * @param EE_Registration[] $registrations
  * @throws \EE_Error
  */
 public function process_registration_payments(EE_Transaction $transaction, EE_Payment $payment, $registrations = array())
 {
     // only process if payment was successful
     if ($payment->status() !== EEM_Payment::status_id_approved) {
         return;
     }
     //EEM_Registration::instance()->show_next_x_db_queries();
     if (empty($registrations)) {
         // find registrations with monies owing that can receive a payment
         $registrations = $transaction->registrations(array(array('STS_ID' => array('IN', EEM_Registration::reg_statuses_that_allow_payment()), 'REG_final_price' => array('!=', 0), 'REG_final_price*' => array('!=', 'REG_paid', true))));
     }
     // still nothing ??!??
     if (empty($registrations)) {
         return;
     }
     // todo: break out the following logic into a separate strategy class
     // todo: named something like "Sequential_Reg_Payment_Strategy"
     // todo: which would apply payments using the capitalist "first come first paid" approach
     // todo: then have another strategy class like "Distributed_Reg_Payment_Strategy"
     // todo: which would be the socialist "everybody gets a piece of pie" approach,
     // todo: which would be better for deposits, where you want a bit of the payment applied to each registration
     $refund = $payment->is_a_refund();
     // how much is available to apply to registrations?
     $available_payment_amount = abs($payment->amount());
     foreach ($registrations as $registration) {
         if ($registration instanceof EE_Registration) {
             // nothing left?
             if ($available_payment_amount <= 0) {
                 break;
             }
             if ($refund) {
                 $available_payment_amount = $this->process_registration_refund($registration, $payment, $available_payment_amount);
             } else {
                 $available_payment_amount = $this->process_registration_payment($registration, $payment, $available_payment_amount);
             }
         }
     }
     if ($available_payment_amount > 0 && apply_filters('FHEE__EE_Payment_Processor__process_registration_payments__display_notifications', false)) {
         EE_Error::add_attention(sprintf(__('A remainder of %1$s exists after applying this payment to Registration(s) %2$s.%3$sPlease verify that the original payment amount of %4$s is correct. If so, you should edit this payment and select at least one additional registration in the "Registrations to Apply Payment to" section, so that the remainder of this payment can be applied to the additional registration(s).', 'event_espresso'), EEH_Template::format_currency($available_payment_amount), implode(', ', array_keys($registrations)), '<br/>', EEH_Template::format_currency($payment->amount())), __FILE__, __FUNCTION__, __LINE__);
     }
 }
开发者ID:aaronfrey,项目名称:PepperLillie-GSP,代码行数:49,代码来源:EE_Payment_Processor.core.php

示例12: _get_registrations

 /**
  * _get_registrations
  *
  * @access private
  * @param EE_Transaction $transaction
  * @return EE_Cart
  */
 private function _get_registrations(EE_Transaction $transaction)
 {
     // first step: grab the registrants  { : o
     $registrations = $transaction->registrations($this->checkout->reg_cache_where_params, true);
     // verify registrations have been set
     if (empty($registrations)) {
         // if no cached registrations, then check the db
         $registrations = $transaction->registrations($this->checkout->reg_cache_where_params, false);
         // still nothing ? well as long as this isn't a revisit
         if (empty($registrations) && !$this->checkout->revisit) {
             // generate new registrations from scratch
             $registrations = $this->_initialize_registrations($transaction);
         }
     }
     // sort by their original registration order
     usort($registrations, array('EED_Single_Page_Checkout', 'sort_registrations_by_REG_count'));
     // then loop thru the array
     foreach ($registrations as $registration) {
         // verify each registration
         if ($registration instanceof EE_Registration) {
             // we display all attendee info for the primary registrant
             if ($this->checkout->reg_url_link == $registration->reg_url_link() && $registration->is_primary_registrant()) {
                 $this->checkout->primary_revisit = TRUE;
                 break;
             } else {
                 if ($this->checkout->revisit && $this->checkout->reg_url_link != $registration->reg_url_link()) {
                     // but hide info if it doesn't belong to you
                     $transaction->clear_cache('Registration', $registration->ID());
                 }
             }
             $this->checkout->set_reg_status_updated($registration->ID(), false);
         }
     }
 }
开发者ID:DavidSteinbauer,项目名称:event-espresso-core,代码行数:41,代码来源:EED_Single_Page_Checkout.module.php

示例13: _process_updated_registration_payments

 /**
  * _process_updated_registration_payments
  *
  * this applies the payments to the selected registrations
  * but only if they have not already been paid for
  *
  * @param  EE_Transaction $transaction
  * @param \EE_Payment $payment
  * @param array $registration_query_where_params
  * @return bool
  */
 protected function _process_updated_registration_payments(EE_Transaction $transaction, EE_Payment $payment, $registration_query_where_params = array())
 {
     // we can pass our own custom set of registrations to EE_Payment_Processor::process_registration_payments()
     // so let's do that using our set of REG_IDs from the form, but add in some conditions regarding payment
     // so that we don't apply payments to registrations that are free or have already been paid for
     // but ONLY if the payment is NOT a refund ( ie: the payment amount is not negative )
     if (!$payment->is_a_refund()) {
         $registration_query_where_params = array_merge($registration_query_where_params, array('REG_final_price' => array('!=', 0), 'REG_final_price*' => array('!=', 'REG_paid', true)));
     }
     $registrations = $transaction->registrations(array($registration_query_where_params));
     //EEH_Debug_Tools::printr( $registrations, '$registrations', __FILE__, __LINE__ );
     if (!empty($registrations)) {
         /** @type EE_Payment_Processor $payment_processor */
         $payment_processor = EE_Registry::instance()->load_core('Payment_Processor');
         $payment_processor->process_registration_payments($transaction, $payment, $registrations);
     }
 }
开发者ID:vinylthieves,项目名称:kaylyn-kyle,代码行数:28,代码来源:Transactions_Admin_Page.core.php

示例14: _sell_tickets

 /**
  * simulate six sales for an event's ticket, which will also increase sold qty for D1 & D2
  *
  * @param \EE_Ticket $ticket
  * @param int $qty
  * @throws \EE_Error
  */
 protected function _sell_tickets(EE_Ticket $ticket, $qty = 1)
 {
     if ($ticket instanceof EE_Ticket) {
         $transaction = EE_Transaction::new_instance(array('STS_ID' => EEM_Transaction::complete_status_code, 'TXN_timestamp' => time() - DAY_IN_SECONDS, 'TXN_total' => 0, 'TXN_paid' => 0));
         $transaction->save();
         for ($x = 1; $x <= $qty; $x++) {
             $registration = EE_Registration::new_instance(array('STS_ID' => EEM_Registration::status_id_approved, 'REG_date' => time() - DAY_IN_SECONDS, 'REG_code' => $transaction->ID() . "-" . $ticket->ID() . "-{$x}-test", 'TXN_ID' => $transaction->ID(), 'EVT_ID' => $ticket->get_event_ID(), 'TKT_ID' => $ticket->ID()));
             $registration->save();
         }
     }
 }
开发者ID:DavidSteinbauer,项目名称:event-espresso-core,代码行数:18,代码来源:EE_Test_Scenario_Classes.php

示例15: getimagesize

 function espresso_replace_invoice_shortcodes($content)
 {
     $EE = EE_Registry::instance();
     //Create the logo
     if (!empty($this->invoice_settings['invoice_logo_url'])) {
         $invoice_logo_url = $this->invoice_settings['invoice_logo_url'];
     } else {
         $invoice_logo_url = $EE->CFG->organization->logo_url;
     }
     if (!empty($invoice_logo_url)) {
         $image_size = getimagesize($invoice_logo_url);
         $invoice_logo_image = '<img class="logo screen" src="' . $invoice_logo_url . '" ' . $image_size[3] . ' alt="logo" /> ';
     } else {
         $invoice_logo_image = '';
     }
     $SearchValues = array("[organization]", "[registration_code]", "[transaction_id]", "[name]", "[base_url]", "[download_link]", "[invoice_logo_image]", "[street]", "[city]", "[state]", "[zip]", "[email]", "[vat]", "[registration_date]", "[instructions]");
     $primary_attendee = $this->transaction->primary_registration()->attendee();
     $org_state = EE_Registry::instance()->load_model('State')->get_one_by_ID($EE->CFG->organization->STA_ID);
     if ($org_state) {
         $org_state_name = $org_state->name();
     } else {
         $org_state_name = '';
     }
     $ReplaceValues = array(stripslashes($EE->CFG->organization->name), $this->registration->reg_code(), $this->transaction->ID(), $primary_attendee->full_name(), is_dir(EVENT_ESPRESSO_GATEWAY_DIR . '/invoice') ? EVENT_ESPRESSO_GATEWAY_URL . 'Invoice/lib/templates/' : EE_GATEWAYS_URL . 'Invoice/lib/templates/', $this->registration->invoice_url(), $invoice_logo_image, empty($EE->CFG->organization->address_2) ? $EE->CFG->organization->address_1 : $EE->CFG->organization->address_1 . '<br>' . $EE->CFG->organization->address_2, $EE->CFG->organization->city, $org_state_name, $EE->CFG->organization->zip, $EE->CFG->organization->email, $EE->CFG->organization->vat, date_i18n(get_option('date_format'), strtotime($this->registration->date())), $this->invoice_settings['pdf_instructions']);
     return str_replace($SearchValues, $ReplaceValues, $content);
 }
开发者ID:antares-ff,项目名称:ANTARES-Test,代码行数:26,代码来源:Invoice.class.php


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