first commit
This commit is contained in:
commit
4d332ef662
27586 changed files with 3281783 additions and 0 deletions
134
rus/WEB-INF/lib/abliaBank_src/com/ablia/gtbill/GTBillReq.java
Normal file
134
rus/WEB-INF/lib/abliaBank_src/com/ablia/gtbill/GTBillReq.java
Normal file
|
|
@ -0,0 +1,134 @@
|
|||
package com.ablia.gtbill;
|
||||
|
||||
import com.ablia.bank._BankAdapter;
|
||||
import com.ablia.common.Parm;
|
||||
import com.ablia.db.ApplParmFull;
|
||||
|
||||
public class GTBillReq extends _BankAdapter {
|
||||
public static final String P_GTBILL_MERCHANT_ID = "GTBILL_MERCHANT_ID";
|
||||
|
||||
public static final String P_GTBILL_SITE_ID = "GTBILL_SITE_ID";
|
||||
|
||||
public static final String P_GTBILL_RETURN_URL = "GTBILL_RETURN_URL";
|
||||
|
||||
public static final String DIV_CODE_EURO = "EUR";
|
||||
|
||||
public static final String DIV_CODE_DOLLARI = "USD";
|
||||
|
||||
public static final String DIV_CODE_STERLINE = "GBP";
|
||||
|
||||
public static final String DIV_CODE_CAN = "CAD";
|
||||
|
||||
public static final String DIV_CODE_REAL = "234";
|
||||
|
||||
private String mycurrencyid;
|
||||
|
||||
private String myamounttotal;
|
||||
|
||||
private String myamountshipping;
|
||||
|
||||
private String myitemname;
|
||||
|
||||
private String myitemquantity;
|
||||
|
||||
private String myitemamount;
|
||||
|
||||
private String myitemdesc;
|
||||
|
||||
public static final String FORM_URL_POST = "https://sale.GTBill.com/quickpay.aspx";
|
||||
|
||||
public static final String PROG_LANG_URL_POST = "https://sale.GTBill.com/quickpay2.aspx";
|
||||
|
||||
public static final String PROG_LANG_URL_POST_REDIRECT = "https://sale.GTBill.com/quickpay.aspx?refid=";
|
||||
|
||||
public static void initApplicationParms(ApplParmFull ap) {
|
||||
if (ap != null) {
|
||||
Parm bean = new Parm(ap);
|
||||
String l_tipoParm = "GTBILL";
|
||||
bean.findByCodice("GTBILL_MERCHANT_ID");
|
||||
bean.setFlgAdmin(1L);
|
||||
bean.setTipoParm(l_tipoParm);
|
||||
bean.setCodice("GTBILL_MERCHANT_ID");
|
||||
bean.setDescrizione("GTBILL_MERCHANT_ID");
|
||||
bean.setFlgTipo(0L);
|
||||
bean.setNota("MERCHANT ID ASSEGNATO DALLA BANCA");
|
||||
bean.save();
|
||||
bean.findByCodice("GTBILL_SITE_ID");
|
||||
bean.setFlgAdmin(1L);
|
||||
bean.setTipoParm(l_tipoParm);
|
||||
bean.setCodice("GTBILL_SITE_ID");
|
||||
bean.setDescrizione("GTBILL_SITE_ID");
|
||||
bean.setFlgTipo(0L);
|
||||
bean.setNota("SITE ID ASSEGNATO DALLA BANCA");
|
||||
bean.save();
|
||||
bean.findByCodice("GTBILL_RETURN_URL");
|
||||
bean.setFlgAdmin(1L);
|
||||
bean.setTipoParm(l_tipoParm);
|
||||
bean.setCodice("GTBILL_RETURN_URL");
|
||||
bean.setDescrizione("GTBILL_RETURN_URL");
|
||||
bean.setFlgTipo(0L);
|
||||
bean.setNota("URL AL QUALE SI DEVE RITORNARE DOPO IL PAGAMENTO");
|
||||
bean.save();
|
||||
}
|
||||
}
|
||||
|
||||
public String getMyamounttotal() {
|
||||
return (this.myamounttotal == null) ? "" :
|
||||
this.myamounttotal.replace(".", ",").replace(",", ".");
|
||||
}
|
||||
|
||||
public void setMyamounttotal(String myamount) {
|
||||
this.myamounttotal = myamount;
|
||||
}
|
||||
|
||||
public String getMycurrencyid() {
|
||||
return (this.mycurrencyid == null) ? "" : this.mycurrencyid;
|
||||
}
|
||||
|
||||
public void setMycurrencyid(String mycurrency) {
|
||||
this.mycurrencyid = mycurrency;
|
||||
}
|
||||
|
||||
public String getMyamountshipping() {
|
||||
return (this.myamountshipping == null) ? "" :
|
||||
this.myamountshipping;
|
||||
}
|
||||
|
||||
public void setMyamountshipping(String myamountshipping) {
|
||||
this.myamountshipping = myamountshipping;
|
||||
}
|
||||
|
||||
public String getMyitemname() {
|
||||
return (this.myitemname == null) ? "" : this.myitemname;
|
||||
}
|
||||
|
||||
public void setMyitemname(String myitemname) {
|
||||
this.myitemname = myitemname;
|
||||
}
|
||||
|
||||
public String getMyitemquantity() {
|
||||
return (this.myitemquantity == null) ? "" :
|
||||
this.myitemquantity;
|
||||
}
|
||||
|
||||
public void setMyitemquantity(String myitemquantity) {
|
||||
this.myitemquantity = myitemquantity;
|
||||
}
|
||||
|
||||
public String getMyitemamount() {
|
||||
return (this.myitemamount == null) ? "" :
|
||||
this.myitemamount.replace(".", ",").replace(",", ".");
|
||||
}
|
||||
|
||||
public void setMyitemamount(String myitemamount) {
|
||||
this.myitemamount = myitemamount;
|
||||
}
|
||||
|
||||
public String getMyitemdesc() {
|
||||
return (this.myitemdesc == null) ? "" : this.myitemdesc;
|
||||
}
|
||||
|
||||
public void setMyitemdesc(String myitemdesc) {
|
||||
this.myitemdesc = myitemdesc;
|
||||
}
|
||||
}
|
||||
158
rus/WEB-INF/lib/abliaBank_src/com/ablia/gtbill/GTBillRes.java
Normal file
158
rus/WEB-INF/lib/abliaBank_src/com/ablia/gtbill/GTBillRes.java
Normal file
|
|
@ -0,0 +1,158 @@
|
|||
package com.ablia.gtbill;
|
||||
|
||||
import com.ablia.bank._BankAdapter;
|
||||
|
||||
public class GTBillRes extends _BankAdapter {
|
||||
private String myshoplogin;
|
||||
|
||||
private int mycurrency;
|
||||
|
||||
private float myamount;
|
||||
|
||||
private String myshoptrxID;
|
||||
|
||||
private String mybuyername;
|
||||
|
||||
private String mybuyeremail;
|
||||
|
||||
private String mytrxresult;
|
||||
|
||||
private String myauthcode;
|
||||
|
||||
private String myerrorcode;
|
||||
|
||||
private String myerrordescription;
|
||||
|
||||
private String myerrorbanktrxid;
|
||||
|
||||
private long id_ordine;
|
||||
|
||||
private String myalertcode;
|
||||
|
||||
private String myalertdescription;
|
||||
|
||||
private String mycustominfo;
|
||||
|
||||
public String getMyalertcode() {
|
||||
return (this.myalertcode == null) ? "" : this.myalertcode;
|
||||
}
|
||||
|
||||
public void setMyalertcode(String myalertcode) {
|
||||
this.myalertcode = myalertcode;
|
||||
}
|
||||
|
||||
public String getMyalertdescription() {
|
||||
return (this.myalertdescription == null) ? "" :
|
||||
this.myalertdescription;
|
||||
}
|
||||
|
||||
public void setMyalertdescription(String myalertdescription) {
|
||||
this.myalertdescription = myalertdescription;
|
||||
}
|
||||
|
||||
public float getMyamount() {
|
||||
return this.myamount;
|
||||
}
|
||||
|
||||
public void setMyamount(float myamount) {
|
||||
this.myamount = myamount;
|
||||
}
|
||||
|
||||
public String getMyauthcode() {
|
||||
return (this.myauthcode == null) ? "" : this.myauthcode;
|
||||
}
|
||||
|
||||
public void setMyauthcode(String myauthcode) {
|
||||
this.myauthcode = myauthcode;
|
||||
}
|
||||
|
||||
public String getMybuyeremail() {
|
||||
return (this.mybuyeremail == null) ? "" : this.mybuyeremail;
|
||||
}
|
||||
|
||||
public void setMybuyeremail(String mybuyeremail) {
|
||||
this.mybuyeremail = mybuyeremail;
|
||||
}
|
||||
|
||||
public String getMybuyername() {
|
||||
return (this.mybuyername == null) ? "" : this.mybuyername;
|
||||
}
|
||||
|
||||
public void setMybuyername(String mybuyername) {
|
||||
this.mybuyername = mybuyername;
|
||||
}
|
||||
|
||||
public int getMycurrency() {
|
||||
return this.mycurrency;
|
||||
}
|
||||
|
||||
public void setMycurrency(int mycurrency) {
|
||||
this.mycurrency = mycurrency;
|
||||
}
|
||||
|
||||
public String getMycustominfo() {
|
||||
return (this.mycustominfo == null) ? "" : this.mycustominfo;
|
||||
}
|
||||
|
||||
public void setMycustominfo(String mycustominfo) {
|
||||
this.mycustominfo = mycustominfo;
|
||||
}
|
||||
|
||||
public String getMyerrorbanktrxid() {
|
||||
return (this.myerrorbanktrxid == null) ? "" :
|
||||
this.myerrorbanktrxid;
|
||||
}
|
||||
|
||||
public void setMyerrorbanktrxid(String myerrorbanktrxid) {
|
||||
this.myerrorbanktrxid = myerrorbanktrxid;
|
||||
}
|
||||
|
||||
public String getMyerrorcode() {
|
||||
return (this.myerrorcode == null) ? "" : this.myerrorcode;
|
||||
}
|
||||
|
||||
public void setMyerrorcode(String myerrorcode) {
|
||||
this.myerrorcode = myerrorcode;
|
||||
}
|
||||
|
||||
public String getMyerrordescription() {
|
||||
return (this.myerrordescription == null) ? "" :
|
||||
this.myerrordescription;
|
||||
}
|
||||
|
||||
public void setMyerrordescription(String myerrordescription) {
|
||||
this.myerrordescription = myerrordescription;
|
||||
}
|
||||
|
||||
public String getMyshoplogin() {
|
||||
return (this.myshoplogin == null) ? "" : this.myshoplogin;
|
||||
}
|
||||
|
||||
public void setMyshoplogin(String myshoplogin) {
|
||||
this.myshoplogin = myshoplogin;
|
||||
}
|
||||
|
||||
public String getMyshoptrxID() {
|
||||
return (this.myshoptrxID == null) ? "" : this.myshoptrxID;
|
||||
}
|
||||
|
||||
public void setMyshoptrxID(String myshoptrxID) {
|
||||
this.myshoptrxID = myshoptrxID;
|
||||
}
|
||||
|
||||
public String getMytrxresult() {
|
||||
return (this.mytrxresult == null) ? "" : this.mytrxresult;
|
||||
}
|
||||
|
||||
public void setMytrxresult(String mytrxresult) {
|
||||
this.mytrxresult = mytrxresult;
|
||||
}
|
||||
|
||||
public long getId_ordine() {
|
||||
return this.id_ordine;
|
||||
}
|
||||
|
||||
public void setId_ordine(long id_ordine) {
|
||||
this.id_ordine = id_ordine;
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,114 @@
|
|||
package com.ablia.gtbill.servlet;
|
||||
|
||||
import com.ablia.gtbill.GTBillReq;
|
||||
import java.io.BufferedReader;
|
||||
import java.io.InputStreamReader;
|
||||
import java.net.HttpURLConnection;
|
||||
import java.net.URL;
|
||||
import javax.servlet.RequestDispatcher;
|
||||
import javax.servlet.ServletRequest;
|
||||
import javax.servlet.ServletResponse;
|
||||
import javax.servlet.http.HttpServletRequest;
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
|
||||
public class GTBillSvlt extends Object {
|
||||
private static final long serialVersionUID = 6201212373211424420L;
|
||||
|
||||
protected static final String CMD_SEND_REQ = "send";
|
||||
|
||||
protected static final String CMD_GET_RES = "res";
|
||||
|
||||
protected static final String BEAN_SELLA_RES = "sellaResp";
|
||||
|
||||
protected final void callJsp(HttpServletRequest req, HttpServletResponse res) {
|
||||
setJspPageRelative(getJspOkPage(req, res), req);
|
||||
try {
|
||||
RequestDispatcher rd = getServletContext()
|
||||
.getRequestDispatcher(getJspPage(req));
|
||||
rd.forward((ServletRequest)req, (ServletResponse)res);
|
||||
} catch (Exception e) {
|
||||
handleDebug(e);
|
||||
}
|
||||
}
|
||||
|
||||
protected void sendRequest(HttpServletRequest req, HttpServletResponse res) {
|
||||
try {
|
||||
GTBillReq gtbillreq = new GTBillReq();
|
||||
fillObject(req, gtbillreq);
|
||||
String theUrl = "https://sale.GTBill.com/quickpay2.aspx";
|
||||
StringBuilder sb = new StringBuilder();
|
||||
sb.append("?MerchantID=");
|
||||
sb.append(getApFull().getParm("GTBILL_MERCHANT_ID"));
|
||||
sb.append("&SiteID=");
|
||||
sb.append(getApFull().getParm("GTBILL_SITE_ID"));
|
||||
sb.append("&AmountTotal=");
|
||||
sb.append(gtbillreq.getMyamounttotal());
|
||||
sb.append("&CurrencyID=");
|
||||
sb.append("EUR");
|
||||
sb.append("&AmountShipping=");
|
||||
sb.append(gtbillreq.getMyamountshipping());
|
||||
sb.append("&ReturnURL=");
|
||||
sb.append(getApFull().getParm("GTBILL_RETURN_URL"));
|
||||
sb.append("&ItemAmount[0]=");
|
||||
sb.append(gtbillreq.getMyitemamount());
|
||||
sb.append("&ItemDesc[0]=");
|
||||
sb.append(gtbillreq.getMyitemdesc());
|
||||
sb.append("&ItemName[0]=");
|
||||
sb.append(gtbillreq.getMyitemname());
|
||||
sb.append("&ItemQuantity[0]=");
|
||||
sb.append(gtbillreq.getMyitemquantity());
|
||||
URL url = new URL(String.valueOf(theUrl) + sb.toString());
|
||||
System.out.println("startremotecmd: chiamata a " + theUrl +
|
||||
sb.toString());
|
||||
HttpURLConnection connection = (HttpURLConnection)
|
||||
url.openConnection();
|
||||
BufferedReader read = new BufferedReader(new InputStreamReader(
|
||||
connection.getInputStream()));
|
||||
String line = read.readLine();
|
||||
String html = "";
|
||||
while (line != null) {
|
||||
html = String.valueOf(html) + line;
|
||||
line = read.readLine();
|
||||
}
|
||||
} catch (Exception e) {
|
||||
handleDebug(e);
|
||||
}
|
||||
}
|
||||
|
||||
protected String getCodiceEsercente(HttpServletRequest req) {
|
||||
return getParm("COD_ESER_SELLA").getTesto();
|
||||
}
|
||||
|
||||
protected String getJspErrorPage(HttpServletRequest req, HttpServletResponse res) {
|
||||
String temp = getParm("SELLA_OK").getTesto();
|
||||
if (temp.isEmpty())
|
||||
return getJspKoPage(req, res);
|
||||
return temp;
|
||||
}
|
||||
|
||||
protected String getJspOkPage(HttpServletRequest req, HttpServletResponse res) {
|
||||
String temp = getParm("SELLA_OK").getTesto();
|
||||
if (temp.isEmpty())
|
||||
return "payRes.jsp";
|
||||
return temp;
|
||||
}
|
||||
|
||||
protected String getJspKoPage(HttpServletRequest req, HttpServletResponse res) {
|
||||
String temp = getParm("SELLA_OK").getTesto();
|
||||
if (temp.isEmpty())
|
||||
return "payRes.jsp";
|
||||
return temp;
|
||||
}
|
||||
|
||||
protected void processRequest(HttpServletRequest req, HttpServletResponse res) {
|
||||
try {
|
||||
sendRequest(req, res);
|
||||
} catch (Exception e) {
|
||||
handleDebug(e);
|
||||
}
|
||||
}
|
||||
|
||||
protected boolean isSecureServlet(HttpServletRequest req) {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue