Subversion Repositories SmartDukaan

Rev

Rev 12996 | Rev 13010 | Go to most recent revision | Details | Compare with Previous | Last modification | View Log | RSS feed

Rev Author Line No. Line
11024 lgm 1
<?php $orderConfirmation = $recharge_orderconfirmation[0];?>
10582 lgm 2
<div class="r-hldr"> 
3
  <div class="r-head">Recharge Details</div>
4
  <div class="r-cont clearfix">
5
    <div>Order Id</div>
6
    <div><?php echo $recharge_orderconfirmation[0]->response->rechargeDisplayId; ?></div>
7
  </div>
8
  <div class="r-cont clearfix">
9
    <div>Status</div>
10
    <div><?php echo $recharge_orderconfirmation[0]->response->rechargeStatus; ?></div>
12990 anikendra 11
<?php if(isset($recharge_orderconfirmation[0]->response->isOperatorAsynchronous) && $recharge_orderconfirmation[0]->response->isOperatorAsynchronous ==1):?>
12
<div id="countdown" style="margin:10px auto;display:block;"></div>
12997 anikendra 13
<div id="rechargestatus"><?php echo $orderConfirmation->response->detailDisplayMessage;?></div>
12990 anikendra 14
	<script src="//code.jquery.com/jquery-1.11.0.min.js"></script>
15
        <script src="/assets/js/jquery.countdown360.js" type="text/javascript" charset="utf-8"></script>
16
    <script type="text/javascript" charset="utf-8">
17
        $("#countdown").countdown360({
18
                 radius      : 50,
19
             seconds     : 60,
20
                 fontColor   : 'white',
21
                fillStyle   : '#6699ff',
22
                strokeStyle : '#F6F47A',
23
                autostart   : true,
24
                onComplete  : function () { hideCountDown()}
25
        })
26
                function hideCountDown(){
27
                        $('#countdown').hide();
28
                        jQuery.ajax({
29
                type : "GET",
30
 
12996 anikendra 31
                url : "/recharge-status?rechargeOrderId=<?php echo substr($recharge_orderconfirmation[0]->response->rechargeDisplayId,4);?>&isFinal=true",
12990 anikendra 32
                success : function(response) {
33
                                        if (response=='RECHARGE_SUCCESSFUL' || response == 'RECHARGE_FAILED' || response == 'PAYMENT_SUCCESSFUL'){
34
                                                location.reload();
35
                                        }
36
                },
37
                error : function() {
38
                }
39
           });
40
           location.reload();
41
                }
42
                function checkUnknownTransactions(){
43
                        jQuery.ajax({
44
                                type : "GET",
12996 anikendra 45
                                url : "/recharge-status?rechargeOrderId=<?php echo substr($recharge_orderconfirmation[0]->response->rechargeDisplayId,4);?>&isFinal=false",
12990 anikendra 46
                                success : function(response) {
47
                                        if (response=='RECHARGE_SUCCESSFUL' || response == 'RECHARGE_FAILED' || response == 'PAYMENT_SUCCESSFUL'){
48
                                                location.reload();
49
                                        }
50
                                        if ($('#countdown').is(':visible')){
51
                                                window.setTimeout(checkUnknownTransactions, 5000);
52
                                        }
53
                                },
54
                                error : function() {
55
                                }
56
                        });
57
        }
58
</script>
59
<script type="text/javascript">
60
  $(function(){
61
        if ($('#countdown').is(':visible')){
62
                window.setTimeout(checkUnknownTransactions, 40000);
63
        }
64
        });
65
</script>
66
<?php endif;?>
67
 
10582 lgm 68
  </div>
69
  <div class="r-info">
70
    <div class="r-info-head clearfix">
10939 lgm 71
      <?php if(strpos($recharge_orderconfirmation[0]->response->rechargeDisplayId, 'DTH') !== false){?>
72
      <div>Account Number</div>
73
      <?php } else{?>
74
      <div>Mobile Number</div><?php } ?>
10582 lgm 75
      <div>Operator</div>
76
      <div>Amount</div>
