Commit add0d6fb authored by dpawar's avatar dpawar

set vendor tax code as sales return tran_id


git-svn-id: http://15.206.35.175/svn/proteus/business-java/trunk@99279 ce508802-f39f-4f6c-b175-0d175dae99d5
parent 0a29e4a3
......@@ -75,7 +75,7 @@ public class RefundGateWayPayment extends ActionHandlerEJB implements RefundGate
PreparedStatement pstmt = null;
ITMDBAccessEJB itmdbAccess=new ITMDBAccessEJB();
String sql = "" ,retString = "",invoiceId = "",currCode = "",payMode = "",sagePayRetStr = "",
udfStr1 = "",tranIdCrn = "";
udfStr1 = "",tranIdCrn = "",sreturnTranId = "";
//Changed by samadhan on 04/08/2015 for paypal refund
String rcpMode="",payPalRetStr="";
double segPayNetAmt = 0;
......@@ -102,13 +102,14 @@ public class RefundGateWayPayment extends ActionHandlerEJB implements RefundGate
rs = null;
pstmt.close();
pstmt = null;
sql="SELECT INVOICE_ID FROM SRETURN WHERE TRAN_ID__CRN = ?";
sql="SELECT INVOICE_ID,TRAN_ID FROM SRETURN WHERE TRAN_ID__CRN = ?";
pstmt = conn.prepareStatement(sql);
pstmt.setString(1, tranIdCrn);
rs = pstmt.executeQuery();
if(rs.next())
{
invoiceId =rs.getString("INVOICE_ID") == null ? "" :rs.getString("INVOICE_ID").trim();
sreturnTranId =rs.getString("TRAN_ID") == null ? "" :rs.getString("TRAN_ID").trim();
}
pstmt.close();
rs.close();
......@@ -142,7 +143,7 @@ public class RefundGateWayPayment extends ActionHandlerEJB implements RefundGate
else
{
//Changed by samadhan on 04/08/2015 for paypal refund End
sagePayRetStr = authoriseSagePay (segPayNetAmt,invoiceId,currCode,conn);
sagePayRetStr = authoriseSagePay (segPayNetAmt,invoiceId,sreturnTranId,currCode,conn);
System.out.println("Return sagePayRetStr from authoriseSagePay-------->>["+sagePayRetStr+"]");
if(sagePayRetStr != null && sagePayRetStr.indexOf("OK") > 0)
{
......@@ -405,7 +406,7 @@ public class RefundGateWayPayment extends ActionHandlerEJB implements RefundGate
}
return retString;
}
private String authoriseSagePay(double segPayNetAmt,String invoiceId,String currCode,Connection conn) throws Exception,ITMException
private String authoriseSagePay(double segPayNetAmt,String invoiceId,String sreturnTranid,String currCode,Connection conn) throws Exception,ITMException
{
String responseStr = "";
CommonWmsUtil commonWmuUtil = new CommonWmsUtil();
......@@ -435,7 +436,7 @@ public class RefundGateWayPayment extends ActionHandlerEJB implements RefundGate
System.out.println("despatchId------>>["+despatchId+"]");
System.out.println("invoiceId------>>["+invoiceId+"]");
System.out.println("ptcn------>>["+ptcn+"]");
System.out.println("sreturnTranid@@@------>>["+sreturnTranid+"]");
dom = commonWmuUtil.getDDDom("");
......@@ -476,6 +477,7 @@ public class RefundGateWayPayment extends ActionHandlerEJB implements RefundGate
System.out.println("sagePayApply ["+sagePayApply+"]vendor["+vendor+"]currCode ["+currCode+"]");
System.out.println("ptcn@@@------>>["+ptcn+"]");
param.setVPSProtocol(sagePayVersion);
param.setTxType(sagePayTransType);
param.setVendor(vendor);
......@@ -484,7 +486,7 @@ public class RefundGateWayPayment extends ActionHandlerEJB implements RefundGate
param.setDescription("Refund Test Description");
param.setRelatedVPSTxId(vpsTxId);
//param.setVendorTxCode("Base_" + Helpers.GetRandomNumber()); //This should be your own reference code to the transaction.
param.setVendorTxCode("BaseERP_" + invoiceId); //This should be your own reference code to the transaction.
param.setVendorTxCode("BaseERP_" + sreturnTranid); //This should be your own reference code to the transaction.
param.setRelatedVendorTxCode("BaseERP_" + ptcn);
param.setRelatedSecurityKey(securityKey);
param.setRelatedTxAuthNo(TxAuthNo);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment