PROX-39: fix term url (#5)

* PROX-39: fix term url

* PROX-39: update properties

* PROX-39: update pom version
This commit is contained in:
Anatoly Cherkasov 2017-01-12 19:24:14 +03:00 committed by GitHub
parent fabd2306d7
commit 1e4949902c
4 changed files with 11 additions and 11 deletions

View File

@ -12,7 +12,7 @@
</parent>
<artifactId>proxy-mocketbank</artifactId>
<version>1.0.2</version>
<version>1.0.3</version>
<packaging>jar</packaging>
<name>proxy-mocketbank</name>

View File

@ -6,6 +6,7 @@ import org.apache.thrift.TException;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.util.StringUtils;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RestController;
@ -15,7 +16,6 @@ import javax.servlet.http.HttpServletResponse;
import java.io.IOException;
import java.io.UnsupportedEncodingException;
import java.nio.ByteBuffer;
import java.util.Optional;
@RestController
@RequestMapping(value = "/mocketbank")
@ -38,13 +38,13 @@ public class MocketBankController {
try {
callback = Converter.mapToByteBuffer(Converter.mapArrayToMap(request.getParameterMap()));
} catch (IOException e) {
LOGGER.error("Exception Map to ByteBuffer in processCallback", e);
LOGGER.warn("Exception Map to ByteBuffer in processCallback", e);
}
if (Optional.ofNullable(request.getParameter("MD")).isPresent()) {
if (StringUtils.hasText(request.getParameter("MD"))) {
tag = request.getParameter("MD");
} else {
LOGGER.error("Missing a required parameter 'MD' ");
LOGGER.warn("Missing a required parameter 'MD' ");
}
try {
@ -54,7 +54,7 @@ public class MocketBankController {
LOGGER.error("Exception in processCallback", e);
}
if (!request.getParameter("termination_uri").isEmpty())
if (StringUtils.hasText(request.getParameter("termination_uri")))
servletResponse.sendRedirect(request.getParameter("termination_uri"));
return resp;

View File

@ -173,7 +173,7 @@ public class MocketBankServerHandler implements ProviderProxySrv.Iface {
Map<String, String> params = new HashMap<>();
params.put("PaReq", verifyEnrollmentResponse.getPaReq());
params.put("MD", tag);
params.put("TermUrl", MocketBankMpiUtils.getCallbackUrl(callbackUrl, "/test/term_url{?termination_uri}"));
params.put("TermUrl", MocketBankMpiUtils.getCallbackUrl(callbackUrl, "/mocketbank/term_url{?termination_uri}"));
LOGGER.info("Processed: prepare redirect params {}", params);

View File

@ -1,10 +1,10 @@
spring:
application:
name: name
description: description
name: @name@
description: @description@
---
info:
version: 1.0.0
version: @version@
responsible: Anatoly Cherkasov
stage: dev
---
@ -32,7 +32,7 @@ hellgate:
url: http://127.0.0.1:8023/v1/proxyhost/provider
---
timer:
timeout: 60
timeout: 600
---
fixture:
cards: classpath:fixture/cards.csv