77
    </div>
78
    <div class="r-info-body clearfix">
79
      <div><?php echo $recharge_orderconfirmation[0]->response->rechargeDeviceNumber ?></div>
80
      <div><?php echo $recharge_orderconfirmation[0]->response->rechargeProvider ?></div>
81
      <div><?php echo $recharge_orderconfirmation[0]->response->totalAmount ?></div>
82
    </div>
83
  </div><!--o-info-->
84
 
85
</div><!--o-hldr-->
86
<script type="text/javascript">
12084 lgm 87
  var orderConfirmation = <?php echo json_encode($orderConfirmation);?>;
88
  if(orderConfirmation != undefined){
89
    var amount = parseFloat(orderConfirmation['response'].totalAmount).toFixed(2);
90
    var orderId = orderConfirmation['response'].rechargeDisplayId;
91
    var deviceNumber = orderConfirmation['response'].rechargeDeviceNumber;
12524 anikendra 92
/*
12084 lgm 93
    _gaq.push(['_addTrans',
94
      orderId,                     // Transaction ID. Required.
95
      'Saholic',   // Affiliation or store name.
96
      amount,               // Grand Total.
97
      '0',                  // Shipping.
98
      '0',                     // Tax.
99
      "",
100
      "",
101
      "India"
102
    ]);
103
    _gaq.push(['_addItem',
104
      orderId,                     // Transaction ID. Required.     
105
      deviceNumber,                 // SKU/code.
106
      orderConfirmation['response'].rechargeProvider,    // Product name. Required.
107
      'Digital',         // Category or variation.
108
      amount,                 // Unit price.
109
      '1'                   // Quantity.
110
    ]);
111
     _gaq.push(['_trackTrans']); //submits transaction to the Analytics servers
12524 anikendra 112
*/
113
	ga('ecommerce:addTransaction', {
114
	  'id': orderId,                     // Transaction ID. Required
115
	  'affiliation': 'Saholic',   // Affiliation or store name
116
	  'revenue': amount,               // Grand Total
117
	  'shipping': '0',                  // Shipping
118
	  'tax': '0'                     // Tax
119
	});
120
	// addItem should be called for every item in the shopping cart.
121
	ga('ecommerce:addItem', {
122
	  'id': orderId,                     // Transaction ID. Required
12528 anikendra 123
	  'sku': deviceNumber,                    // SKU/code
124
	  'name': orderConfirmation['response'].rechargeProvider,                // Product name. Required
12524 anikendra 125
	  'category': 'Digital',       // Category or variation
126
	  'price': amount,                 // Unit price
127
	  'quantity': '1'                   // Quantity
128
	});
129
	ga('ecommerce:send');      // Send transaction and item data to Google Analytics.
12084 lgm 130
  }
131
  var pheight = Math.max(document.documentElement.clientHeight, window.innerHeight || 0);
132
  var value = localStorage.getItem('rechargeValue');
10582 lgm 133
  if(parseInt(value) == 1){
12524 anikendra 134
	ga('send', 'event', 'Recharge', 'Recharge Result','Mobile-Result');
135
    	/*if(typeof _gaq != "undefined" && _gaq != null)  {
11024 lgm 136
        _gaq.push(['_trackEvent', 'Recharge', 'Recharge Result','Mobile-Result']);
12524 anikendra 137
      } */
10582 lgm 138
  }else if(parseInt(value) == 2){
12524 anikendra 139
    	/*if(typeof _gaq != "undefined" && _gaq != null)  {
11024 lgm 140
        _gaq.push(['_trackEvent', 'Recharge', 'Recharge Result','Recharge-Result']);
12524 anikendra 141
      } */
142
	ga('send', 'event', 'Recharge', 'Recharge Result','Recharge-Result');
10582 lgm 143
  }
11342 lgm 144
  // if(document.getElementsByClassName('order-conf')[0] != undefined){
145
  //     document.getElementsByClassName('order-conf')[0].style.minHeight = pheight - 153 +'px';  
146
  // }
10582 lgm 147
</script>