Subversion Repositories SmartDukaan

Rev

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

Rev 13005 Rev 13009
Line 194... Line 194...
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
		var callCounter = 0;
199
    	$("#countdown").countdown360({
199
		$("#countdown").countdown360({
200
	         radius      : 50,
200
			radius: 50,
201
    	     seconds     : 60,
201
			seconds: 60,
202
        	 fontColor   : 'white',
202
			fontColor: 'white',
203
         	fillStyle   : '#6699ff',
203
			fillStyle: '#6699ff',
204
         	strokeStyle : '#F6F47A',
204
			strokeStyle: '#F6F47A',
205
         	autostart   : true,
205
			autostart: true,
206
         	onComplete  : function () { hideCountDown()}
206
			onComplete: function() {
-
 
207
				hideCountDown()
-
 
208
			}
207
     	})
209
		})
-
 
210
 
208
		function hideCountDown(){
211
		 function hideCountDown() {
209
			$('#countdown').hide();
212
			$('#countdown').hide();
210
			jQuery.ajax({
213
			jQuery.ajax({
211
                type : "GET",
214
				type: "GET",
212
                url : "/recharge-result!getRechargeStatus?rechargeOrderId="+$rechargeOrder.getId()+"&isFinal=true",
215
				url: "/recharge-result!getRechargeStatus?rechargeOrderId=" + $rechargeOrder.getId() + "&isFinal=true",
213
                success : function(response) {
216
				success: function(response) {},
214
                },
-
 
215
                error : function() {
217
				error: function() {}
216
                }
-
 
217
           });
218
			});
218
		   window.setTimeout(reload, 5000);
219
			window.setTimeout(reload, 5000);
219
		}
220
		}
-
 
221
 
220
		function checkUnknownTransactions(){
222
		function checkUnknownTransactions() {
221
			jQuery.ajax({
223
			jQuery.ajax({
222
				type : "GET",
224
				type: "GET",
223
				url : "/recharge-result!getRechargeStatus?rechargeOrderId="+$rechargeOrder.getId()+"&isFinal=false",
225
				url: "/recharge-result!getRechargeStatus?rechargeOrderId=" + $rechargeOrder.getId() + "&isFinal=false",
224
				success : function(response) {
226
				success: function(response) {
225
					if (response=='RECHARGE_SUCCESSFUL' || response == 'RECHARGE_FAILED' || response == 'PAYMENT_SUCCESSFUL'){
227
					if (response == 'RECHARGE_SUCCESSFUL' || response == 'RECHARGE_FAILED' || response == 'PAYMENT_SUCCESSFUL') {
226
						reload();
228
						reload();
227
					}
229
					}
228
					incrementCounter();
230
					incrementCounter();
229
					if ($('#countdown').is(':visible')){
231
					if ($('#countdown').is(':visible')) {
230
						if(callCounter < 4){
232
						if (callCounter < 4) {
231
							window.setTimeout(checkUnknownTransactions, 5000);
233
							window.setTimeout(checkUnknownTransactions, 5000);
232
						}
234
						}
233
					}
235
					}
234
				},
236
				},
235
				error : function() {
237
				error: function() {
236
					incrementCounter();
238
					incrementCounter();
237
					if ($('#countdown').is(':visible')){
239
					if ($('#countdown').is(':visible')) {
238
						if(callCounter < 4){
240
						if (callCounter < 4) {
239
							window.setTimeout(checkUnknownTransactions, 5000);
241
							window.setTimeout(checkUnknownTransactions, 5000);
240
						}
242
						}
241
					}
243
					}
242
				}
244
				}
243
			});
245
			});
244
		}			
246
		}
245
		
247
 
246
		function incrementCounter(){
248
		function incrementCounter() {
247
			callCounter++;
249
			callCounter++;
248
		}
250
		}
249
		
251
 
250
		function reload(){
252
		function reload() {
251
			location.reload();
253
			location.reload();
252
		}
254
		}
253
</script>
255
</script>
254
<script type="text/javascript">
256
<script type="text/javascript">
255
  $(function(){
257
  $(function(){