Subversion Repositories SmartDukaan

Rev

Rev 6091 | Go to most recent revision | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 6091 Rev 8618
Line 142... Line 142...
142
                }
142
                }
143
			    if(!isFlagged.equals("YES")) {
143
			    if(!isFlagged.equals("YES")) {
144
			        //Recharge only when payment is digital and is captured and is not flagged 
144
			        //Recharge only when payment is digital and is captured and is not flagged 
145
			        try {
145
			        try {
146
			            PaymentClient pcl = new PaymentClient();
146
			            PaymentClient pcl = new PaymentClient();
147
			            boolean isCaptured = pcl.getClient().capturePayment(txnId);
147
			            boolean isCaptured = pcl.getClient().capturePayment(txnId, true);
-
 
148
			            
-
 
149
			            //Retry in case we are not able to capture first time
-
 
150
			            if(!isCaptured){
-
 
151
			            	Thread.sleep(2000);
-
 
152
			            	isCaptured = pcl.getClient().capturePayment(txnId, true);
-
 
153
			            }
-
 
154
			            if(!isCaptured){
-
 
155
			            	Thread.sleep(2000);
-
 
156
			            	isCaptured = pcl.getClient().capturePayment(txnId, true);
-
 
157
			            }
148
			            
158
			            
149
			            if(isCaptured) {
159
			            if(isCaptured) {
150
			                transactionServiceClient.getClient().updateRechargeOrderStatus(rechargeOrder.getId(), RechargeOrderStatus.PAYMENT_SUCCESSFUL);
160
			                transactionServiceClient.getClient().updateRechargeOrderStatus(rechargeOrder.getId(), RechargeOrderStatus.PAYMENT_SUCCESSFUL);
151
			            } else {
161
			            } else {
152
	                        transactionServiceClient.getClient().updateRechargeOrderStatus(rechargeOrder.getId(), RechargeOrderStatus.PAYMENT_FAILED);
162
	                        transactionServiceClient.getClient().updateRechargeOrderStatus(rechargeOrder.getId(), RechargeOrderStatus.PAYMENT_FAILED);