@Test public void shouldVerifyWithFailure() { log.info("--shouldVerifyWithFailure"); PayPalStatusVerifier mockStatusVerifier = new MockStatusVerifier(); PayPalVerificationService verificationService = new PayPalVerificationService("dummyAddress", new PayPalProcessorsFactory(MockVerifiedPayPalProcessor.class), new TestErrorHandler(), mockStatusVerifier); HashMap<String, String[]> parametersMap = new HashMap<String, String[]>(); parametersMap.put(RequestParameters.Parameter.payment_status.toString(), new String[]{"INVALID"}); PayPalStatus status = verificationService.verify(new RequestParameters(new RequestMock(parametersMap))); assertThat(status.isInvalid()).isTrue(); }
public PayPalStatus verify(RequestParameters requestParameters) { PayPalStatus status = statusVerifier.verify(payPalAddress, requestParameters); PayPalParameters parameters = PayPalParameters.create(requestParameters); PayPalErrorHandler.ErrorMessage errorMessage = errorHandler.prepareErrorMessage(); errorMessage.appendPayPalParameters(parameters); process(errorMessage, status, parameters); return status; }
PayPalVerificationService { public PayPalStatus verify(RequestParameters requestParameters) { PayPalStatus status = statusVerifier.verify(payPalAddress, requestParameters); PayPalParameters parameters = PayPalParameters.create(requestParameters); PayPalErrorHandler.ErrorMessage errorMessage = errorHandler.prepareErrorMessage(); errorMessage.appendPayPalParameters(parameters); process(errorMessage, status, parameters); return status; } }
PayPalVerificationService { public PayPalStatus verify(RequestParameters requestParameters) { PayPalStatus status = statusVerifier.verify(payPalAddress, requestParameters); PayPalParameters parameters = PayPalParameters.create(requestParameters); PayPalErrorHandler.ErrorMessage errorMessage = errorHandler.prepareErrorMessage(); errorMessage.appendPayPalParameters(parameters); process(errorMessage, status, parameters); return status; } PayPalVerificationService(String payPalAddress, PayPalProcessorsFactory palProcessorsFactory, PayPalErrorHandler errorHandler);  PayPalVerificationService(String payPalAddress, PayPalProcessorsFactory processorsFactory, PayPalErrorHandler errorHandler, PayPalStatusVerifier statusVerifier); }
PayPalVerificationService { public PayPalStatus verify(RequestParameters requestParameters) { PayPalStatus status = statusVerifier.verify(payPalAddress, requestParameters); PayPalParameters parameters = PayPalParameters.create(requestParameters); PayPalErrorHandler.ErrorMessage errorMessage = errorHandler.prepareErrorMessage(); errorMessage.appendPayPalParameters(parameters); process(errorMessage, status, parameters); return status; } PayPalVerificationService(String payPalAddress, PayPalProcessorsFactory palProcessorsFactory, PayPalErrorHandler errorHandler);  PayPalVerificationService(String payPalAddress, PayPalProcessorsFactory processorsFactory, PayPalErrorHandler errorHandler, PayPalStatusVerifier statusVerifier); PayPalStatus verify(RequestParameters requestParameters); }
PayPalVerificationService { public PayPalStatus verify(RequestParameters requestParameters) { PayPalStatus status = statusVerifier.verify(payPalAddress, requestParameters); PayPalParameters parameters = PayPalParameters.create(requestParameters); PayPalErrorHandler.ErrorMessage errorMessage = errorHandler.prepareErrorMessage(); errorMessage.appendPayPalParameters(parameters); process(errorMessage, status, parameters); return status; } PayPalVerificationService(String payPalAddress, PayPalProcessorsFactory palProcessorsFactory, PayPalErrorHandler errorHandler);  PayPalVerificationService(String payPalAddress, PayPalProcessorsFactory processorsFactory, PayPalErrorHandler errorHandler, PayPalStatusVerifier statusVerifier); PayPalStatus verify(RequestParameters requestParameters); static final PayPalStatusVerifier DefaultStatusVerifier; }