Skip to content

Commit

Permalink
[PAGOPA-2150] fix: changed wrongly referenced creditor institution in…
Browse files Browse the repository at this point in the history
… RT header (#110)
  • Loading branch information
aomegax authored Sep 18, 2024
2 parents 54fef62 + 39500ec commit 1b05d03
Show file tree
Hide file tree
Showing 8 changed files with 14 additions and 21 deletions.
4 changes: 2 additions & 2 deletions helm/Chart.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@ apiVersion: v2
name: pagopa-wisp-converter
description: A service that permits to handle nodoInviaRPT and nodoInviaCarrelloRPT request from WISP, interfacing them with GPD system
type: application
version: 0.188.0
appVersion: 0.2.1
version: 0.189.0
appVersion: 0.2.1-1-release-v0.2-fix-rt-domainid-error
dependencies:
- name: microservice-chart
version: 3.0.0
Expand Down
2 changes: 1 addition & 1 deletion helm/values-dev.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ microservice-chart:
fullnameOverride: ""
image:
repository: ghcr.io/pagopa/pagopa-wisp-converter
tag: "0.2.1"
tag: "0.2.1-1-release-v0.2-fix-rt-domainid-error"
pullPolicy: Always
livenessProbe:
httpGet:
Expand Down
2 changes: 1 addition & 1 deletion helm/values-prod.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ microservice-chart:
fullnameOverride: ""
image:
repository: ghcr.io/pagopa/pagopa-wisp-converter
tag: "0.2.1"
tag: "0.2.1-1-release-v0.2-fix-rt-domainid-error"
pullPolicy: Always
livenessProbe:
httpGet:
Expand Down
2 changes: 1 addition & 1 deletion helm/values-uat.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ microservice-chart:
fullnameOverride: ""
image:
repository: ghcr.io/pagopa/pagopa-wisp-converter
tag: "0.2.1"
tag: "0.2.1-1-release-v0.2-fix-rt-domainid-error"
pullPolicy: Always
livenessProbe:
httpGet:
Expand Down
2 changes: 1 addition & 1 deletion openapi/openapi.json

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion openapi/openapi_redirect.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"openapi": "3.0.1",
"info": {
"title": "WISP-Converter-redirect",
"version": "0.2.1"
"version": "0.2.1-1-release-v0.2-fix-rt-domainid-error"
},
"servers": [
{
Expand Down
2 changes: 1 addition & 1 deletion pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@

<groupId>it.gov.pagopa</groupId>
<artifactId>wisp-converter</artifactId>
<version>0.2.1</version>
<version>0.2.1-1-release-v0.2-fix-rt-domainid-error</version>
<name>pagoPA WISP Converter</name>
<description>A service that permits to handle nodoInviaRPT and nodoInviaCarrelloRPT request from WISP, converting them in NMU payments.</description>

Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,5 @@
package it.gov.pagopa.wispconverter.service;

import com.azure.messaging.servicebus.ServiceBusReceivedMessage;
import com.azure.messaging.servicebus.ServiceBusReceivedMessageContext;
import com.fasterxml.jackson.core.JsonProcessingException;
import com.fasterxml.jackson.databind.ObjectMapper;
import gov.telematici.pagamenti.ws.nodoperpa.ppthead.IntestazionePPT;
Expand All @@ -15,7 +13,6 @@
import it.gov.pagopa.gen.wispconverter.client.cache.model.ConfigurationKeyDto;
import it.gov.pagopa.gen.wispconverter.client.cache.model.ConnectionDto;
import it.gov.pagopa.gen.wispconverter.client.cache.model.StationDto;
import it.gov.pagopa.wispconverter.controller.model.RPTTimerRequest;
import it.gov.pagopa.wispconverter.exception.AppErrorCodeMessageEnum;
import it.gov.pagopa.wispconverter.exception.AppException;
import it.gov.pagopa.wispconverter.repository.model.RPTRequestEntity;
Expand All @@ -37,12 +34,10 @@
import lombok.RequiredArgsConstructor;
import lombok.extern.slf4j.Slf4j;
import org.slf4j.MDC;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.data.util.Pair;
import org.springframework.stereotype.Service;

import java.io.IOException;
import java.math.BigDecimal;
import java.nio.charset.StandardCharsets;
import java.time.Instant;
Expand Down Expand Up @@ -302,9 +297,9 @@ private PaSendRTV2Request extractDataFromPaSendRT(String payload, RPTContentDTO
return deepCopySendRTV2;
}

public String generateKoRtFromSessionData (String creditorInstitutionId, String iuv, RPTContentDTO rpt,
CommonFieldsDTO commonFields, gov.telematici.pagamenti.ws.papernodo.ObjectFactory objectFactory,
Map<String, ConfigurationKeyDto> configurations) {
public String generateKoRtFromSessionData(String creditorInstitutionId, String iuv, RPTContentDTO rpt,
CommonFieldsDTO commonFields, gov.telematici.pagamenti.ws.papernodo.ObjectFactory objectFactory,
Map<String, ConfigurationKeyDto> configurations) {
// generate the header for the paaInviaRT SOAP request. This object is common for each generated request
IntestazionePPT header = generateHeader(
creditorInstitutionId,
Expand Down Expand Up @@ -559,7 +554,7 @@ private String generatePayloadAsRawString(IntestazionePPT header, String signatu


public void scheduleRTSend(SessionDataDTO sessionData, String url, List<Pair<String, String>> headers, String payload, StationDto station,
String iuv, String noticeNumber, String idempotencyKey, ReceiptTypeEnum receiptType) {
String iuv, String noticeNumber, String idempotencyKey, ReceiptTypeEnum receiptType) {

try {

Expand Down Expand Up @@ -727,17 +722,16 @@ public void sendRTKoFromSessionId(String sessionId, InternalStepStatus internalS
Map<String, it.gov.pagopa.gen.wispconverter.client.cache.model.ConfigurationKeyDto> configurations = configData.getConfigurations();
Map<String, StationDto> stations = configData.getStations();

for(RPTContentDTO rpt: sessionDataDTO.getRpts().values()) {
for (RPTContentDTO rpt : sessionDataDTO.getRpts().values()) {
// idempotency key creation to check if the rt has already been sent
String idempotencyKey = sessionDataDTO.getCommonFields().getSessionId() + "_" + null;
String rtRawPayload = generateKoRtFromSessionData(
sessionDataDTO.getCommonFields().getCreditorInstitutionId(),
rpt.getRpt().getDomain().getDomainId(),
rpt.getIuv(),
rpt,
sessionDataDTO.getCommonFields(),
objectFactory,
configurations);
boolean isSuccessful = false;
StationDto station = stations.get(sessionDataDTO.getCommonFields().getStationId());
ConnectionDto stationConnection = station.getConnection();
String url = CommonUtility.constructUrl(
Expand All @@ -758,7 +752,6 @@ public void sendRTKoFromSessionId(String sessionId, InternalStepStatus internalS
// generate a new event in RE for store the successful sending of the receipt
generateREForSentRT(sessionDataDTO, rpt.getIuv(), null);
idempotencyStatus = IdempotencyStatusEnum.SUCCESS;
isSuccessful = true;

} catch (Exception e) {

Expand Down

0 comments on commit 1b05d03

Please sign in to comment.