Update channelOrigin as String

This commit is contained in:
Ramon Ramirez 2026-01-27 12:16:58 -04:00
parent 08ecdd84c0
commit d9c9a31496
8 changed files with 23 additions and 13 deletions

View File

@ -22,7 +22,7 @@ public class SerializationHelper {
@Inject
public SerializationHelper(
ObjectMapper objectMapper
ObjectMapper objectMapper
) {
this.objectMapper = objectMapper;
}
@ -156,4 +156,17 @@ public class SerializationHelper {
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);
}
}

View File

@ -266,7 +266,7 @@ public class HttpClientService implements HttpClientUseCase {
log.info("Metodo HTTP: {}", request.getMethod().name());
if(request.getBody() != null) {
log.info("Cuerpo de la Peticion: {}", request.getBody());
log.info("Peticion Cuerpo: {}", request.getBody());
}
return switch (request.getMethod()) {

View File

@ -12,5 +12,5 @@ import lombok.*;
@RegisterForReflection
@JsonInclude(JsonInclude.Include.NON_NULL)
public class Instruction {
private InstructionPurposeType instructionPurposeType; // Request JSON: "channelOrigin" (BOL)
private String instructionPurposeType; // Request JSON: "channelOrigin" (BOL)
}

View File

@ -1,5 +0,0 @@
package com.banesco.module.instruction.domain.model;
public enum InstructionPurposeType {
BOL,
}

View File

@ -43,6 +43,9 @@ public class PaymentInitiationRequestService implements PaymentInitiationRequest
apiResponse.getData(),
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) {
log.error("Excepcion HTTP del api privada: {} - {}", e.getStatusCode(), e.getErrorCode());
response = messageHelper.handleException(e);

View File

@ -77,8 +77,7 @@ public class PaymentInitiationRequestRequest {
@JsonIgnore
public String getChannelCode() {
return procedureRequest
.getInstructionPurposeType()
.name();
.getInstructionPurposeType();
}
@JsonIgnore

View File

@ -63,7 +63,7 @@ public class PaymentRequestClient implements PaymentRequestUseCase {
log.error(
"API retorno exitoso pero con detalle vacio. Codigo: {}, Mensaje: {}",
response.getEstatus(),
response.getMensaje()
response.getMensaje()
);
throw ApiPrivateException.builder()
@ -89,8 +89,8 @@ public class PaymentRequestClient implements PaymentRequestUseCase {
throw ApiPrivateException.builder()
.statusCode(response.getEstatus())
.message((error.getCodError() != null)
? error.getCodError() + ":" + error.getMensajeError()
: "EMPTY_MESSAGE"
? error.getCodError() + ":" + error.getMensajeError()
: "EMPTY_MESSAGE"
)
.build();
} catch (ApiPrivateException e) {