Subversion Repositories SmartDukaan

Rev

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