/**
  * 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);
 }
 /**
  * Handles the gateway-specific logic when displaying the payment page..
  * @global type $EE_Session
  * @param EE_Transaction $transaction
  * @return string
  */
 public function thank_you_page_logic(EE_Transaction $transaction)
 {
     //check that we've received an IPN for this payment, otherwise consider this the IPN
     $this->_EEM_Gateways->handle_ipn_for_transaction($transaction);
     parent::thank_you_page_logic($transaction);
 }