Commit 6ead1473 authored by spawar's avatar spawar

Added source for paypal partial amount capture and refund


git-svn-id: http://15.206.35.175/svn/proteus/business-java/trunk@100227 ce508802-f39f-4f6c-b175-0d175dae99d5
parent 3b41b876
......@@ -2584,7 +2584,9 @@ public class DockTranPos extends ValidatorEJB implements DockTranPosLocal, DockT
paypalParam.setUser(commUtil.getDDSalesConfig("PAYPAL_APIUSERNAME"));
paypalParam.setPassword(commUtil.getDDSalesConfig("PAYPAL_APIPASSWORD"));
paypalParam.setSignature(commUtil.getDDSalesConfig("PAYPAL_APISIGNATURE"));
paypalParam.setCompleteType("complete");
//Changed by Samadhan on 17/02/2016 for NotComplate type
//paypalParam.setCompleteType("complete");
paypalParam.setCompleteType("NotComplete");
paypalParam.setCurrencyCode(currCode);
paypalParam.setMethod(commUtil.getDDSalesConfig("PAYPAL_METHOD"));
paypalParam.setAmt(payAmt+"");
......
......@@ -127,7 +127,9 @@ public class RefundGateWayPayment extends ActionHandlerEJB implements RefundGate
rcpMode = getColumnDescr(conn, "rcp_mode", "sorder s,invoice i", "i.sale_order = s.sale_order and i.invoice_id", invoiceId);
if(rcpMode.equalsIgnoreCase("P"))
{
payPalRetStr = refundPayPal ("Full",invoiceId,currCode,conn);
//Changed by Samadhan on 17/02/2016 for partial refund
//payPalRetStr = refundPayPal ("Full",invoiceId,currCode,conn);
payPalRetStr = refundPayPal (segPayNetAmt,invoiceId,currCode,conn);
System.out.println("Return PayPalRetStr from refundPayPal-------->>["+payPalRetStr+"]");
if(payPalRetStr != null && payPalRetStr.indexOf("Success") > 0)
{
......@@ -579,7 +581,7 @@ public class RefundGateWayPayment extends ActionHandlerEJB implements RefundGate
//Changed By Samadhan on 04/08/2015 for paypal refund start
@SuppressWarnings("static-access")
private String refundPayPal(String refundType,String invoiceId,String currCode,Connection conn) throws Exception,ITMException
private String refundPayPal(Double refundAmount,String invoiceId,String currCode,Connection conn) throws Exception,ITMException
{
String responseStr = "";
CommonWmsUtil commUtil = new CommonWmsUtil();
......@@ -587,6 +589,7 @@ public class RefundGateWayPayment extends ActionHandlerEJB implements RefundGate
ResultSet rs = null;
PreparedStatement pstmt = null;
String payPalUrl = "";
//String refundType = "Partial";
PaypalRefundParams paypalRetParam = null;
String despatchId = "",refundDetails = "";
......@@ -603,14 +606,13 @@ public class RefundGateWayPayment extends ActionHandlerEJB implements RefundGate
paypalRetParam = new PaypalRefundParams();
System.out.println("CONFIG xml["+genericUtility.serializeDom(dom)+"]");
refundDetails = getColumnDescr(conn,"token_info","despatch","desp_id",despatchId);
System.out.println("AuthorizationDetails------>>["+refundDetails+"]");
dom = null;
if(refundDetails != null && refundDetails.length() > 0)
{
dom = genericUtility.parseString(refundDetails);
dom = genericUtility.parseString(refundDetails);
System.out.println("CONFIG xml["+genericUtility.serializeDom(dom)+"]");
tranId = genericUtility.getColumnValue("TRANSACTIONID", dom);
}
System.out.println("TransationId@@@------>>["+tranId+"]");
......@@ -622,8 +624,11 @@ public class RefundGateWayPayment extends ActionHandlerEJB implements RefundGate
paypalRetParam.setMethod(commUtil.getDDSalesConfig("PAYPAL_REFUND_METHOD"));
paypalRetParam.setVersion(commUtil.getDDSalesConfig("PAYPAL_VERSION"));
paypalRetParam.setTransactionId(tranId);
paypalRetParam.setRefundType(refundType);
paypalRetParam.setRefundType("Partial");
//Changed by Samadhan on 17/02/2016 for partial refund Start
paypalRetParam.setAmt(refundAmount+"");
paypalRetParam.setCurrencyCode(currCode);
//Changed by Samadhan on 17/02/2016 for partial refund End
responseStr = commUtil.PaypalRefundPayment(payPalUrl,paypalRetParam);
System.out.println("responseStr from PayPalRefund@@ : "+responseStr);
......
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