Skip to content

Commit

Permalink
Issue #134: Rimossa valorizzazione del campo tipoFirma in nodoInviaRP…
Browse files Browse the repository at this point in the history
…T e nodoInviaCarrelloRPT, deprecato nei servizi pagoPA v6.2.0 attualmente in produzione.
  • Loading branch information
nardil committed Nov 15, 2019
1 parent 21163bb commit 97e2095
Show file tree
Hide file tree
Showing 3 changed files with 19 additions and 62 deletions.
77 changes: 18 additions & 59 deletions jars/core/src/main/java/it/govpay/core/utils/RptUtils.java
Original file line number Diff line number Diff line change
Expand Up @@ -126,69 +126,28 @@ private static String getNotEmpty(String text) {
return text;
}

// public static it.govpay.core.business.model.Risposta inviaRPT(NodoClient client, Rpt rpt, String operationId, BasicBD bd) throws GovPayException, ClientException, ServiceException, UtilsException {
// if(bd != null) bd.closeConnection();
// it.govpay.core.business.model.Risposta risposta = null;
// try {
// NodoInviaRPT inviaRPT = new NodoInviaRPT();
// inviaRPT.setIdentificativoCanale(rpt.getCodCanale());
// inviaRPT.setIdentificativoIntermediarioPSP(rpt.getCodIntermediarioPsp());
// inviaRPT.setIdentificativoPSP(rpt.getCodPsp());
// inviaRPT.setPassword(rpt.getStazione(bd).getPassword());
// inviaRPT.setRpt(rpt.getXmlRpt());
//
// // FIX Bug Nodo che richiede firma vuota in caso di NESSUNA
// inviaRPT.setTipoFirma("");
// risposta = new it.govpay.core.business.model.Risposta(client.nodoInviaRPT(rpt.getIntermediario(bd), rpt.getStazione(bd), rpt, inviaRPT));
// return risposta;
// } finally {
// // Se mi chiama InviaRptThread, BD e' null
// boolean newCon = bd == null;
// if(!newCon)
// bd.setupConnection(ContextThreadLocal.get().getTransactionId());
// else {
// bd = BasicBD.newInstance(ContextThreadLocal.get().getTransactionId());
// }
// popolaEventoCooperazione(client, rpt, rpt.getIntermediario(bd), rpt.getStazione(bd));
// }
// }

