Code Duplication    Length = 9-9 lines in 3 locations

payment_methods/Paypal_Express/EEG_Paypal_Express.gateway.php 3 locations

@@ 243-251 (lines=9) @@
240
241
			$gateway_url = ( $this->_debug_mode ) ? 'https://www.sandbox.paypal.com' : 'https://www.paypal.com';
242
			$payment->set_redirect_url( $gateway_url . '/checkoutnow?useraction=commit&cmd=_express-checkout&token=' . $response_args['TOKEN'] );
243
		} else {
244
			if ( isset($response_args['L_ERRORCODE']) ) {
245
				$payment->set_gateway_response( $response_args['L_ERRORCODE'] . '; ' . $response_args['L_SHORTMESSAGE'] );
246
			} else {
247
				$payment->set_gateway_response( __( 'Error occurred while trying to setup the Express Checkout.', 'event_espresso' ) );
248
			}
249
			$payment->set_details( $response_args );
250
			$payment->set_status( $this->_pay_model->failed_status() );
251
		}
252
253
		return $payment;
254
	}
@@ 318-326 (lines=9) @@
315
					$payment->set_details( $cdata_response_args );
316
					$payment->set_gateway_response( isset( $docheckout_response_args['PAYMENTINFO_0_ACK'] ) ? $docheckout_response_args['PAYMENTINFO_0_ACK'] : '' );
317
					$payment->set_status( $this->_pay_model->approved_status() );
318
				} else {
319
					if ( isset($docheckout_response_args['L_ERRORCODE']) ) {
320
						$payment->set_gateway_response( $docheckout_response_args['L_ERRORCODE'] . '; ' . $docheckout_response_args['L_SHORTMESSAGE'] );
321
					} else {
322
						$payment->set_gateway_response( __( 'Error occurred while trying to Capture the funds.', 'event_espresso' ) );
323
					}
324
					$payment->set_details( $docheckout_response_args );
325
					$payment->set_status( $this->_pay_model->declined_status() );
326
				}
327
			} else {
328
				if ( isset($cdata_response_args['L_ERRORCODE']) ) {
329
					$payment->set_gateway_response( $cdata_response_args['L_ERRORCODE'] . '; ' . $cdata_response_args['L_SHORTMESSAGE'] );
@@ 327-335 (lines=9) @@
324
					$payment->set_details( $docheckout_response_args );
325
					$payment->set_status( $this->_pay_model->declined_status() );
326
				}
327
			} else {
328
				if ( isset($cdata_response_args['L_ERRORCODE']) ) {
329
					$payment->set_gateway_response( $cdata_response_args['L_ERRORCODE'] . '; ' . $cdata_response_args['L_SHORTMESSAGE'] );
330
				} else {
331
					$payment->set_gateway_response( __( 'Error occurred while trying to get payment Details from PayPal.', 'event_espresso' ) );
332
				}
333
				$payment->set_details( $cdata_response_args );
334
				$payment->set_status( $this->_pay_model->failed_status() );
335
			}
336
		} else {
337
			$payment->set_gateway_response( __( 'Error occurred while trying to process the payment.', 'event_espresso' ) );
338
			$payment->set_status( $this->_pay_model->failed_status() );