Code Duplication    Length = 5-5 lines in 3 locations

payment_methods/Paypal_Express/EEG_Paypal_Express.gateway.php 3 locations

@@ 110-114 (lines=5) @@
107
			return $payment;
108
		}
109
		$transaction = $payment->transaction();
110
		if ( ! $transaction instanceof EEI_Transaction ) {
111
			$payment->set_gateway_response( __( 'Could not process this payment because it has no associated transaction.', 'event_espresso' ) );
112
			$payment->set_status( $this->_pay_model->failed_status() );
113
			return $payment;
114
		}
115
		$order_description = substr( $this->_format_order_description($payment), 0, 127 );
116
		$primary_registration = $transaction->primary_registration();
117
		$primary_attendee = $primary_registration instanceof EE_Registration ? $primary_registration->attendee() : false;
@@ 274-278 (lines=5) @@
271
272
			$payment_details = $payment->details();
273
			$transaction = $payment->transaction();
274
			if ( ! $transaction instanceof EEI_Transaction ) {
275
				$payment->set_gateway_response( __( 'Could not process this payment because it has no associated transaction.', 'event_espresso' ) );
276
				$payment->set_status( $this->_pay_model->failed_status() );
277
				return $payment;
278
			}
279
			$primary_registrant = $transaction->primary_registration();
280
281
			// Check if we still have the token.
@@ 104-108 (lines=5) @@
101
	 *  @param type $cancel_url
102
	 */
103
	public function set_redirection_info( $payment, $billing_info = array(), $return_url = NULL, $notify_url = NULL, $cancel_url = NULL ) {
104
		if ( ! $payment instanceof EEI_Payment ) {
105
			$payment->set_gateway_response( __( 'Error. No associated payment was found.', 'event_espresso' ) );
106
			$payment->set_status( $this->_pay_model->failed_status() );
107
			return $payment;
108
		}
109
		$transaction = $payment->transaction();
110
		if ( ! $transaction instanceof EEI_Transaction ) {
111
			$payment->set_gateway_response( __( 'Could not process this payment because it has no associated transaction.', 'event_espresso' ) );