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


PHP EE_Transaction::new_instance方法代码示例

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


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

示例1: 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

示例2: 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

示例3: _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

示例4: _initialize_transaction

 /**
  * 	generates a new EE_Transaction object and adds it to the $_transaction property.
  *
  * 	@access private
  * 	@return mixed EE_Transaction|NULL
  */
 private function _initialize_transaction()
 {
     try {
         // ensure cart totals have been calculated
         $this->checkout->cart->get_grand_total()->recalculate_total_including_taxes();
         // grab the cart grand total
         $cart_total = $this->checkout->cart->get_cart_grand_total();
         // create new TXN
         return EE_Transaction::new_instance(array('TXN_timestamp' => time(), 'TXN_reg_steps' => $this->checkout->initialize_txn_reg_steps_array(), 'TXN_total' => $cart_total > 0 ? $cart_total : 0, 'TXN_paid' => 0, 'STS_ID' => EEM_Transaction::failed_status_code));
     } catch (Exception $e) {
         EE_Error::add_error($e->getMessage(), __FILE__, __FUNCTION__, __LINE__);
     }
     return NULL;
 }
开发者ID:DavidSteinbauer,项目名称:event-espresso-core,代码行数:20,代码来源:EED_Single_Page_Checkout.module.php

示例5: _initialize_transaction

 /**
  * 	generates a new EE_Transaction object and adds it to the $_transaction property.
  *
  * 	@access private
  * 	@return mixed EE_Transaction|NULL
  */
 private function _initialize_transaction()
 {
     try {
         // create new TXN
         return EE_Transaction::new_instance(array('TXN_timestamp' => current_time('timestamp'), 'TXN_reg_steps' => $this->checkout->initialize_txn_reg_steps_array(), 'TXN_total' => $this->checkout->cart->get_cart_grand_total(), 'TXN_paid' => 0, 'STS_ID' => EEM_Transaction::failed_status_code));
     } catch (Exception $e) {
         EE_Error::add_error($e->getMessage(), __FILE__, __FUNCTION__, __LINE__);
     }
     return NULL;
 }
开发者ID:robert-osborne,项目名称:event-espresso-core-1,代码行数:16,代码来源:EED_Single_Page_Checkout.module.php