public static it.govpay.core.business.model.Risposta inviaCarrelloRPT(NodoClient client, Intermediario intermediario, Stazione stazione, List<Rpt> rpts, String operationId, BasicBD bd) throws GovPayException, ClientException, ServiceException, UtilsException {
// if(bd != null) bd.closeConnection();
it.govpay.core.business.model.Risposta risposta = null;
try {
// NodoClient client = new it.govpay.core.utils.client.NodoClient(intermediario, operationId, bd);
NodoInviaCarrelloRPT inviaCarrelloRpt = new NodoInviaCarrelloRPT();
inviaCarrelloRpt.setIdentificativoCanale(rpts.get(0).getCodCanale());
inviaCarrelloRpt.setIdentificativoIntermediarioPSP(rpts.get(0).getCodIntermediarioPsp());
inviaCarrelloRpt.setIdentificativoPSP(rpts.get(0).getCodPsp());
inviaCarrelloRpt.setPassword(stazione.getPassword());
TipoListaRPT listaRpt = new TipoListaRPT();
for(Rpt rpt : rpts) {
TipoElementoListaRPT elementoListaRpt = new TipoElementoListaRPT();
elementoListaRpt.setCodiceContestoPagamento(rpt.getCcp());
elementoListaRpt.setIdentificativoDominio(rpt.getCodDominio());
elementoListaRpt.setIdentificativoUnivocoVersamento(rpt.getIuv());
elementoListaRpt.setRpt(rpt.getXmlRpt());
elementoListaRpt.setTipoFirma("");
listaRpt.getElementoListaRPT().add(elementoListaRpt);
}
inviaCarrelloRpt.setListaRPT(listaRpt);
risposta = new it.govpay.core.business.model.Risposta(client.nodoInviaCarrelloRPT(intermediario, stazione, inviaCarrelloRpt, rpts.get(0).getCodCarrello()));
return risposta;
} finally {
// Se mi chiama InviaRptThread, BD e' null
// boolean newCon = bd == null;
// if(!newCon)
// bd.setupConnection(ContextThreadLocal.get().getTransactionId());
// else {
// bd = BasicBD.newInstance(ContextThreadLocal.get().getTransactionId());
// }
NodoInviaCarrelloRPT inviaCarrelloRpt = new NodoInviaCarrelloRPT();
inviaCarrelloRpt.setIdentificativoCanale(rpts.get(0).getCodCanale());
inviaCarrelloRpt.setIdentificativoIntermediarioPSP(rpts.get(0).getCodIntermediarioPsp());
inviaCarrelloRpt.setIdentificativoPSP(rpts.get(0).getCodPsp());
inviaCarrelloRpt.setPassword(stazione.getPassword());
TipoListaRPT listaRpt = new TipoListaRPT();
for(Rpt rpt : rpts) {
TipoElementoListaRPT elementoListaRpt = new TipoElementoListaRPT();
elementoListaRpt.setCodiceContestoPagamento(rpt.getCcp());
elementoListaRpt.setIdentificativoDominio(rpt.getCodDominio());
elementoListaRpt.setIdentificativoUnivocoVersamento(rpt.getIuv());
elementoListaRpt.setRpt(rpt.getXmlRpt());
listaRpt.getElementoListaRPT().add(elementoListaRpt);
}
inviaCarrelloRpt.setListaRPT(listaRpt);
risposta = new it.govpay.core.business.model.Risposta(client.nodoInviaCarrelloRPT(intermediario, stazione, inviaCarrelloRpt, rpts.get(0).getCodCarrello()));
return risposta;
}

public static void popolaEventoCooperazione(NodoClient client, Rpt rpt, Intermediario intermediario, Stazione stazione) throws ServiceException {

DatiPagoPA datiPagoPA = new DatiPagoPA();
datiPagoPA.setCodCanale(rpt.getCodCanale());
datiPagoPA.setCodPsp(rpt.getCodPsp());
Expand Down Expand Up @@ -291,7 +250,7 @@ public static boolean aggiornaRptDaNpD(Intermediario intermediario, Rpt rpt, Bas
richiesta.setIdentificativoUnivocoVersamento(rpt.getIuv());
richiesta.setCodiceContestoPagamento(rpt.getCcp());
chiediStatoRptClient = new NodoClient(intermediario, null, giornale, bd);

bd.setupConnection(ctx.getTransactionId());
// salvataggio id Rpt/ versamento/ pagamento
chiediStatoRptClient.getEventoCtx().setCodDominio(rpt.getCodDominio());
Expand Down Expand Up @@ -463,7 +422,7 @@ public static boolean aggiornaRptDaNpD(Intermediario intermediario, Rpt rpt, Bas
appContext.getTransaction().getLastServer().addGenericProperty(new Property("iuv", rpt.getIuv()));
}
ctx.getApplicationLogger().log("pagamento.recuperoRt");
rpt = RtUtils.acquisisciRT(rpt.getCodDominio(), rpt.getIuv(), rpt.getCcp(), nodoChiediCopiaRTRisposta.getTipoFirma(), rtByte, true, bd);
rpt = RtUtils.acquisisciRT(rpt.getCodDominio(), rpt.getIuv(), rpt.getCcp(), rtByte, true, bd);
chiediCopiaRTClient.getEventoCtx().setDescrizioneEsito("Acquisita ricevuta di pagamento [IUV: " + rpt.getIuv() + " CCP:" + rpt.getCcp() + "] emessa da " + rpt.getDenominazioneAttestante());
appContext.getResponse().addGenericProperty(new Property("esitoPagamento", rpt.getEsitoPagamento().toString()));
ctx.getApplicationLogger().log("pagamento.acquisizioneRtOk");
Expand Down
2 changes: 1 addition & 1 deletion jars/core/src/main/java/it/govpay/core/utils/RtUtils.java
Original file line number Diff line number Diff line change
Expand Up @@ -215,7 +215,7 @@ private static Rpt.EsitoPagamento validaSemanticaCodiceEsitoPagamento(String cod
return null;
}

public static Rpt acquisisciRT(String codDominio, String iuv, String ccp, String tipoFirma, byte[] rtByte, boolean recupero, BasicBD bd) throws ServiceException, NdpException, UtilsException, GovPayException {
public static Rpt acquisisciRT(String codDominio, String iuv, String ccp, byte[] rtByte, boolean recupero, BasicBD bd) throws ServiceException, NdpException, UtilsException, GovPayException {
bd.setAutoCommit(false);
bd.enableSelectForUpdate();

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -120,8 +120,6 @@ public void run() {
inviaRPT.setIdentificativoPSP(this.rpt.getCodPsp());
inviaRPT.setPassword(this.stazione.getPassword());
inviaRPT.setRpt(this.rpt.getXmlRpt());
// FIX Bug Nodo che richiede firma vuota in caso di NESSUNA
inviaRPT.setTipoFirma("");

Risposta risposta = new it.govpay.core.business.model.Risposta(client.nodoInviaRPT(this.intermediario, this.stazione, this.rpt, inviaRPT));

Expand Down

0 comments on commit 97e2095

Please sign in to comment.