diff --git a/src/main/java/it/pagopa/swclient/mil/idpay/bean/PinBlockDTO.java b/src/main/java/it/pagopa/swclient/mil/idpay/bean/PinBlockDTO.java index f0d996b..acb8459 100644 --- a/src/main/java/it/pagopa/swclient/mil/idpay/bean/PinBlockDTO.java +++ b/src/main/java/it/pagopa/swclient/mil/idpay/bean/PinBlockDTO.java @@ -12,8 +12,8 @@ @Builder public class PinBlockDTO { - @NotNull(message = "[" + ErrorCode.ERROR_ENCRYPTEDPINBLOCK_MUST_NOT_BE_NULL + "] encryptedPinBlock must not be null") - private String encryptedPinBlock; + @NotNull(message = "[" + ErrorCode.ERROR_ENCRYPTEDPINBLOCK_MUST_NOT_BE_NULL + "] pinBlock must not be null") + private String pinBlock; @NotNull(message = "[" + ErrorCode.ERROR_ENCRYPTEDKEY_MUST_NOT_BE_NULL + "] encryptedKey must not be null") private String encryptedKey; diff --git a/src/main/java/it/pagopa/swclient/mil/idpay/service/TransactionsService.java b/src/main/java/it/pagopa/swclient/mil/idpay/service/TransactionsService.java index 83246e2..3b4dcb7 100644 --- a/src/main/java/it/pagopa/swclient/mil/idpay/service/TransactionsService.java +++ b/src/main/java/it/pagopa/swclient/mil/idpay/service/TransactionsService.java @@ -25,7 +25,6 @@ import it.pagopa.swclient.mil.idpay.dao.IdpayTransactionEntity; import it.pagopa.swclient.mil.idpay.dao.IdpayTransactionRepository; import jakarta.enterprise.context.ApplicationScoped; -import jakarta.inject.Inject; import jakarta.ws.rs.BadRequestException; import jakarta.ws.rs.InternalServerErrorException; import jakarta.ws.rs.NotFoundException; @@ -56,14 +55,11 @@ public class TransactionsService { private final SimpleDateFormat lastUpdateFormat = new SimpleDateFormat("yyyy-MM-dd'T'HH:mm:ss"); - @Inject - IdpayTransactionRepository idpayTransactionRepository; + private final IdpayTransactionRepository idpayTransactionRepository; - @Inject - EncryptUtil encryptUtil; + private final EncryptUtil encryptUtil; - @Inject - AzureKeyVaultService azureKeyVaultService; + private final AzureKeyVaultService azureKeyVaultService; @RestClient AzureADRestClient azureADRestClient; @@ -74,8 +70,7 @@ public class TransactionsService { @RestClient IpzsRestClient ipzsRestClient; - @Inject - IdPayRestService idPayRestService; + private final IdPayRestService idPayRestService; private static final String BEARER = "Bearer "; @@ -90,6 +85,14 @@ public class TransactionsService { @ConfigProperty(name = "azure-auth-api.identity") String identity; + public TransactionsService(IdpayTransactionRepository idpayTransactionRepository, EncryptUtil encryptUtil, + AzureKeyVaultService azureKeyVaultService, IdPayRestService idPayRestService) { + this.idpayTransactionRepository = idpayTransactionRepository; + this.encryptUtil = encryptUtil; + this.azureKeyVaultService = azureKeyVaultService; + this.idPayRestService = idPayRestService; + } + public Uni getInitiatives(CommonHeader headers) { Log.debugf("TransactionsService -> getInitiatives - Input parameters: %s", headers); @@ -533,7 +536,7 @@ public Uni authorizeTransaction(CommonHeader headers, AuthorizeTransac String encryptedSessionKey = encryptUtil.encryptSessionKeyForIdpay(publicKeyIDPay, unwrappedKey.getValue()); PinBlockDTO pinBlock = PinBlockDTO.builder() - .encryptedPinBlock(authorizeTransaction.getAuthCodeBlockData().getAuthCodeBlock()) + .pinBlock(authorizeTransaction.getAuthCodeBlockData().getAuthCodeBlock()) .encryptedKey(encryptedSessionKey) .build();