Subversion Repositories SmartDukaan

Rev

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

Rev 12986 Rev 13004
Line 193... Line 193...
193
</div>
193
</div>
194
#if($action.isRechargeModeAsynchronous())
194
#if($action.isRechargeModeAsynchronous())
195
	<div id="countdown" style="margin:10px auto auto;width:125px;display:block;"></div>
195
	<div id="countdown" style="margin:10px auto auto;width:125px;display:block;"></div>
196
	<script src="/js/jquery.countdown360.js" type="text/javascript" charset="utf-8"></script>
196
	<script src="/js/jquery.countdown360.js" type="text/javascript" charset="utf-8"></script>
197
    <script type="text/javascript" charset="utf-8">
197
    <script type="text/javascript" charset="utf-8">
-
 
198
		var callCounter = 0;
198
    	$("#countdown").countdown360({
199
    	$("#countdown").countdown360({
199
	         radius      : 50,
200
	         radius      : 50,
200
    	     seconds     : 60,
201
    	     seconds     : 60,
201
        	 fontColor   : 'white',
202
        	 fontColor   : 'white',
202
         	fillStyle   : '#6699ff',
203
         	fillStyle   : '#6699ff',
Line 208... Line 209...
208
			$('#countdown').hide();
209
			$('#countdown').hide();
209
			jQuery.ajax({
210
			jQuery.ajax({
210
                type : "GET",
211
                type : "GET",
211
                url : "/recharge-result!getRechargeStatus?rechargeOrderId="+$rechargeOrder.getId()+"&isFinal=true",
212
                url : "/recharge-result!getRechargeStatus?rechargeOrderId="+$rechargeOrder.getId()+"&isFinal=true",
212
                success : function(response) {
213
                success : function(response) {
213
					if (response=='RECHARGE_SUCCESSFUL' || response == 'RECHARGE_FAILED' || response == 'PAYMENT_SUCCESSFUL'){
-
 
214
						location.reload();
-
 
215
					}
-
 
216
                },
214
                },
217
                error : function() {
215
                error : function() {
218
                }
216
                }
219
           });
217
           });
220
           location.reload();
218
		   window.setTimeout(reload, 5000);
221
		}
219
		}
222
		function checkUnknownTransactions(){
220
		function checkUnknownTransactions(){
223
			jQuery.ajax({
221
			jQuery.ajax({
224
				type : "GET",
222
				type : "GET",
225
				url : "/recharge-result!getRechargeStatus?rechargeOrderId="+$rechargeOrder.getId()+"&isFinal=false",
223
				url : "/recharge-result!getRechargeStatus?rechargeOrderId="+$rechargeOrder.getId()+"&isFinal=false",
226
				success : function(response) {
224
				success : function(response) {
227
					if (response=='RECHARGE_SUCCESSFUL' || response == 'RECHARGE_FAILED' || response == 'PAYMENT_SUCCESSFUL'){
225
					if (response=='RECHARGE_SUCCESSFUL' || response == 'RECHARGE_FAILED' || response == 'PAYMENT_SUCCESSFUL'){
228
						location.reload();
226
						reload();
229
					}
227
					}
-
 
228
					incrementCounter();
230
					if ($('#countdown').is(':visible')){	
229
					if ($('#countdown').is(':visible')){
-
 
230
						if(callCounter < 4){
231
						window.setTimeout(checkUnknownTransactions, 5000);
231
							window.setTimeout(checkUnknownTransactions, 5000);
-
 
232
						}
232
					}
233
					}
233
				},
234
				},
234
				error : function() {
235
				error : function() {
-
 
236
					incrementCounter();
235
				}
237
				}
236
			});
238
			});
-
 
239
		}			
-
 
240
		
-
 
241
		function incrementCounter(){
-
 
242
			callCounter++;
237
	}
243
		}
-
 
244
		
-
 
245
		function reload(){
-
 
246
			location.reload();
-
 
247
		}
238
</script>
248
</script>
239
<script type="text/javascript">
249
<script type="text/javascript">
240
  $(function(){
250
  $(function(){
241
  	if ($('#countdown').is(':visible')){	
251
  	if ($('#countdown').is(':visible')){	
242
		window.setTimeout(checkUnknownTransactions, 40000);
252
		window.setTimeout(checkUnknownTransactions, 40000);