/** * 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; }
/** * 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; }