update runner
This commit is contained in:
parent
d098450785
commit
221720ecc6
Binary file not shown.
@ -17,6 +17,8 @@ import lombok.extern.slf4j.Slf4j;
|
||||
|
||||
import java.lang.reflect.ParameterizedType;
|
||||
import java.lang.reflect.Type;
|
||||
import java.net.URLEncoder;
|
||||
import java.nio.charset.StandardCharsets;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.concurrent.TimeUnit;
|
||||
@ -132,9 +134,12 @@ public class HttpClientService implements HttpClientUseCase {
|
||||
urlBuilder.append("&");
|
||||
}
|
||||
|
||||
urlBuilder.append(entry.getKey())
|
||||
.append("=")
|
||||
.append(entry.getValue() != null ? entry.getValue() : "");
|
||||
String encodedKey = URLEncoder.encode(entry.getKey(), StandardCharsets.UTF_8);
|
||||
String encodedValue = entry.getValue() != null
|
||||
? URLEncoder.encode(entry.getValue(), StandardCharsets.UTF_8)
|
||||
: "";
|
||||
|
||||
urlBuilder.append(encodedKey).append("=").append(encodedValue);
|
||||
}
|
||||
|
||||
return urlBuilder.toString();
|
||||
|
||||
@ -41,7 +41,7 @@ public class ServiceOrderPaymentSearchRequest {
|
||||
.getDate();
|
||||
}
|
||||
|
||||
public String getPaymentRequestId() {
|
||||
public String getInstructionRequestId() {
|
||||
return getProcedureRequest()
|
||||
.getInstructionIdentifier()
|
||||
.getIdentification()
|
||||
@ -68,7 +68,7 @@ public class ServiceOrderPaymentSearchRequest {
|
||||
entry("appId", Objects.toString(getAppId(), "")),
|
||||
entry("customerReferenceFintechId", Objects.toString(getCustomerReferenceFintechId(), "")),
|
||||
entry("initiatedDate", Objects.toString(getInitiatedDate(), "")),
|
||||
entry("paymentRequestId", Objects.toString(getPaymentRequestId(), ""))
|
||||
entry("instructionRequestId", Objects.toString(getInstructionRequestId(), ""))
|
||||
);
|
||||
}
|
||||
}
|
||||
@ -2,6 +2,7 @@ package com.banesco.module.service_order_payment_search.infrastructure.adapter;
|
||||
|
||||
import com.banesco.common.domain.exception.HttpStatusCodeException;
|
||||
import com.banesco.module.payment_order.application.usecase.PaymentOrderUseCase;
|
||||
import com.banesco.module.payment_order.domain.dto.request.PaymentOrderRequest;
|
||||
import com.banesco.module.payment_order.domain.model.PaymentOrderBol;
|
||||
import com.banesco.module.payment_order.domain.model.PaymentOrderBole;
|
||||
import com.banesco.module.service_order_payment_search.application.repository.ApiPrivateRepository;
|
||||
@ -30,15 +31,19 @@ public class ApiPrivateAdapter implements ApiPrivateRepository {
|
||||
public List<ServicingOrderProcedure> execute(
|
||||
ServiceOrderPaymentSearchRequest request
|
||||
) {
|
||||
return request.isBole() ? executeBole(request) : executeBol(request);
|
||||
PaymentOrderRequest paymentOrderRequest =
|
||||
ServicingOrderMapper.toPaymentRequest(request);
|
||||
|
||||
return request.isBole()
|
||||
? executeBole(paymentOrderRequest)
|
||||
: executeBol(paymentOrderRequest);
|
||||
}
|
||||
|
||||
private List<ServicingOrderProcedure> executeBole(
|
||||
ServiceOrderPaymentSearchRequest request
|
||||
PaymentOrderRequest request
|
||||
) {
|
||||
List<PaymentOrderBole> response = paymentOrderUseCase.execute(
|
||||
ServicingOrderMapper.toPaymentRequest(request),
|
||||
PaymentOrderBole.class
|
||||
request, PaymentOrderBole.class
|
||||
);
|
||||
|
||||
log.info("Resultado de las transacciones obtenidas (BOLE): {}", response.size());
|
||||
@ -49,11 +54,10 @@ public class ApiPrivateAdapter implements ApiPrivateRepository {
|
||||
}
|
||||
|
||||
private List<ServicingOrderProcedure> executeBol(
|
||||
ServiceOrderPaymentSearchRequest request
|
||||
PaymentOrderRequest request
|
||||
) {
|
||||
List<PaymentOrderBol> response = paymentOrderUseCase.execute(
|
||||
ServicingOrderMapper.toPaymentRequest(request),
|
||||
PaymentOrderBol.class
|
||||
request, PaymentOrderBol.class
|
||||
);
|
||||
|
||||
log.info("Resultado de las transacciones obtenidas (BOL): {}", response.size());
|
||||
|
||||
@ -31,8 +31,8 @@ public class ServicingOrderMapper {
|
||||
? request.getInitiatedDate()
|
||||
: null
|
||||
)
|
||||
.id((!StringUtil.isNullOrEmpty(request.getPaymentRequestId()))
|
||||
? Long.valueOf(request.getPaymentRequestId())
|
||||
.id((!StringUtil.isNullOrEmpty(request.getInstructionRequestId()))
|
||||
? Long.valueOf(request.getInstructionRequestId())
|
||||
: null
|
||||
)
|
||||
.build()
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user