示例6: _setup_data

 protected function _setup_data()
 {
     //need to figure out the running total for test purposes so... we're going to create a temp cart and add the tickets to it!
     EE_Registry::instance()->SSN->clear_session(__CLASS__, __FUNCTION__);
     $cart = EE_Cart::reset();
     //add tickets to cart
     foreach ($this->tickets as $ticket) {
         $cart->add_ticket_to_cart($ticket['ticket']);
     }
     //setup txn property
     $this->txn = EE_Transaction::new_instance(array('TXN_timestamp' => time(), 'TXN_total' => 0, 'TXN_paid' => 0, 'STS_ID' => EEM_Transaction::incomplete_status_code, 'TXN_session_data' => NULL, 'TXN_hash_salt' => NULL, 'TXN_ID' => 999999));
     //setup reg_objects
     //note we're setting up a reg object for each attendee in each event but ALSO adding to the reg_object array.
     $this->reg_objs = array();
     $regid = 9999990;
     foreach ($this->_attendees as $key => $attendee) {
         //note we need to setup reg_objects for each event this attendee belongs to
         $regatt = $attendee['att_obj']->ID();
         $regtxn = $this->txn->ID();
         $regcnt = 1;
         foreach ($attendee['line_ref'] as $evtid) {
             foreach ($this->_events[$evtid]['tkt_objs'] as $ticket) {
                 $reg_array = array('EVT_ID' => $evtid, 'ATT_ID' => $regatt, 'TXN_ID' => $regtxn, 'TKT_ID' => $ticket->ID(), 'STS_ID' => EEM_Registration::status_id_pending_payment, 'REG_date' => time(), 'REG_final_price' => $ticket->get('TKT_price'), 'REG_session' => 'dummy_session_id', 'REG_code' => $regid . '-dummy-generated-code', 'REG_url_link' => $regcnt . '-daafpapasdlfakasdfpqasdfasdf', 'REG_count' => $regcnt, 'REG_group_size' => $this->_events[$evtid]['total_attendees'], 'REG_att_is_going' => TRUE, 'REG_ID' => $regid);
                 $REG_OBJ = EE_Registration::new_instance($reg_array);
                 $this->_attendees[$key]['reg_objs'][$regid] = $REG_OBJ;
                 $this->_events[$evtid]['reg_objs'][] = $REG_OBJ;
                 $this->reg_objs[] = $REG_OBJ;
                 $this->tickets[$ticket->ID()]['reg_objs'][$regid] = $REG_OBJ;
                 $regcnt++;
                 $regid++;
             }
         }
     }
     //setup line items!
     EE_Registry::instance()->load_helper('Line_Item');
     $line_item_total = EEH_Line_Item::create_total_line_item($this->txn);
     //add tickets
     foreach ($this->tickets as $tktid => $item) {
         $qty = $item['count'];
         $ticket = $item['ticket'];
         EEH_Line_Item::add_ticket_purchase($line_item_total, $ticket, $qty);
     }
     $shipping_line_item = EE_Line_Item::new_instance(array('LIN_name' => __('Shipping Surcharge', 'event_espresso'), 'LIN_desc' => __('Sent via Millenium Falcon', 'event_espresso'), 'LIN_unit_price' => 20, 'LIN_quantity' => 1, 'LIN_is_taxable' => TRUE, 'LIN_total' => 20, 'LIN_type' => EEM_Line_Item::type_line_item));
     EEH_Line_Item::add_item($line_item_total, $shipping_line_item);
     $this->additional_line_items = array($shipping_line_item);
     //now let's add taxes
     EEH_Line_Item::apply_taxes($line_item_total);
     //now we should be able to get the items we need from this object
     $event_line_items = EEH_Line_Item::get_pre_tax_subtotal($line_item_total)->children();
     $line_items = array();
     foreach ($event_line_items as $line_id => $line_item) {
         if (!$line_item instanceof EE_Line_Item || $line_item->OBJ_type() !== 'Event') {
             continue;
         }
         $ticket_line_items = EEH_Line_Item::get_ticket_line_items($line_item);
         foreach ($ticket_line_items as $ticket_line_id => $ticket_line_item) {
             if (!$ticket_line_item instanceof EE_Line_Item) {
                 continue;
             }
             $this->tickets[$ticket_line_item->OBJ_ID()]['line_item'] = $ticket_line_item;
             $this->tickets[$ticket_line_item->OBJ_ID()]['sub_line_items'] = $ticket_line_item->children();
             $line_items[$ticket_line_item->ID()]['children'] = $ticket_line_item->children();
             $line_items[$ticket_line_item->ID()]['EE_Ticket'] = $this->tickets[$ticket_line_item->OBJ_ID()]['ticket'];
         }
     }
     $this->line_items_with_children = $line_items;
     $this->tax_line_items = $line_item_total->tax_descendants();
     //add proper total to transaction object.
     $grand_total = $line_item_total->recalculate_total_including_taxes();
     $this->grand_total_line_item = $line_item_total;
     $this->txn->set_total($grand_total);
     //add additional details for each registration
     foreach ($this->reg_objs as $reg) {
         $this->_registrations[$reg->ID()]['tkt_obj'] = $this->tickets[$reg->get('TKT_ID')]['ticket'];
         $this->_registrations[$reg->ID()]['evt_obj'] = $this->_events[$reg->get('EVT_ID')]['event'];
         $this->_registrations[$reg->ID()]['reg_obj'] = $reg;
         $this->_registrations[$reg->ID()]['ans_objs'] = $this->_attendees[$reg->get('ATT_ID')]['ans_objs'];
         $this->_registrations[$reg->ID()]['att_obj'] = $this->_attendees[$reg->get('ATT_ID')]['att_obj'];
         $this->_registrations[$reg->ID()]['dtt_objs'] = $this->tickets[$reg->get('TKT_ID')]['dtt_objs'];
     }
     //events and attendees
     $this->events = $this->_events;
     $this->attendees = $this->_attendees;
     $this->registrations = $this->_registrations;
     $attendees_to_shift = $this->_attendees;
     //setup primary attendee property
     $this->primary_attendee_data = array('fname' => $this->_attendees[999999991]['att_obj']->fname(), 'lname' => $this->_attendees[999999991]['att_obj']->lname(), 'email' => $this->_attendees[999999991]['att_obj']->email(), 'att_obj' => $this->_attendees[999999991]['att_obj'], 'reg_obj' => array_shift($attendees_to_shift[999999991]['reg_objs']));
     //reg_info property
     //note this isn't referenced by any shortcode parsers so we'll ignore for now.
     $this->reg_info = array();
     //let's set a reg_obj for messengers expecting one.
     $this->reg_obj = array_pop($this->_attendees[999999991]['reg_objs']);
     //the below are just dummy items.
     $this->user_id = 1;
     $this->ip_address = '192.0.2.1';
     $this->user_agent = '';
     $this->init_access = time();
     $this->last_access = time();
 }
