/** * Override's parent so this gateway integration class can act like one that uses * a separate IPN or not, depending on what is set in the payment methods settings form * @return boolean */ public function uses_separate_IPN_request() { if ($this->_override_use_separate_IPN_request !== null) { $this->set_uses_separate_IPN_request($this->_override_use_separate_IPN_request); } return parent::uses_separate_IPN_request(); }
/** * _process_off_site_payment * * @access private * @param \EE_Offsite_Gateway $gateway * @return \EE_Payment */ private function _process_off_site_payment(EE_Offsite_Gateway $gateway) { try { // if gateway uses_separate_IPN_request, then we don't have to process the IPN manually if ($gateway instanceof EE_Offsite_Gateway && $gateway->uses_separate_IPN_request()) { $payment = $this->checkout->transaction->last_payment(); //$payment_source = 'last_payment'; } else { // get payment details and process results /** @type EE_Payment_Processor $payment_processor */ $payment_processor = EE_Registry::instance()->load_core('Payment_Processor'); $payment = $payment_processor->process_ipn($_REQUEST, $this->checkout->transaction, $this->checkout->payment_method, true, false); //$payment_source = 'process_ipn'; } } catch (Exception $e) { // let's just eat the exception and try to move on using any previously set payment info $payment = $this->checkout->transaction->last_payment(); //$payment_source = 'last_payment after Exception'; // but if we STILL don't have a payment object if (!$payment instanceof EE_Payment) { // then we'll object ! ( not object like a thing... but object like what a lawyer says ! ) $this->_handle_payment_processor_exception($e); } } // DEBUG LOG //$this->checkout->log( __CLASS__, __FUNCTION__, __LINE__, // array( // 'process_ipn_payment' => $payment, // 'payment_source' => $payment_source, // ) //); return $payment; }