Code Duplication    Length = 5-5 lines in 3 locations

payment_methods/Paypal_Express/EEG_Paypal_Express.gateway.php 3 locations

@@ 98-102 (lines=5) @@
95
	 *  @param type $cancel_url
96
	 */
97
	public function set_redirection_info( $payment, $billing_info = array(), $return_url = NULL, $notify_url = NULL, $cancel_url = NULL ) {
98
		if ( ! $payment instanceof EEI_Payment ) {
99
			$payment->set_gateway_response( __( 'Error. No associated payment was found.', 'event_espresso' ) );
100
			$payment->set_status( $this->_pay_model->failed_status() );
101
			return $payment;
102
		}
103
		$transaction = $payment->transaction();
104
		if ( ! $transaction instanceof EEI_Transaction ) {
105
			$payment->set_gateway_response( __( 'Could not process this payment because it has no associated transaction.', 'event_espresso' ) );
@@ 104-108 (lines=5) @@
101
			return $payment;
102
		}
103
		$transaction = $payment->transaction();
104
		if ( ! $transaction instanceof EEI_Transaction ) {
105
			$payment->set_gateway_response( __( 'Could not process this payment because it has no associated transaction.', 'event_espresso' ) );
106
			$payment->set_status( $this->_pay_model->failed_status() );
107
			return $payment;
108
		}
109
		$order_description = substr( sprintf( __('Event Registrations from %s', 'event_espresso'), get_bloginfo('name') ), 0, 127 );
110
		$primary_registration = $transaction->primary_registration();
111
		$primary_attendee = $primary_registration instanceof EE_Registration ? $primary_registration->attendee() : false;
@@ 261-265 (lines=5) @@
258
259
			$payment_details = $payment->details();
260
			$transaction = $payment->transaction();
261
			if ( ! $transaction instanceof EEI_Transaction ) {
262
				$payment->set_gateway_response( __( 'Could not process this payment because it has no associated transaction.', 'event_espresso' ) );
263
				$payment->set_status( $this->_pay_model->failed_status() );
264
				return $payment;
265
			}
266
			$primary_registrant = $transaction->primary_registration();
267
268
			// Check if we still have the token.