开发者ID:DavidSteinbauer,项目名称:event-espresso-core,代码行数:99,代码来源:EE_Messages_Preview_incoming_data.class.php

示例7: test_fresh_entity_map_with

 /**
  * @group 7151
  */
 function test_fresh_entity_map_with()
 {
     $p = $this->new_model_obj_with_dependencies('Payment', array('PAY_amount' => 25));
     $p->save();
     $this->assertEquals($p, EEM_Payment::instance()->get_from_entity_map($p->ID()));
     //now purposefully make a naughty payment which isn't in the entity map
     $p2 = clone $p;
     $this->assertFalse($p2->in_entity_map());
     //make the two EE_Payments diverge
     $p2->set('PAY_amount', 99);
     $t = EE_Transaction::new_instance();
     $p2->cache('Transaction', $t);
     $this->assertEquals(25, $p->get('PAY_amount'));
     $this->assertEquals(99, $p2->get('PAY_amount'));
     $this->assertNotEquals($p->get_all_from_cache('Transaction'), $p2->get_all_from_cache('Transaction'));
     //now update the payment in the entity map with the other
     EEM_Payment::instance()->refresh_entity_map_with($p->ID(), $p2);
     $this->assertEquals(99, $p->get('PAY_amount'));
     //make sure p hasn't changed into p2. that's not what we wanted to do...
     $this->assertFalse($p2 === $p);
     //We wanted to just UPDATE p with p2's values
     $this->assertEquals($p, EEM_Payment::instance()->get_from_entity_map($p->ID()));
     //and make sure p's cache was updated to be the same as p2's
     $this->assertEquals($p2->get_all_from_cache('Transaction'), $p->get_all_from_cache('Transaction'));
 }
开发者ID:robert-osborne,项目名称:event-espresso-core-1,代码行数:28,代码来源:EEM_Base_Test.php

示例8: _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

