76 lines
2.8 KiB
Java
76 lines
2.8 KiB
Java
package it.acxent.cc.servlet;
|
|
|
|
import it.acxent.anag.Users;
|
|
import it.acxent.bank.sella.SellaResp;
|
|
import it.acxent.bank.servlet.sella.GetSellaResponseSvlt;
|
|
import it.acxent.cart.Cart;
|
|
import it.acxent.cc.Attivita;
|
|
import it.acxent.contab.Documento;
|
|
import it.acxent.db.ApplParm;
|
|
import it.acxent.db.ApplParmFull;
|
|
import it.acxent.db.DBAdapter;
|
|
import it.acxent.db.ResParm;
|
|
import it.acxent.gtm.GoogleDataLayer;
|
|
import it.acxent.gtm.GoogleDataLayerBuilder;
|
|
import javax.servlet.http.HttpServletRequest;
|
|
import javax.servlet.http.HttpServletResponse;
|
|
|
|
public class RicevutaSellaSvlt extends GetSellaResponseSvlt {
|
|
private static final long serialVersionUID = -5795730239132540019L;
|
|
|
|
protected static ApplParmFull ap2;
|
|
|
|
protected void recordOrder(HttpServletRequest req, HttpServletResponse res, SellaResp sellaRes) {
|
|
boolean debug = false;
|
|
ApplParmFull apFull = getApFull(req);
|
|
Users utente = (Users)getLoginUser(req);
|
|
if (sellaRes != null && sellaRes.getMyerrorcode().equals("0")) {
|
|
long l_id_ordine = sellaRes.getId_ordine();
|
|
if (debug)
|
|
l_id_ordine = 48081L;
|
|
Documento bean = new Documento(apFull);
|
|
System.out.println("sella recordOrder: " + l_id_ordine);
|
|
bean.findByProgOrdineWww(l_id_ordine);
|
|
bean.setDataPagamento(DBAdapter.getToday());
|
|
bean.setDataTransaction(DBAdapter.getToday());
|
|
bean.setDescTransaction(sellaRes.getMyauthcode());
|
|
bean.setFlgPagata(1L);
|
|
ResParm rp = bean.save();
|
|
if (rp.getStatus())
|
|
rp = bean.sendOrderMailMessageTuttofoto(utente, true, true, false, false);
|
|
Attivita attivita = Attivita.getDefaultInstance(apFull);
|
|
if (attivita.isTagManagerAttivo()) {
|
|
GoogleDataLayer gdl = new GoogleDataLayer(GoogleDataLayerBuilder.purchaseOrder("eec.purchase", bean));
|
|
req.setAttribute("_gdl", gdl);
|
|
}
|
|
}
|
|
}
|
|
|
|
protected void preparePaymenResPage(HttpServletRequest req, HttpServletResponse res, SellaResp sellaRes) {
|
|
boolean debug = false;
|
|
long l_id_ordine = 0L;
|
|
if (sellaRes != null)
|
|
l_id_ordine = sellaRes.getId_ordine();
|
|
if (debug)
|
|
l_id_ordine = 48081L;
|
|
Documento bean = new Documento(getApFull());
|
|
bean.findByProgOrdineWww(l_id_ordine);
|
|
if (debug) {
|
|
sellaRes.setMyerrorcode("0");
|
|
recordOrder(req, res, sellaRes);
|
|
}
|
|
req.setAttribute("bean", bean);
|
|
}
|
|
|
|
protected String getCheckOutMailMessage() {
|
|
return getParm(Cart.P_CHECKOUTMSG).getTesto();
|
|
}
|
|
|
|
protected ApplParmFull getAp2() {
|
|
if (ap2 == null)
|
|
ap2 = new ApplParmFull(new ApplParm(getApFull().getParm("DBDRIVER2").getNumeroInt(), getApFull().getParm("DBNAME2").getTesto(), getApFull().getParm("USER2").getTesto(), getApFull().getParm("PASSWORD2").getTesto()));
|
|
return ap2;
|
|
}
|
|
|
|
public void _test(HttpServletRequest req, HttpServletResponse res) {}
|
|
}
|