| 10582 |
lgm |
1 |
<?php if ( ! defined('BASEPATH')) exit('No direct script access allowed');
|
|
|
2 |
|
|
|
3 |
class Recharge extends MY_Controller {
|
|
|
4 |
|
|
|
5 |
public $layoutName ='';
|
|
|
6 |
|
|
|
7 |
function __construct() {
|
|
|
8 |
|
|
|
9 |
// Call the CI_controller constructor
|
|
|
10 |
parent::__construct();
|
| 11108 |
lgm |
11 |
// $admin = $this->session->userdata('admin');
|
|
|
12 |
// if(!isset($admin) || empty($admin)) {
|
|
|
13 |
// redirect(base_url().'authorize');
|
|
|
14 |
// }
|
| 10582 |
lgm |
15 |
$this->layout->setlayout('layout/layout_main');
|
|
|
16 |
$this->load->model('recharge_model');
|
|
|
17 |
$this->load->model('captcha_model');
|
|
|
18 |
$this->layoutName= $this->layout->getLayout();
|
|
|
19 |
$this->layoutName =substr($this->layoutName , 0, strrpos($this->layoutName , "/")).'/';
|
|
|
20 |
//print_r($this->session->userdata);
|
|
|
21 |
|
|
|
22 |
}
|
|
|
23 |
public function index()
|
|
|
24 |
{
|
|
|
25 |
if(!isset($_POST['submit'])){
|
|
|
26 |
$rechargeconfig = $this->config->item('recharge');
|
|
|
27 |
unset($rechargeconfig['response'][4]);
|
|
|
28 |
unset($rechargeconfig['response'][5]);
|
|
|
29 |
$cachemodule = array('header','footer');
|
|
|
30 |
$rechargeconfig = getCache($rechargeconfig,$cachemodule);
|
|
|
31 |
$data = array();
|
|
|
32 |
$this->lessphp->object()->ccompile('assets/css/recharge.less','assets/css/recharge.css');
|
|
|
33 |
$data['stylesheet'] = 'recharge.css';
|
| 11105 |
lgm |
34 |
$data['title'] = 'Mobile and DTH online recharge | saholic.com';
|
| 11012 |
lgm |
35 |
$data['metaKeywords'] = 'mobile, recharge';
|
|
|
36 |
$data['metaDescription'] = 'Description" content="Recharge your Mobile and DTH online for all cities using Credit/Debit card & net banking. Fast, Secure and Hassle Free Recharge';
|
| 10582 |
lgm |
37 |
$cache = getFileCache('rechargeOperators');
|
|
|
38 |
if(isset($cache) && !empty($cache)){
|
|
|
39 |
$data['response'] = $cache;
|
|
|
40 |
}else{
|
|
|
41 |
$data['response']=$this->recharge_model->getList($this->input->get(),$this->input->post(),$rechargeconfig['module']);
|
|
|
42 |
setFileCache($data['response'], 'rechargeOperators',900);
|
|
|
43 |
}
|
|
|
44 |
if(isset($cachemodule) and !empty($cachemodule))
|
|
|
45 |
{
|
|
|
46 |
foreach($cachemodule as $cm)
|
|
|
47 |
{
|
|
|
48 |
if(isset($rechargeconfig[$cm]) and !empty($rechargeconfig[$cm]))
|
|
|
49 |
{
|
|
|
50 |
$data['response'][$cm]=$rechargeconfig[$cm];
|
|
|
51 |
}
|
|
|
52 |
}
|
|
|
53 |
}
|
|
|
54 |
setCache($rechargeconfig['module'],$cachemodule,$data['response']);
|
|
|
55 |
$this->layout->view('recharge/recharge_view',$data);
|
|
|
56 |
}
|
|
|
57 |
|
|
|
58 |
}
|
|
|
59 |
|
|
|
60 |
public function confirm()
|
|
|
61 |
{
|
|
|
62 |
$authorized = $this->session->userdata('authorized');
|
|
|
63 |
if(isset($_POST['submit']) && $_POST['submit'] == 'Recharge'){
|
|
|
64 |
$rechargeconfig = $this->config->item('recharge');
|
|
|
65 |
unset($rechargeconfig['response'][0]);
|
|
|
66 |
unset($rechargeconfig['response'][1]);
|
|
|
67 |
unset($rechargeconfig['response'][2]);
|
|
|
68 |
unset($rechargeconfig['response'][3]);
|
|
|
69 |
$data = array();
|
|
|
70 |
$this->lessphp->object()->ccompile('assets/css/recharge.less','assets/css/recharge.css');
|
|
|
71 |
$data['recharge'] = $_POST['recharge-amt'];
|
|
|
72 |
if(isset($_POST['operator-name']) && !empty($_POST['operator-name'])){
|
|
|
73 |
$data['operator'] = $_POST['operator-name'];
|
|
|
74 |
}
|
|
|
75 |
if(isset($_POST['mobile-number']) && !empty($_POST['mobile-number'])){
|
|
|
76 |
$data['number'] = $_POST['mobile-number'];
|
|
|
77 |
$data['serviceType'] = 1;
|
|
|
78 |
}
|
|
|
79 |
if(isset($_POST['dth-number']) && !empty($_POST['dth-number'])){
|
|
|
80 |
$data['dth_number'] = $_POST['dth-number'];
|
|
|
81 |
$data['serviceType'] = 2;
|
|
|
82 |
}
|
|
|
83 |
if(isset($_POST['operatorId']) && !empty($_POST['operatorId'])){
|
|
|
84 |
$data['operatorId'] = $_POST['operatorId'];
|
|
|
85 |
}
|
|
|
86 |
if(isset($_POST['email']) && !empty($_POST['email'])){
|
|
|
87 |
$data['email'] = $_POST['email'];
|
|
|
88 |
}
|
|
|
89 |
if(isset($_POST['planName']) && !empty($_POST['planName'])){
|
|
|
90 |
$data['plan'] = $_POST['planName'];
|
|
|
91 |
}
|
|
|
92 |
$_POST['rechargeAmount'] = $_POST['recharge-amt'];
|
|
|
93 |
if(isset($authorized) && !empty($authorized)){
|
|
|
94 |
if($authorized['isLoggedIn'] == 1){
|
|
|
95 |
$_POST['userId'] = $authorized['Id'];
|
|
|
96 |
$_POST['isLoggedIn'] = 'true';
|
|
|
97 |
}
|
|
|
98 |
elseif(isset($authorized['isLoggedIn']) && empty($authorized['isLoggedIn'])) {
|
| 11458 |
lgm |
99 |
$_POST['userId'] = $authorized['Id'];
|
| 10582 |
lgm |
100 |
$_POST['isLoggedIn'] = 'false';
|
|
|
101 |
}
|
|
|
102 |
}else{
|
|
|
103 |
$_POST['userId'] = -1;
|
|
|
104 |
$_POST['isLoggedIn'] = 'false';
|
|
|
105 |
}
|
|
|
106 |
$data['stylesheet'] = 'recharge.css';
|
| 11012 |
lgm |
107 |
$data['title'] = 'Instant recharge for your mobile and DTH';
|
| 10582 |
lgm |
108 |
$data['response']=$this->recharge_model->getList($this->input->get(),$this->input->post(),$rechargeconfig);
|
|
|
109 |
if(isset($data['response']['response']['recharge_amount'][0]->payAmount) && $data['response']['response']['recharge_amount'][0]->payAmount == 0){
|
|
|
110 |
$captcha = $this->captcha_model->generateCaptcha();
|
|
|
111 |
$this->session->set_userdata('captcha',$captcha['word']);
|
|
|
112 |
$data['captcha'] = $captcha;
|
|
|
113 |
}
|
|
|
114 |
if(isset($data['response']['response']['recharge_confirmation'][0]->userId) && !empty($data['response']['response']['recharge_confirmation'][0]->userId)){
|
|
|
115 |
$this->session->set_userdata('userId',$data['response']['response']['recharge_confirmation'][0]->userId);
|
|
|
116 |
$this->layout->view('recharge/recharge_view',$data);
|
|
|
117 |
}
|
|
|
118 |
else{
|
|
|
119 |
redirect(base_url().'recharge');
|
|
|
120 |
}
|
|
|
121 |
|
|
|
122 |
}
|
|
|
123 |
elseif(isset($_POST['submit']) && (($_POST['submit'] == 'Confirm') || ($_POST['submit'] == 'Recharge Now')) && (isset($_POST['captcha_response_field']) && !empty($_POST['captcha_response_field']))) {
|
|
|
124 |
$userId = $this->session->userdata('userId');
|
|
|
125 |
$captcha = $this->session->userdata('captcha');
|
|
|
126 |
if(strcmp($captcha,$_POST['captcha_response_field']) != 0){
|
|
|
127 |
$rechargeconfig = $this->config->item('recharge');
|
|
|
128 |
unset($rechargeconfig['response'][0]);
|
|
|
129 |
unset($rechargeconfig['response'][1]);
|
|
|
130 |
unset($rechargeconfig['response'][2]);
|
|
|
131 |
unset($rechargeconfig['response'][3]);
|
|
|
132 |
$data = array();
|
|
|
133 |
$data['confirmCaptcha'] = 1;
|
|
|
134 |
$this->lessphp->object()->ccompile('assets/css/recharge.less','assets/css/recharge.css');
|
|
|
135 |
$data['recharge'] = $_POST['rechargeAmount'];
|
|
|
136 |
if(isset($_POST['operator-name']) && !empty($_POST['operator-name'])){
|
|
|
137 |
$data['operator'] = $_POST['operator-name'];
|
|
|
138 |
}
|
|
|
139 |
if(isset($_POST['serviceType']) && ($_POST['serviceType'] == 1)){
|
|
|
140 |
$data['number'] = $_POST['number'];
|
|
|
141 |
$data['serviceType'] = 1;
|
|
|
142 |
}
|
|
|
143 |
if(isset($_POST['serviceType']) && ($_POST['serviceType'] == 2)){
|
|
|
144 |
$data['dth_number'] = $_POST['number'];
|
|
|
145 |
$data['serviceType'] = 2;
|
|
|
146 |
}
|
|
|
147 |
if(isset($_POST['operatorId']) && !empty($_POST['operatorId'])){
|
|
|
148 |
$data['operatorId'] = $_POST['operatorId'];
|
|
|
149 |
}
|
|
|
150 |
if(isset($_POST['email']) && !empty($_POST['email'])){
|
|
|
151 |
$data['email'] = $_POST['email'];
|
|
|
152 |
}
|
|
|
153 |
if(isset($_POST['planName']) && !empty($_POST['planName'])){
|
|
|
154 |
$data['plan'] = $_POST['planName'];
|
|
|
155 |
}
|
|
|
156 |
if(isset($authorized) && !empty($authorized)){
|
|
|
157 |
if($authorized['isLoggedIn'] == 1){
|
|
|
158 |
$_POST['userId'] = $authorized['Id'];
|
|
|
159 |
$_POST['isLoggedIn'] = 'true';
|
|
|
160 |
}
|
|
|
161 |
elseif(isset($authorized['isLoggedIn']) && empty($authorized['isLoggedIn'])) {
|
| 11458 |
lgm |
162 |
$_POST['userId'] = $authorized['Id'];
|
| 10582 |
lgm |
163 |
$_POST['isLoggedIn'] = 'false';
|
|
|
164 |
}
|
|
|
165 |
}else{
|
|
|
166 |
$_POST['userId'] = -1;
|
|
|
167 |
$_POST['isLoggedIn'] = 'false';
|
|
|
168 |
}
|
|
|
169 |
$data['stylesheet'] = 'recharge.css';
|
| 11012 |
lgm |
170 |
|
| 10582 |
lgm |
171 |
$data['response']=$this->recharge_model->getList($this->input->get(),$this->input->post(),$rechargeconfig);
|
|
|
172 |
if(isset($data['response']['response']['recharge_amount'][0]->payAmount) && $data['response']['response']['recharge_amount'][0]->payAmount == 0){
|
|
|
173 |
$captcha = $this->captcha_model->generateCaptcha();
|
|
|
174 |
$this->session->set_userdata('captcha',$captcha['word']);
|
|
|
175 |
$data['captcha'] = $captcha;
|
|
|
176 |
}
|
|
|
177 |
if(isset($data['response']['response']['recharge_confirmation'][0]->userId) && !empty($data['response']['response']['recharge_confirmation'][0]->userId)){
|
|
|
178 |
$this->session->set_userdata('userId',$data['response']['response']['recharge_confirmation'][0]->userId);
|
|
|
179 |
$this->layout->view('recharge/recharge_view',$data);
|
|
|
180 |
}else{
|
|
|
181 |
redirect(base_url().'recharge');
|
|
|
182 |
}
|
|
|
183 |
}elseif(strcmp($captcha,$_POST['captcha_response_field']) == 0){
|
|
|
184 |
if(isset($userId) && !empty($userId)){
|
|
|
185 |
if(isset($authorized) && !empty($authorized)){
|
|
|
186 |
if($authorized['isLoggedIn'] == 1){
|
|
|
187 |
$_POST['userId'] = $authorized['Id'];
|
|
|
188 |
$_POST['rechargeUserId'] = $userId;
|
|
|
189 |
$_POST['isLoggedIn'] = 'true';
|
|
|
190 |
}
|
|
|
191 |
elseif(isset($authorized['isLoggedIn']) && empty($authorized['isLoggedIn'])) {
|
| 11458 |
lgm |
192 |
$_POST['userId'] = $authorized['Id'];
|
|
|
193 |
$_POST['rechargeUserId'] = $userId;
|
| 10582 |
lgm |
194 |
$_POST['isLoggedIn'] = 'false';
|
|
|
195 |
}
|
|
|
196 |
}else{
|
|
|
197 |
$_POST['userId'] = -1;
|
|
|
198 |
$_POST['rechargeUserId'] = $userId;
|
|
|
199 |
$_POST['isLoggedIn'] = 'false';
|
|
|
200 |
}
|
|
|
201 |
$_POST['ipAddress'] = $_SERVER['REMOTE_ADDR'];
|
|
|
202 |
$data = array();
|
|
|
203 |
$data['response']=$this->recharge_model->getList($this->input->get(),$this->input->post(),$this->config->item('rechargeConfirm'));
|
|
|
204 |
if(isset($data['response']['response']['recharge_confirm'][0]->response) && !empty($data['response']['response']['recharge_confirm'][0]->response)){
|
|
|
205 |
$redirectUrl = $data['response']['response']['recharge_confirm'][0]->response->redirectUrl;
|
|
|
206 |
if(strpos($redirectUrl, 'zero-pay-recharge') !== false){
|
|
|
207 |
$url = $this->config->item('curl_base_url').$redirectUrl;
|
|
|
208 |
$params = array();
|
|
|
209 |
$this->mcurl->add_call('zero_pay','get',$url,$params);
|
|
|
210 |
$response = $this->mcurl->execute($url);
|
|
|
211 |
$data['response'] = $response['zero_pay']['response'];
|
|
|
212 |
$response = $this->magento_model->payment_submit($data);
|
|
|
213 |
$redirectUrl = $response[0]->response->redirectUrl;
|
|
|
214 |
$redirectUrl = explode('?', $redirectUrl);
|
|
|
215 |
redirect(base_url().'recharge-result?'.$redirectUrl[1]);
|
|
|
216 |
}else{
|
|
|
217 |
redirect(base_url().$redirectUrl);
|
|
|
218 |
}
|
|
|
219 |
}
|
|
|
220 |
else{
|
|
|
221 |
redirect(base_url().'confirm');
|
|
|
222 |
}
|
|
|
223 |
}
|
|
|
224 |
else{
|
|
|
225 |
|
|
|
226 |
redirect(base_url().'recharge');
|
|
|
227 |
}
|
|
|
228 |
}else{
|
|
|
229 |
redirect(base_url().'recharge');
|
|
|
230 |
}
|
|
|
231 |
}
|
|
|
232 |
elseif(isset($_POST['submit']) && (($_POST['submit'] == 'Confirm') || ($_POST['submit'] == 'Recharge Now')) && (!isset($_POST['captcha_response_field']) || empty($_POST['captcha_response_field']))){
|
|
|
233 |
$userId = $this->session->userdata('userId');
|
|
|
234 |
if(isset($userId) && !empty($userId)){
|
|
|
235 |
if(isset($authorized) && !empty($authorized)){
|
|
|
236 |
if($authorized['isLoggedIn'] == 1){
|
|
|
237 |
$_POST['userId'] = $authorized['Id'];
|
|
|
238 |
$_POST['rechargeUserId'] = $userId;
|
|
|
239 |
$_POST['isLoggedIn'] = 'true';
|
|
|
240 |
}
|
|
|
241 |
elseif(isset($authorized['isLoggedIn']) && empty($authorized['isLoggedIn'])) {
|
| 11458 |
lgm |
242 |
$_POST['userId'] = $authorized['Id'];
|
|
|
243 |
$_POST['rechargeUserId'] = $userId;
|
| 10582 |
lgm |
244 |
$_POST['isLoggedIn'] = 'false';
|
|
|
245 |
}
|
|
|
246 |
}else{
|
|
|
247 |
$_POST['userId'] = -1;
|
|
|
248 |
$_POST['rechargeUserId'] = $userId;
|
|
|
249 |
$_POST['isLoggedIn'] = 'false';
|
|
|
250 |
}
|
|
|
251 |
$_POST['ipAddress'] = $_SERVER['REMOTE_ADDR'];
|
|
|
252 |
$data = array();
|
|
|
253 |
$data['response']=$this->recharge_model->getList($this->input->get(),$this->input->post(),$this->config->item('rechargeConfirm'));
|
|
|
254 |
if(isset($data['response']['response']['recharge_confirm'][0]->response) && !empty($data['response']['response']['recharge_confirm'][0]->response)){
|
|
|
255 |
$redirectUrl = $data['response']['response']['recharge_confirm'][0]->response->redirectUrl;
|
|
|
256 |
if(strpos($redirectUrl, 'zero-pay-recharge') !== false){
|
|
|
257 |
$url = $this->config->item('curl_base_url').$redirectUrl;
|
|
|
258 |
$params = array();
|
|
|
259 |
$this->mcurl->add_call('zero_pay','get',$url,$params);
|
|
|
260 |
$response = $this->mcurl->execute($url);
|
|
|
261 |
$data['response'] = $response['zero_pay']['response'];
|
|
|
262 |
$response = $this->magento_model->payment_submit($data);
|
|
|
263 |
$redirectUrl = $response[0]->response->redirectUrl;
|
|
|
264 |
$redirectUrl = explode('?', $redirectUrl);
|
|
|
265 |
redirect(base_url().'recharge-result?'.$redirectUrl[1]);
|
|
|
266 |
}else{
|
|
|
267 |
redirect(base_url().$redirectUrl);
|
|
|
268 |
}
|
|
|
269 |
}
|
|
|
270 |
else{
|
|
|
271 |
redirect(base_url().'recharge');
|
|
|
272 |
}
|
|
|
273 |
}
|
|
|
274 |
else{
|
|
|
275 |
redirect(base_url().'recharge');
|
|
|
276 |
}
|
|
|
277 |
}else{
|
|
|
278 |
redirect(base_url().'recharge');
|
|
|
279 |
}
|
|
|
280 |
}
|
|
|
281 |
|
|
|
282 |
|
|
|
283 |
public function recharge_again(){
|
|
|
284 |
$authorized = $this->session->userdata('authorized');
|
|
|
285 |
if(isset($_POST['submit']) && $_POST['submit'] == 'Recharge Again'){
|
|
|
286 |
$rechargeconfig = $this->config->item('recharge');
|
|
|
287 |
unset($rechargeconfig['response'][0]);
|
|
|
288 |
unset($rechargeconfig['response'][1]);
|
|
|
289 |
unset($rechargeconfig['response'][2]);
|
|
|
290 |
unset($rechargeconfig['response'][3]);
|
|
|
291 |
$data = array();
|
|
|
292 |
$this->lessphp->object()->ccompile('assets/css/recharge.less','assets/css/recharge.css');
|
|
|
293 |
$data['recharge'] = $_POST['recharge-amt'];
|
|
|
294 |
if(isset($_POST['operator-name']) && !empty($_POST['operator-name'])){
|
|
|
295 |
$data['operator'] = $_POST['operator-name'];
|
|
|
296 |
}
|
|
|
297 |
if(isset($_POST['mobile-number']) && !empty($_POST['mobile-number'])){
|
|
|
298 |
$data['number'] = $_POST['mobile-number'];
|
|
|
299 |
$data['serviceType'] = 1;
|
|
|
300 |
}
|
|
|
301 |
if(isset($_POST['dth-number']) && !empty($_POST['dth-number'])){
|
|
|
302 |
$data['dth_number'] = $_POST['dth-number'];
|
|
|
303 |
$data['serviceType'] = 2;
|
|
|
304 |
}
|
|
|
305 |
if(isset($_POST['operatorId']) && !empty($_POST['operatorId'])){
|
|
|
306 |
$data['operatorId'] = $_POST['operatorId'];
|
|
|
307 |
}
|
|
|
308 |
if(isset($_POST['email']) && !empty($_POST['email'])){
|
|
|
309 |
$data['email'] = $_POST['email'];
|
|
|
310 |
}
|
|
|
311 |
if(isset($_POST['planName']) && !empty($_POST['planName'])){
|
|
|
312 |
$data['plan'] = $_POST['planName'];
|
|
|
313 |
}
|
|
|
314 |
$_POST['rechargeAmount'] = $_POST['recharge-amt'];
|
|
|
315 |
if(isset($authorized) && !empty($authorized)){
|
|
|
316 |
if($authorized['isLoggedIn'] == 1){
|
|
|
317 |
$_POST['userId'] = $authorized['Id'];
|
|
|
318 |
$_POST['isLoggedIn'] = 'true';
|
|
|
319 |
}
|
|
|
320 |
elseif(isset($authorized['isLoggedIn']) && empty($authorized['isLoggedIn'])) {
|
| 11458 |
lgm |
321 |
$_POST['userId'] = $authorized['Id'];
|
|
|
322 |
$_POST['isLoggedIn'] = 'false';
|
| 10582 |
lgm |
323 |
}
|
|
|
324 |
}else{
|
|
|
325 |
$_POST['userId'] = -1;
|
|
|
326 |
$_POST['isLoggedIn'] = 'false';
|
|
|
327 |
}
|
|
|
328 |
$data['stylesheet'] = 'recharge.css';
|
|
|
329 |
$data['response']=$this->recharge_model->getList($this->input->get(),$this->input->post(),$rechargeconfig);
|
|
|
330 |
if(isset($data['response']['response']['recharge_amount'][0]->payAmount) && $data['response']['response']['recharge_amount'][0]->payAmount == 0){
|
|
|
331 |
$captcha = $this->captcha_model->generateCaptcha();
|
|
|
332 |
$this->session->set_userdata('captcha',$captcha['word']);
|
|
|
333 |
$data['captcha'] = $captcha;
|
|
|
334 |
}
|
|
|
335 |
if(isset($data['response']['response']['recharge_confirmation'][0]->userId) && !empty($data['response']['response']['recharge_confirmation'][0]->userId)){
|
|
|
336 |
$this->session->set_userdata('userId',$data['response']['response']['recharge_confirmation'][0]->userId);
|
|
|
337 |
$this->layout->view('recharge/recharge_view',$data);
|
|
|
338 |
}
|
|
|
339 |
else{
|
|
|
340 |
redirect(base_url().'recharge');
|
|
|
341 |
}
|
|
|
342 |
|
|
|
343 |
}else{
|
|
|
344 |
redirect(base_url().'recharge');
|
|
|
345 |
}
|
|
|
346 |
}
|
|
|
347 |
|
|
|
348 |
public function payOptions(){
|
|
|
349 |
$rechargeConfig = $this->config->item('rechargePayOptions');
|
|
|
350 |
if(isset($_GET['rechargeOrderId']) && !empty($_GET['rechargeOrderId']) && !isset($_POST['submit'])){
|
|
|
351 |
//$_GET['rechargeOrderId'] = $_GET['rechargeOrderId'];
|
|
|
352 |
unset($rechargeConfig['response'][1]);
|
|
|
353 |
$this->lessphp->object()->ccompile('assets/css/recharge.less','assets/css/recharge.css');
|
|
|
354 |
$data['stylesheet'] = 'recharge.css';
|
| 11012 |
lgm |
355 |
$data['title'] = 'Recharge Pay Options';
|
| 10582 |
lgm |
356 |
$data['response']=$this->recharge_model->getList($this->input->get(),$this->input->post(),$rechargeConfig);
|
|
|
357 |
$this->layout->view('recharge/recharge_view',$data);
|
|
|
358 |
|
|
|
359 |
}elseif(isset($_GET['rechargeOrderId']) && !empty($_GET['rechargeOrderId']) && isset($_POST['submit'])){
|
|
|
360 |
unset($rechargeConfig['response'][0]);
|
|
|
361 |
$_POST['rechargeOrderId'] = $_GET['rechargeOrderId'];
|
|
|
362 |
$phone = $this->session->userdata('phoneNumber');
|
|
|
363 |
if(isset($phone) && !empty($phone)){
|
|
|
364 |
$_POST['phone']= $phone;
|
|
|
365 |
}
|
|
|
366 |
$userId = $this->session->userdata('userId');
|
|
|
367 |
if(isset($userId) && !empty($userId)){
|
|
|
368 |
$_POST['rechargeUserId'] = $userId;
|
|
|
369 |
}
|
|
|
370 |
$_POST['payment_option'] = $_POST['payoption'];
|
|
|
371 |
$data = array();
|
|
|
372 |
$data['response']=$this->recharge_model->getList($this->input->get(),$this->input->post(),$rechargeConfig);
|
|
|
373 |
if(isset($data['response']['response']['recharge_paymentSubmit'][0]) && !empty($data['response']['response']['recharge_paymentSubmit'][0])){
|
|
|
374 |
$paymentSubmit = $data['response']['response']['recharge_paymentSubmit'][0];
|
|
|
375 |
if(isset($paymentSubmit->response->isPaymentRedirect) && $paymentSubmit->response->isPaymentRedirect == 1){
|
| 11418 |
lgm |
376 |
$image = './assets/images/loading.gif';
|
| 10582 |
lgm |
377 |
$location = $paymentSubmit->response->redirectUrl;
|
|
|
378 |
echo '<html><head><meta http-equiv="refresh" content="2;url='.$paymentSubmit->response->redirectUrl.'">
|
| 11418 |
lgm |
379 |
<meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=no">
|
| 10582 |
lgm |
380 |
<title>Saholic Mobile Site: Redirecting to <'.$paymentSubmit->response->gatewayName.'> Payment Gateway</title>
|
|
|
381 |
</head>
|
|
|
382 |
<body>
|
|
|
383 |
<div style="text-align:center; margin-top:200px;">Please wait while we redirect you to the Payment Gateway.</div>
|
|
|
384 |
<div align="center" class="img">
|
|
|
385 |
<img title="loading" alt="loading" src="'.$image.'">
|
|
|
386 |
</div>
|
|
|
387 |
</body>
|
|
|
388 |
</html>';
|
|
|
389 |
}elseif(isset($paymentSubmit->response->redirectUrl) && strpos($paymentSubmit->response->redirectUrl, 'ebs-pay') !== false){
|
|
|
390 |
$url = $this->config->item('curl_base_url').$paymentSubmit->response->redirectUrl;
|
|
|
391 |
//echo $url;
|
|
|
392 |
$params = array();
|
|
|
393 |
$authorized = $this->session->userdata('authorized');
|
|
|
394 |
if(isset($authorized) && !empty($authorized)){
|
|
|
395 |
$params['userId'] = $authorized['Id'];
|
|
|
396 |
if($authorized['isLoggedIn'] == 1){
|
|
|
397 |
$params['isLoggedIn'] = 'true';
|
|
|
398 |
}
|
|
|
399 |
elseif(isset($authorized['isLoggedIn']) && empty($authorized['isLoggedIn'])) {
|
|
|
400 |
$params['isLoggedIn'] = 'false';
|
|
|
401 |
}
|
|
|
402 |
}
|
|
|
403 |
$this->mcurl->add_call('ebs','get',$url,$params);
|
|
|
404 |
$response = $this->mcurl->execute($url);
|
|
|
405 |
$data['response'] = $response['ebs']['response'];
|
|
|
406 |
$response = $this->magento_model->payment_submit($data);
|
|
|
407 |
if(isset($response) && !empty($response)){
|
|
|
408 |
$ebs = $response[0]->response;
|
| 11418 |
lgm |
409 |
$image = './assets/images/loading.gif';
|
| 10582 |
lgm |
410 |
$return_url = base_url().'ebs-pay-processing/?DR={DR}';
|
|
|
411 |
echo '<html>
|
|
|
412 |
<head>
|
| 11418 |
lgm |
413 |
<meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=no">
|
| 10582 |
lgm |
414 |
<title>m.saholic.com: Redirecting to EBS Payment Page</title>
|
|
|
415 |
</head>
|
|
|
416 |
<body>
|
|
|
417 |
<div style="text-align:center; margin-top:200px;">Please wait while we redirect you to the Payment Gateway.</div>
|
|
|
418 |
<div align="center" class="img">
|
| 11418 |
lgm |
419 |
<img title="loading" alt="loading" src="'.$image.'">
|
| 10582 |
lgm |
420 |
</div>
|
|
|
421 |
<div style="display:none">
|
|
|
422 |
<form method="post" action="'.$ebs->postAction.'" name="frmTransaction" id="frmTransaction">
|
|
|
423 |
<!-- Account Id -->
|
|
|
424 |
<input name="account_id" type="hidden" value="'.$ebs->account_id.'" />
|
|
|
425 |
<!-- Transaction Details -->
|
|
|
426 |
<input name="reference_no" type="hidden" value="'.$ebs->reference_no.'" />
|
|
|
427 |
<input name="amount" type="hidden" value="'.$ebs->amount.'" />
|
|
|
428 |
<input name="description" type="hidden" value="'.$ebs->description.'" />
|
|
|
429 |
<input name="payment_option" type="hidden" value="'.$ebs->payment_option.'"/>
|
|
|
430 |
<!-- Billing Address -->
|
|
|
431 |
<input name="name" type="hidden" value="'.$ebs->name.'" />
|
|
|
432 |
<input name="address" type="hidden" value="'.$ebs->address.'" />
|
|
|
433 |
<input name="city" type="hidden" value="'.$ebs->city.'" />
|
|
|
434 |
<input name="state" type="hidden" value="'.$ebs->state.'" />
|
|
|
435 |
<input name="postal_code" type="hidden" value="'.$ebs->postal_code.'" />
|
| 11414 |
amit.gupta |
436 |
<input name="country" type="hidden" value="'.$ebs->country.'"/>
|
| 10582 |
lgm |
437 |
<input name="email" type="hidden" value="'.$ebs->email.'" />
|
|
|
438 |
<input name="phone" type="hidden" value="'.$ebs->phone.'" />
|
|
|
439 |
<!-- Delivery Address -->
|
|
|
440 |
<input name="ship_name" type="hidden" value="'.$ebs->ship_name.'" />
|
|
|
441 |
<input name="ship_address" type="hidden" value="'.$ebs->ship_address.'" />
|
|
|
442 |
<input name="ship_city" type="hidden" value="'.$ebs->ship_city.'" />
|
|
|
443 |
<input name="ship_state" type="hidden" value="'.$ebs->ship_state.'" />
|
|
|
444 |
<input name="ship_postal_code" type="hidden" value="'.$ebs->ship_postal_code.'" />
|
| 11414 |
amit.gupta |
445 |
<input name="ship_country" type="hidden" value="'.$ebs->ship_country.'"/>
|
| 10582 |
lgm |
446 |
<input name="ship_phone" type="hidden" value="'.$ebs->ship_phone.'" />
|
|
|
447 |
<input name="return_url" type="hidden" value="'.$ebs->return_url.'" />
|
|
|
448 |
<input name="mode" value="'.$ebs->mode.'"/>
|
|
|
449 |
<input name="secure_hash" type="hidden" value="'.$ebs->secure_hash.'" />
|
|
|
450 |
<input name="channel" type="hidden" value="'.$ebs->channel.'" />
|
|
|
451 |
<input name="page_id" type="hidden" value="'.$ebs->page_id.'" />
|
|
|
452 |
</form>
|
|
|
453 |
</div>
|
|
|
454 |
<script type="text/javascript">
|
|
|
455 |
document.getElementById("frmTransaction").submit();
|
|
|
456 |
</script>
|
|
|
457 |
</body>
|
|
|
458 |
</html>';
|
|
|
459 |
}else{
|
|
|
460 |
redirect(base_url().'payment');
|
|
|
461 |
}
|
|
|
462 |
}
|
|
|
463 |
else{
|
|
|
464 |
redirect(base_url().'recharge');
|
|
|
465 |
}
|
|
|
466 |
}else{
|
|
|
467 |
redirect(base_url().'recharge');
|
|
|
468 |
}
|
|
|
469 |
}
|
|
|
470 |
|
|
|
471 |
}
|
|
|
472 |
|
|
|
473 |
public function orderconfirmation(){
|
|
|
474 |
if(isset($_GET['paymentId']) && !empty($_GET['paymentId'])){
|
|
|
475 |
//$_GET['rechargeOrderId'] = $_GET['rechargeOrderId'];
|
|
|
476 |
$this->lessphp->object()->ccompile('assets/css/recharge.less','assets/css/recharge.css');
|
|
|
477 |
$data['stylesheet'] = 'recharge.css';
|
|
|
478 |
$data['response']=$this->recharge_model->getList($this->input->get(),$this->input->post(),$this->config->item('rechargeOrderConfirmation'));
|
|
|
479 |
$this->layout->view('recharge/recharge_view',$data);
|
|
|
480 |
}
|
|
|
481 |
|
|
|
482 |
}
|
|
|
483 |
|
|
|
484 |
public function operator($number)
|
|
|
485 |
{
|
|
|
486 |
$_GET['deviceNumber'] = $number;
|
|
|
487 |
$_GET['serviceType'] = 1;
|
|
|
488 |
$data = array();
|
|
|
489 |
$authorized = $this->session->userdata('authorized');
|
|
|
490 |
if(isset($authorized) && !empty($authorized)){
|
|
|
491 |
$_GET['userId'] = $authorized['Id'];
|
|
|
492 |
if($authorized['isLoggedIn'] == 1){
|
|
|
493 |
$_GET['isLoggedIn'] = 'true';
|
|
|
494 |
}
|
|
|
495 |
elseif(isset($authorized['isLoggedIn']) && empty($authorized['isLoggedIn'])) {
|
|
|
496 |
$_GET['isLoggedIn'] = 'false';
|
|
|
497 |
}
|
|
|
498 |
}else{
|
|
|
499 |
$_GET['userId'] = -1;
|
|
|
500 |
$_GET['isLoggedIn'] = 'false';
|
|
|
501 |
}
|
|
|
502 |
|
|
|
503 |
$this->lessphp->object()->ccompile('assets/css/recharge.less','assets/css/recharge.css');
|
|
|
504 |
$data['stylesheet'] = 'recharge.css';
|
|
|
505 |
$data['response']=$this->recharge_model->getList($this->input->get(),$this->input->post(),$this->config->item('service'));
|
|
|
506 |
if(isset($data['response']['response']['service_provider']) && !empty($data['response']['response']['service_provider'])){
|
|
|
507 |
$serviceProvider = $data['response']['response']['service_provider'][0];
|
|
|
508 |
echo json_encode($serviceProvider);
|
|
|
509 |
//$operatorId = $serviceProvider->operatorId;
|
|
|
510 |
//$circleCode = $serviceProvider->circleCode;
|
|
|
511 |
//$operatorName = $serviceProvider->operatorName;
|
|
|
512 |
//$_GET['operatorId'] = $operatorId;
|
|
|
513 |
//$_GET['circleCode'] = $circleCode;
|
|
|
514 |
//$_GET['denominationType'] = 1;
|
|
|
515 |
//$data['response']=$this->recharge_model->getList($this->input->get(),$this->input->post(),$this->config->item('denominations'));
|
|
|
516 |
|
|
|
517 |
}
|
|
|
518 |
}
|
|
|
519 |
|
|
|
520 |
public function topupSpecial($denominationType=null,$operatorId=null,$circleCode=null){
|
|
|
521 |
$data = array();
|
|
|
522 |
$authorized = $this->session->userdata('authorized');
|
|
|
523 |
if(isset($authorized) && !empty($authorized)){
|
|
|
524 |
$_GET['userId'] = $authorized['Id'];
|
|
|
525 |
if($authorized['isLoggedIn'] == 1){
|
|
|
526 |
$_GET['isLoggedIn'] = 'true';
|
|
|
527 |
}
|
|
|
528 |
elseif(isset($authorized['isLoggedIn']) && empty($authorized['isLoggedIn'])) {
|
|
|
529 |
$_GET['isLoggedIn'] = 'false';
|
|
|
530 |
}
|
|
|
531 |
}else{
|
|
|
532 |
$_GET['userId'] = -1;
|
|
|
533 |
$_GET['isLoggedIn'] = 'false';
|
|
|
534 |
}
|
|
|
535 |
$_GET['denominationType'] = $denominationType;
|
|
|
536 |
$_GET['operatorId'] = $operatorId;
|
|
|
537 |
$_GET['circleCode'] = $circleCode;
|
|
|
538 |
$data['response']=$this->recharge_model->getList($this->input->get(),$this->input->post(),$this->config->item('denominations'));
|
|
|
539 |
if(isset($data['response']['response']['mobile_denominations']) && !empty($data['response']['response']['mobile_denominations'])){
|
|
|
540 |
$mobileDenominations = $data['response']['response']['mobile_denominations'][0];
|
|
|
541 |
$offers = '';
|
|
|
542 |
foreach ($mobileDenominations as $offer) {
|
| 11550 |
anikendra |
543 |
$validity = strpos($offer->validity,"0")!==false?'-':$offer->validity;
|
|
|
544 |
$offers .= '<div onclick="fillAmount(event)">'.$offer->amount.'</div><div>'.$validity.'</div><div>'.$offer->description.'</div>';
|
| 10582 |
lgm |
545 |
}
|
|
|
546 |
echo $offers;
|
|
|
547 |
}
|
|
|
548 |
}
|
|
|
549 |
public function rechargeAmount($rechargeAmount,$couponCode)
|
|
|
550 |
{
|
|
|
551 |
$_GET['rechargeAmount'] = $rechargeAmount;
|
|
|
552 |
$_GET['couponCode'] = $couponCode;
|
|
|
553 |
$data = array();
|
|
|
554 |
$authorized = $this->session->userdata('authorized');
|
|
|
555 |
if(isset($authorized) && !empty($authorized)){
|
|
|
556 |
$_GET['userId'] = $authorized['Id'];
|
|
|
557 |
if($authorized['isLoggedIn'] == 1){
|
|
|
558 |
$_GET['isLoggedIn'] = 'true';
|
|
|
559 |
}
|
|
|
560 |
elseif(isset($authorized['isLoggedIn']) && empty($authorized['isLoggedIn'])) {
|
|
|
561 |
$_GET['isLoggedIn'] = 'false';
|
|
|
562 |
}
|
|
|
563 |
}else{
|
|
|
564 |
$_GET['userId'] = -1;
|
|
|
565 |
$_GET['isLoggedIn'] = 'false';
|
|
|
566 |
}
|
|
|
567 |
$data['response']=$this->recharge_model->getList($this->input->get(),$this->input->post(),$this->config->item('rechargeAmount'));
|
|
|
568 |
if(isset($data['response']['response']['recharge_amount']) && !empty($data['response']['response']['recharge_amount'])){
|
|
|
569 |
$recharge = $data['response']['response']['recharge_amount'][0];
|
|
|
570 |
echo json_encode($recharge);
|
|
|
571 |
}
|
|
|
572 |
}
|
|
|
573 |
public function rechargeFaq(){
|
|
|
574 |
$rechargeconfig = $this->config->item('rechargeFaq');
|
|
|
575 |
$cachemodule = array('header','footer');
|
|
|
576 |
$rechargeconfig = getCache($rechargeconfig,$cachemodule);
|
|
|
577 |
$data = array();
|
|
|
578 |
$this->lessphp->object()->ccompile('assets/css/recharge.less','assets/css/recharge.css');
|
|
|
579 |
$data['stylesheet'] = 'recharge.css';
|
| 11012 |
lgm |
580 |
$data['title'] = 'Mobile / DTH Recharge Online - Frequently asked quesitons';
|
| 10582 |
lgm |
581 |
$data['response']=$this->recharge_model->getList($this->input->get(),$this->input->post(),$this->config->item('rechargeFaq'));
|
|
|
582 |
if(isset($cachemodule) and !empty($cachemodule))
|
|
|
583 |
{
|
|
|
584 |
foreach($cachemodule as $cm)
|
|
|
585 |
{
|
|
|
586 |
if(isset($rechargeconfig[$cm]) and !empty($rechargeconfig[$cm]))
|
|
|
587 |
{
|
|
|
588 |
$data['response'][$cm]=$rechargeconfig[$cm];
|
|
|
589 |
}
|
|
|
590 |
}
|
|
|
591 |
}
|
|
|
592 |
setCache($rechargeconfig['module'],$cachemodule,$data['response']);
|
|
|
593 |
$this->layout->view('recharge/recharge_view',$data);
|
|
|
594 |
|
|
|
595 |
}
|
| 10890 |
lgm |
596 |
public function hdfcRecahrgeResponse(){
|
|
|
597 |
if(isset($_POST)){
|
|
|
598 |
$paymentconfig = $this->config->item('hdfcRecahrgeResponse');
|
|
|
599 |
$authorized = $this->session->userdata('authorized');
|
|
|
600 |
if(isset($authorized) && !empty($authorized)){
|
|
|
601 |
$_POST['userId'] = $authorized['Id'];
|
|
|
602 |
if($authorized['isLoggedIn'] == 1){
|
|
|
603 |
$_POST['isLoggedIn'] = 'true';
|
|
|
604 |
}
|
|
|
605 |
elseif(isset($authorized['isLoggedIn']) && empty($authorized['isLoggedIn'])) {
|
|
|
606 |
$_POST['isLoggedIn'] = 'false';
|
|
|
607 |
}
|
|
|
608 |
}
|
|
|
609 |
$data['response']=$this->checkout_model->getCheckoutDetails($this->input->get(),$this->input->post(),$paymentconfig);
|
|
|
610 |
if(isset($data['response']['response']['hdfc_recharge_response'][0]->response) && !empty($data['response']['response']['hdfc_recharge_response'][0]->response)){
|
|
|
611 |
$redirectUrl = $data['response']['response']['hdfc_recharge_response'][0]->response->redirectUrl;
|
|
|
612 |
redirect($redirectUrl);
|
|
|
613 |
}
|
|
|
614 |
else{
|
|
|
615 |
redirect(base_url());
|
|
|
616 |
}
|
|
|
617 |
}else{
|
|
|
618 |
redirect(base_url());
|
|
|
619 |
}
|
|
|
620 |
}
|
| 10582 |
lgm |
621 |
|
|
|
622 |
|
|
|
623 |
}
|
|
|
624 |
|
|
|
625 |
/* End of file welcome.php */
|
| 11550 |
anikendra |
626 |
/* Location: ./application/controllers/welcome.php */
|