示例9: _setup_data

 protected function _setup_data()
 {
     //need to figure out the running total for test purposes so... we're going to create a temp cart and add the tickets to it!
     EE_Registry::instance()->SSN->clear_session(__CLASS__, __FUNCTION__);
     $cart = EE_Cart::instance();
     //add tickets to cart
     foreach ($this->tickets as $ticket) {
         $cart->add_ticket_to_cart($ticket['ticket']);
     }
     $grand_total = $cart->get_cart_grand_total() * count($this->_attendees);
     //EEH_Template::format_currency($cart->get_grand_total(), true);
     //setup billing property
     //todo:  I'm only using this format for the array because its how the gateways currently setup this data.  I HATE IT and it needs fixed but I have no idea how many places in the code this data structure currently touches.  Once its fixed we'll have to fix it here and in the shortcode parsing where this particular property is accessed.  (See https://events.codebasehq.com/projects/event-espresso/tickets/2271) for related ticket.
     $this->billing = array('first name' => 'Luke', 'last name' => 'Skywalker', 'email address' => 'farfaraway@galaxy.com', 'address' => '804 Bantha Dr.', 'city' => 'Mos Eisley', 'state' => 'Section 7', 'country' => 'Tatooine', 'zip' => 'f0r3e', 'ccv code' => 'xxx', 'credit card #' => '999999xxxxxxxx', 'expiry date' => '12 / 3000', 'total_due' => $grand_total);
     //setup txn property
     $this->txn = EE_Transaction::new_instance(array('TXN_timestamp' => current_time('mysql'), 'TXN_total' => $grand_total, 'TXN_paid' => $grand_total, 'STS_ID' => EEM_Transaction::incomplete_status_code, 'TXN_session_data' => NULL, 'TXN_hash_salt' => NULL, 'TXN_ID' => 999999));
     //setup reg_objects
     //note we're setting up a reg object for each attendee in each event but ALSO adding to the reg_object array.
     $this->reg_objs = array();
     $regid = 9999990;
     foreach ($this->_attendees as $key => $attendee) {
         //note we need to setup reg_objects for each event this attendee belongs to
         $regatt = $attendee['att_obj']->ID();
         $regtxn = $this->txn->ID();
         $regcnt = 1;
         foreach ($attendee['line_ref'] as $evtid) {
             foreach ($this->_events[$evtid]['tkt_objs'] as $ticket) {
                 $reg_array = array('EVT_ID' => $evtid, 'ATT_ID' => $regatt, 'TXN_ID' => $regtxn, 'TKT_ID' => $ticket->ID(), 'STS_ID' => EEM_Registration::status_id_pending_payment, 'REG_date' => current_time('mysql'), 'REG_final_price' => $ticket->get('TKT_price'), 'REG_session' => 'dummy_session_id', 'REG_code' => $regid . '-dummy_generated_reg_code', 'REG_url_link' => '#', 'REG_count' => $regcnt, 'REG_group_size' => $this->_events[$evtid]['total_attendees'], 'REG_att_is_going' => TRUE, 'REG_ID' => $regid);
                 $REG_OBJ = EE_Registration::new_instance($reg_array);
                 $this->_attendees[$key]['reg_obj'][$regid] = $REG_OBJ;
                 $this->_events[$evtid]['reg_objs'][] = $REG_OBJ;
                 $this->reg_objs[] = $REG_OBJ;
                 $regcnt++;
                 $regid++;
             }
         }
     }
     //add additional details for each registration
     foreach ($this->reg_objs as $reg) {
         $this->_registrations[$reg->ID()]['tkt_obj'] = $this->tickets[$reg->get('TKT_ID')]['ticket'];
         $this->_registrations[$reg->ID()]['evt_obj'] = $this->_events[$reg->get('EVT_ID')]['event'];
         $this->_registrations[$reg->ID()]['reg_obj'] = $reg;
         $this->_registrations[$reg->ID()]['ans_objs'] = $this->_attendees[$reg->get('ATT_ID')]['ans_objs'];
         $this->_registrations[$reg->ID()]['att_obj'] = $this->_attendees[$reg->get('ATT_ID')]['att_obj'];
         $this->_registrations[$reg->ID()]['dtt_objs'] = $this->tickets[$reg->get('TKT_ID')]['dtt_objs'];
     }
     //events and attendees
     $this->events = $this->_events;
     $this->attendees = $this->_attendees;
     $this->registrations = $this->_registrations;
     //setup primary attendee property
     $this->primary_attendee_data = array('fname' => $this->_attendees[999999991]['att_obj']->fname(), 'lname' => $this->_attendees[999999991]['att_obj']->lname(), 'email' => $this->_attendees[999999991]['att_obj']->email(), 'att_obj' => $this->_attendees[999999991]['att_obj'], 'reg_obj' => $this->_attendees[999999991]['reg_obj']);
     //reg_info property
     //note this isn't referenced by any shortcode parsers so we'll ignore for now.
     $this->reg_info = array();
     //the below are just dummy items.
     $this->user_id = 1;
     $this->ip_address = '192.0.2.1';
     $this->user_agent = '';
     $this->init_access = current_time('mysql');
     $this->last_access = current_time('mysql');
 }
