Code Duplication    Length = 9-9 lines in 3 locations

payment_methods/Paypal_Express/EEG_Paypal_Express.gateway.php 3 locations

@@ 230-238 (lines=9) @@
227
			// We got the Token so we may continue with the payment and redirect the client.
228
			$payment->set_details( $response_args );
229
			$payment->set_redirect_url( 'https://www.sandbox.paypal.com/cgi-bin/webscr?useraction=commit&cmd=_express-checkout&token=' . $response_args['TOKEN'] );
230
		} else {
231
			if ( isset($response_args['L_ERRORCODE']) ) {
232
				$payment->set_gateway_response( $response_args['L_ERRORCODE'] . '; ' . $response_args['L_SHORTMESSAGE'] );
233
			} else {
234
				$payment->set_gateway_response( __( 'Error occurred while trying to setup the Express Checkout.', 'event_espresso' ) );
235
			}
236
			$payment->set_details( $response_args );
237
			$payment->set_status( $this->_pay_model->failed_status() );
238
		}
239
240
		return $payment;
241
	}
@@ 305-313 (lines=9) @@
302
					$payment->set_details( $cdata_response_args );
303
					$payment->set_gateway_response( isset( $docheckout_response_args['PAYMENTINFO_0_ACK'] ) ? $docheckout_response_args['PAYMENTINFO_0_ACK'] : '' );
304
					$payment->set_status( $this->_pay_model->approved_status() );
305
				} else {
306
					if ( isset($docheckout_response_args['L_ERRORCODE']) ) {
307
						$payment->set_gateway_response( $docheckout_response_args['L_ERRORCODE'] . '; ' . $docheckout_response_args['L_SHORTMESSAGE'] );
308
					} else {
309
						$payment->set_gateway_response( __( 'Error occurred while trying to Capture the funds.', 'event_espresso' ) );
310
					}
311
					$payment->set_details( $docheckout_response_args );
312
					$payment->set_status( $this->_pay_model->declined_status() );
313
				}
314
			} else {
315
				if ( isset($cdata_response_args['L_ERRORCODE']) ) {
316
					$payment->set_gateway_response( $cdata_response_args['L_ERRORCODE'] . '; ' . $cdata_response_args['L_SHORTMESSAGE'] );
@@ 314-322 (lines=9) @@
311
					$payment->set_details( $docheckout_response_args );
312
					$payment->set_status( $this->_pay_model->declined_status() );
313
				}
314
			} else {
315
				if ( isset($cdata_response_args['L_ERRORCODE']) ) {
316
					$payment->set_gateway_response( $cdata_response_args['L_ERRORCODE'] . '; ' . $cdata_response_args['L_SHORTMESSAGE'] );
317
				} else {
318
					$payment->set_gateway_response( __( 'Error occurred while trying to get payment Details from PayPal.', 'event_espresso' ) );
319
				}
320
				$payment->set_details( $cdata_response_args );
321
				$payment->set_status( $this->_pay_model->failed_status() );
322
			}
323
		} else {
324
			$payment->set_gateway_response( __( 'Error occurred while trying to process the payment.', 'event_espresso' ) );
325
			$payment->set_status( $this->_pay_model->failed_status() );