| Line 40... |
Line 40... |
| 40 |
}
|
40 |
}
|
| 41 |
|
41 |
|
| 42 |
function checkUnknownTransactions() {
|
42 |
function checkUnknownTransactions() {
|
| 43 |
jQuery.ajax({
|
43 |
jQuery.ajax({
|
| 44 |
type: "GET",
|
44 |
type: "GET",
|
| 45 |
url: "/recharge-status?rechargeOrderId=<?php echo substr($recharge_orderconfirmation[0]->response->rechargeDisplayId,4);?>&isFinal=false",
|
45 |
url: "/recharge-status?rechargeOrderId=<?php echo substr($recharge_orderconfirmation[0]->response->rechargeDisplayId,4);?>&finalCall=false",
|
| 46 |
success: function(response) {
|
46 |
success: function(response) {
|
| 47 |
if (response == 'RECHARGE_SUCCESSFUL' || response == 'RECHARGE_FAILED' || response == 'PAYMENT_SUCCESSFUL') {
|
47 |
if (response == 'RECHARGE_SUCCESSFUL' || response == 'RECHARGE_FAILED' || response == 'PAYMENT_SUCCESSFUL') {
|
| 48 |
reload();
|
48 |
reload();
|
| 49 |
}
|
49 |
}
|
| 50 |
incrementCounter();
|
50 |
incrementCounter();
|
| Line 105... |
Line 105... |
| 105 |
var orderConfirmation = <?php echo json_encode($orderConfirmation);?>;
|
105 |
var orderConfirmation = <?php echo json_encode($orderConfirmation);?>;
|
| 106 |
if(orderConfirmation != undefined){
|
106 |
if(orderConfirmation != undefined){
|
| 107 |
var amount = parseFloat(orderConfirmation['response'].totalAmount).toFixed(2);
|
107 |
var amount = parseFloat(orderConfirmation['response'].totalAmount).toFixed(2);
|
| 108 |
var orderId = orderConfirmation['response'].rechargeDisplayId;
|
108 |
var orderId = orderConfirmation['response'].rechargeDisplayId;
|
| 109 |
var deviceNumber = orderConfirmation['response'].rechargeDeviceNumber;
|
109 |
var deviceNumber = orderConfirmation['response'].rechargeDeviceNumber;
|
| 110 |
/*
|
110 |
|
| 111 |
_gaq.push(['_addTrans',
|
- |
|
| 112 |
orderId, // Transaction ID. Required.
|
- |
|
| 113 |
'Saholic', // Affiliation or store name.
|
- |
|
| 114 |
amount, // Grand Total.
|
- |
|
| 115 |
'0', // Shipping.
|
- |
|
| 116 |
'0', // Tax.
|
- |
|
| 117 |
"",
|
- |
|
| 118 |
"",
|
- |
|
| 119 |
"India"
|
- |
|
| 120 |
]);
|
- |
|
| 121 |
_gaq.push(['_addItem',
|
- |
|
| 122 |
orderId, // Transaction ID. Required.
|
- |
|
| 123 |
deviceNumber, // SKU/code.
|
- |
|
| 124 |
orderConfirmation['response'].rechargeProvider, // Product name. Required.
|
- |
|
| 125 |
'Digital', // Category or variation.
|
- |
|
| 126 |
amount, // Unit price.
|
- |
|
| 127 |
'1' // Quantity.
|
- |
|
| 128 |
]);
|
- |
|
| 129 |
_gaq.push(['_trackTrans']); //submits transaction to the Analytics servers
|
- |
|
| 130 |
*/
|
- |
|
| 131 |
ga('ecommerce:addTransaction', {
|
111 |
ga('ecommerce:addTransaction', {
|
| 132 |
'id': orderId, // Transaction ID. Required
|
112 |
'id': orderId, // Transaction ID. Required
|
| 133 |
'affiliation': 'Saholic', // Affiliation or store name
|
113 |
'affiliation': 'Saholic', // Affiliation or store name
|
| 134 |
'revenue': amount, // Grand Total
|
114 |
'revenue': amount, // Grand Total
|
| 135 |
'shipping': '0', // Shipping
|
115 |
'shipping': '0', // Shipping
|
| Line 147... |
Line 127... |
| 147 |
ga('ecommerce:send'); // Send transaction and item data to Google Analytics.
|
127 |
ga('ecommerce:send'); // Send transaction and item data to Google Analytics.
|
| 148 |
}
|
128 |
}
|
| 149 |
var pheight = Math.max(document.documentElement.clientHeight, window.innerHeight || 0);
|
129 |
var pheight = Math.max(document.documentElement.clientHeight, window.innerHeight || 0);
|
| 150 |
var value = localStorage.getItem('rechargeValue');
|
130 |
var value = localStorage.getItem('rechargeValue');
|
| 151 |
if(parseInt(value) == 1){
|
131 |
if(parseInt(value) == 1){
|
| 152 |
ga('send', 'event', 'Recharge', 'Recharge Result','Mobile-Result');
|
132 |
ga('send', 'event', 'Recharge', 'Recharge Result','Mobile-Result');
|
| 153 |
/*if(typeof _gaq != "undefined" && _gaq != null) {
|
- |
|
| 154 |
_gaq.push(['_trackEvent', 'Recharge', 'Recharge Result','Mobile-Result']);
|
- |
|
| 155 |
} */
|
- |
|
| 156 |
}else if(parseInt(value) == 2){
|
133 |
}else if(parseInt(value) == 2){
|
| 157 |
/*if(typeof _gaq != "undefined" && _gaq != null) {
|
- |
|
| 158 |
_gaq.push(['_trackEvent', 'Recharge', 'Recharge Result','Recharge-Result']);
|
- |
|
| 159 |
} */
|
- |
|
| 160 |
ga('send', 'event', 'Recharge', 'Recharge Result','Recharge-Result');
|
134 |
ga('send', 'event', 'Recharge', 'Recharge Result','Recharge-Result');
|
| 161 |
}
|
135 |
}
|
| 162 |
// if(document.getElementsByClassName('order-conf')[0] != undefined){
|
136 |
// if(document.getElementsByClassName('order-conf')[0] != undefined){
|
| 163 |
// document.getElementsByClassName('order-conf')[0].style.minHeight = pheight - 153 +'px';
|
137 |
// document.getElementsByClassName('order-conf')[0].style.minHeight = pheight - 153 +'px';
|
| 164 |
// }
|
138 |
// }
|
| 165 |
</script>
|
139 |
</script>
|
| 166 |
|
140 |
|