开发者ID:antares-ff,项目名称:ANTARES-Test,代码行数:62,代码来源:EE_Messages_Preview_incoming_data.class.php

示例10: column_TXN_paid

 /**
  * column_TXN_paid
  *
  * @access public
  * @param \EE_Registration $item
  * @return string
  */
 function column_TXN_paid(EE_Registration $item)
 {
     if ($item->count() == 1) {
         $transaction = $item->transaction() ? $item->transaction() : EE_Transaction::new_instance();
         if ($transaction->paid() >= $transaction->total()) {
             return '<span class="reg-pad-rght"><div class="dashicons dashicons-yes green-icon"></div></span>';
         } else {
             $view_txn_lnk_url = EE_Admin_Page::add_query_args_and_nonce(array('action' => 'view_transaction', 'TXN_ID' => $item->transaction_ID()), TXN_ADMIN_URL);
             return EE_Registry::instance()->CAP->current_user_can('ee_read_transaction', 'espresso_transactions_view_transaction', $item->transaction_ID()) ? '<span class="reg-pad-rght"><a class="status-' . $transaction->status_ID() . '" href="' . $view_txn_lnk_url . '"  title="' . esc_attr__('View Transaction', 'event_espresso') . '">' . $item->transaction()->pretty_paid() . '</a><span>' : '<span class="reg-pad-rght">' . $item->transaction()->pretty_paid() . '</span>';
         }
     }
     return '&nbsp;';
 }
开发者ID:robert-osborne,项目名称:event-espresso-core-1,代码行数:20,代码来源:EE_Registrations_List_Table.class.php

示例11: _reg_details_meta_box

 /**
  * 		generates HTML for the Registration main meta box
  *		@access public
  *		@return void
  */
 public function _reg_details_meta_box()
 {
     $transaction = $this->_registration->transaction() ? $this->_registration->transaction() : EE_Transaction::new_instance();
     $this->_template_args['line_items'] = $transaction->get_many_related('Line_Item', array(array('LIN_type' => 'line-item')));
     // process taxes
     if ($transaction) {
         //get all "tax" line items for this transaction and we'll use them for the tax display.
         $taxes = $transaction->get_many_related('Line_Item', array(array('LIN_type' => EEM_Line_Item::type_tax)));
         $this->_template_args['taxes'] = !empty($taxes) ? $taxes : array();
     } else {
         $this->_template_args['taxes'] = array();
     }
     $this->_template_args['view_transaction_button'] = 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'] = 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['grand_total'] = EEH_Template::format_currency($transaction->total());
     $this->_template_args['currency_sign'] = EE_Registry::instance()->CFG->currency->sign;
     $reg_status_class = 'status-' . $this->_registration->status_ID();
     $payment = $transaction->get_first_related('Payment');
     $reg_details = !empty($payment) ? maybe_unserialize($payment->details()) : NULL;
     //REG_ID will NOT be retrieved from $payment!
     $reg_details['registration_id'] = $this->_registration->get('REG_code');
     if (!is_array($reg_details) || is_array($reg_details) && isset($reg_details['REDO_TXN']) && $reg_details['REDO_TXN']) {
         $reg_details = array();
         $reg_details['method'] = '';
         $reg_details['response_msg'] = '';
         $reg_details['invoice_number'] = '';
     }
     $card_type = isset($reg_details['card_type']) ? ' : ' . $reg_details['card_type'] : '';
     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['invoice_number'])) {
         $this->_template_args['reg_details']['invoice_number']['value'] = isset($reg_details['invoice_number']) ? $reg_details['invoice_number'] : '';
         $this->_template_args['reg_details']['invoice_number']['label'] = __('Invoice Number', 'event_espresso');
         $this->_template_args['reg_details']['invoice_number']['class'] = 'regular-text';
     }
     $this->_template_args['reg_details']['registration_session']['value'] = $this->_registration->session_ID();
     $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'] = isset($this->_session['ip_address']) ? $this->_session['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'] = isset($this->_session['user_agent']) ? $this->_session['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['full_session'] = $this->_session;
     $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:antares-ff,项目名称:ANTARES-Test,代码行数:56,代码来源:Registrations_Admin_Page.core.php

