Update channelOrigin as String
This commit is contained in:
parent
08ecdd84c0
commit
d9c9a31496
Binary file not shown.
@ -22,7 +22,7 @@ public class SerializationHelper {
|
|||||||
|
|
||||||
@Inject
|
@Inject
|
||||||
public SerializationHelper(
|
public SerializationHelper(
|
||||||
ObjectMapper objectMapper
|
ObjectMapper objectMapper
|
||||||
) {
|
) {
|
||||||
this.objectMapper = objectMapper;
|
this.objectMapper = objectMapper;
|
||||||
}
|
}
|
||||||
@ -156,4 +156,17 @@ public class SerializationHelper {
|
|||||||
|
|
||||||
return encodeSha256(finalString);
|
return encodeSha256(finalString);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public String generateSignature(
|
||||||
|
Long id,
|
||||||
|
String channelOrigin
|
||||||
|
) {
|
||||||
|
String channelBase64 = encodeStringToBase64(channelOrigin);
|
||||||
|
String finalString = id + channelBase64;
|
||||||
|
|
||||||
|
log.info("1. Operation concatenando valores: {}", finalString);
|
||||||
|
log.info("2. Channel Origin codificado: {}", channelBase64);
|
||||||
|
|
||||||
|
return encodeSha256(finalString);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@ -266,7 +266,7 @@ public class HttpClientService implements HttpClientUseCase {
|
|||||||
log.info("Metodo HTTP: {}", request.getMethod().name());
|
log.info("Metodo HTTP: {}", request.getMethod().name());
|
||||||
|
|
||||||
if(request.getBody() != null) {
|
if(request.getBody() != null) {
|
||||||
log.info("Cuerpo de la Peticion: {}", request.getBody());
|
log.info("Peticion Cuerpo: {}", request.getBody());
|
||||||
}
|
}
|
||||||
|
|
||||||
return switch (request.getMethod()) {
|
return switch (request.getMethod()) {
|
||||||
|
|||||||
@ -12,5 +12,5 @@ import lombok.*;
|
|||||||
@RegisterForReflection
|
@RegisterForReflection
|
||||||
@JsonInclude(JsonInclude.Include.NON_NULL)
|
@JsonInclude(JsonInclude.Include.NON_NULL)
|
||||||
public class Instruction {
|
public class Instruction {
|
||||||
private InstructionPurposeType instructionPurposeType; // Request JSON: "channelOrigin" (BOL)
|
private String instructionPurposeType; // Request JSON: "channelOrigin" (BOL)
|
||||||
}
|
}
|
||||||
|
|||||||
@ -1,5 +0,0 @@
|
|||||||
package com.banesco.module.instruction.domain.model;
|
|
||||||
|
|
||||||
public enum InstructionPurposeType {
|
|
||||||
BOL,
|
|
||||||
}
|
|
||||||
@ -43,6 +43,9 @@ public class PaymentInitiationRequestService implements PaymentInitiationRequest
|
|||||||
apiResponse.getData(),
|
apiResponse.getData(),
|
||||||
apiResponse.getStatusResponse().getStatusCode()
|
apiResponse.getStatusResponse().getStatusCode()
|
||||||
);
|
);
|
||||||
|
} catch (ApiPrivateException e) {
|
||||||
|
log.warn("Excepcion de la api privada: {} -> {}", e.getStatusCode(), e.getMessage());
|
||||||
|
response = messageHelper.handleException(HttpStatusCodeException.badRequest("400"));
|
||||||
} catch (HttpStatusCodeException e) {
|
} catch (HttpStatusCodeException e) {
|
||||||
log.error("Excepcion HTTP del api privada: {} - {}", e.getStatusCode(), e.getErrorCode());
|
log.error("Excepcion HTTP del api privada: {} - {}", e.getStatusCode(), e.getErrorCode());
|
||||||
response = messageHelper.handleException(e);
|
response = messageHelper.handleException(e);
|
||||||
|
|||||||
@ -77,8 +77,7 @@ public class PaymentInitiationRequestRequest {
|
|||||||
@JsonIgnore
|
@JsonIgnore
|
||||||
public String getChannelCode() {
|
public String getChannelCode() {
|
||||||
return procedureRequest
|
return procedureRequest
|
||||||
.getInstructionPurposeType()
|
.getInstructionPurposeType();
|
||||||
.name();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@JsonIgnore
|
@JsonIgnore
|
||||||
|
|||||||
@ -63,7 +63,7 @@ public class PaymentRequestClient implements PaymentRequestUseCase {
|
|||||||
log.error(
|
log.error(
|
||||||
"API retorno exitoso pero con detalle vacio. Codigo: {}, Mensaje: {}",
|
"API retorno exitoso pero con detalle vacio. Codigo: {}, Mensaje: {}",
|
||||||
response.getEstatus(),
|
response.getEstatus(),
|
||||||
response.getMensaje()
|
response.getMensaje()
|
||||||
);
|
);
|
||||||
|
|
||||||
throw ApiPrivateException.builder()
|
throw ApiPrivateException.builder()
|
||||||
@ -89,8 +89,8 @@ public class PaymentRequestClient implements PaymentRequestUseCase {
|
|||||||
throw ApiPrivateException.builder()
|
throw ApiPrivateException.builder()
|
||||||
.statusCode(response.getEstatus())
|
.statusCode(response.getEstatus())
|
||||||
.message((error.getCodError() != null)
|
.message((error.getCodError() != null)
|
||||||
? error.getCodError() + ":" + error.getMensajeError()
|
? error.getCodError() + ":" + error.getMensajeError()
|
||||||
: "EMPTY_MESSAGE"
|
: "EMPTY_MESSAGE"
|
||||||
)
|
)
|
||||||
.build();
|
.build();
|
||||||
} catch (ApiPrivateException e) {
|
} catch (ApiPrivateException e) {
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user