示例12: _reg_details_meta_box

 /**
  * 		generates HTML for the Registration main meta box
  *		@access public
  *		@return void
  */
 public function _reg_details_meta_box()
 {
     $transaction = $this->_registration->transaction() ? $this->_registration->transaction() : EE_Transaction::new_instance();
     $this->_session = $transaction->session_data();
     $this->_template_args['REG_ID'] = $this->_registration->ID();
     $this->_template_args['line_items'] = $transaction->get_many_related('Line_Item', array(array('LIN_type' => 'line-item')));
     $attendee = $this->_registration->attendee();
     // process taxes
     if ($transaction) {
         //get all "tax" line items for this transaction and we'll use them for the tax display.
         $taxes = $transaction->get_many_related('Line_Item', array(array('LIN_type' => EEM_Line_Item::type_tax)));
         $this->_template_args['taxes'] = !empty($taxes) ? $taxes : array();
     } else {
         $this->_template_args['taxes'] = array();
     }
     $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['grand_total'] = EEH_Template::format_currency($transaction->total());
     $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:robert-osborne,项目名称:event-espresso-core-1,代码行数:56,代码来源:Registrations_Admin_Page.core.php

示例13: test_clear_cache__belongs_to

 /**
  * tests that clearing the cache on a belongsTo relation works
  */
 function test_clear_cache__belongs_to()
 {
     $t = EE_Transaction::new_instance(array('TXN_total' => '99'));
     $r = EE_Registration::new_instance(array('REG_code' => 'monkey1'));
     $success = $r->cache('Transaction', $t);
     $this->assertTrue($success);
     $t_cached = $r->get_one_from_cache('Transaction');
     $this->assertEquals($t, $t_cached);
     $t_removed = $r->clear_cache('Transaction');
     $this->assertEquals($t, $t_removed);
     $t_null = $r->get_one_from_cache('Transaction');
     $this->assertNull($t_null);
 }
开发者ID:DavidSteinbauer,项目名称:event-espresso-core,代码行数:16,代码来源:EE_Base_Class_Test.php

示例14: create_object

 /**
  * used by factory to create transaction object.
  *
  * @since 4.3.0
  *
  * @param array $args Incoming field values to set on the new object
  *
  * @return EE_Transaction|false
  */
 public function create_object($args)
 {
     //timezone?
     if (isset($args['timezone'])) {
         $timezone = $args['timezone'];
         unset($args['timezone']);
     } else {
         $timezone = null;
     }
     //date_formats?
     if (isset($args['formats']) && is_array($args['formats'])) {
         $formats = $args['formats'];
         unset($args['formats']);
     } else {
         $formats = array();
     }
     $transaction = EE_Transaction::new_instance($args, $timezone, $formats);
     $transactionID = $transaction->save();
     $transaction = $this->_maybe_chained($transaction, $args);
     $transaction->save();
     return $transactionID ? $transaction : false;
 }
开发者ID:DavidSteinbauer,项目名称:event-espresso-core,代码行数:31,代码来源:EE_UnitTest_Factory_For_Transaction.class.php

示例15: create_object

 /**
  * used by factory to create transaction object.
  *
  * @since 4.3.0
  *
  * @param array  $args Incoming field values to set on the new object
  *
  * @return EE_Transaction|false
  */
 public function create_object($args)
 {
     $transaction = EE_Transaction::new_instance($args);
     $transactionID = $transaction->save();
     $transaction = $this->_maybe_chained($transaction, $args);
     $transaction->save();
     return $transactionID ? $transaction : false;
 }
开发者ID:DavidSteinbauer,项目名称:event-espresso-core,代码行数:17,代码来源:factory.php


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