| Line 412... |
Line 412... |
| 412 |
$_POST['rechargeUserId'] = $userId;
|
412 |
$_POST['rechargeUserId'] = $userId;
|
| 413 |
}
|
413 |
}
|
| 414 |
$_POST['payment_option'] = $_POST['payoption'];
|
414 |
$_POST['payment_option'] = $_POST['payoption'];
|
| 415 |
$data = array();
|
415 |
$data = array();
|
| 416 |
$data['response']=$this->recharge_model->getList($this->input->get(),$this->input->post(),$rechargeConfig);
|
416 |
$data['response']=$this->recharge_model->getList($this->input->get(),$this->input->post(),$rechargeConfig);
|
| - |
|
417 |
error_log(print_r($data['response']['response'],1));
|
| 417 |
if(isset($data['response']['response']['recharge_paymentSubmit'][0]) && !empty($data['response']['response']['recharge_paymentSubmit'][0])){
|
418 |
if(isset($data['response']['response']['recharge_paymentSubmit'][0]) && !empty($data['response']['response']['recharge_paymentSubmit'][0])){
|
| 418 |
$paymentSubmit = $data['response']['response']['recharge_paymentSubmit'][0];
|
419 |
$paymentSubmit = $data['response']['response']['recharge_paymentSubmit'][0];
|
| 419 |
if(isset($paymentSubmit->response->isPaymentRedirect) && $paymentSubmit->response->isPaymentRedirect == 1){
|
420 |
if(isset($paymentSubmit->response->isPaymentRedirect) && $paymentSubmit->response->isPaymentRedirect == 1){
|
| 420 |
$image = './assets/images/loading.gif';
|
421 |
$image = './assets/images/loading.gif';
|
| 421 |
$location = $paymentSubmit->response->redirectUrl;
|
422 |
$location = $paymentSubmit->response->redirectUrl;
|
| Line 428... |
Line 429... |
| 428 |
<div align="center" class="img">
|
429 |
<div align="center" class="img">
|
| 429 |
<img title="loading" alt="loading" src="'.$image.'">
|
430 |
<img title="loading" alt="loading" src="'.$image.'">
|
| 430 |
</div>
|
431 |
</div>
|
| 431 |
</body>
|
432 |
</body>
|
| 432 |
</html>';
|
433 |
</html>';
|
| 433 |
}elseif(isset($paymentSubmit->response->redirectUrl) && strpos($paymentSubmit->response->redirectUrl, 'ebs-pay') !== false){
|
434 |
} elseif(isset($paymentSubmit->response->redirectUrl) && strpos($paymentSubmit->response->redirectUrl, 'ebs-pay') !== false) {
|
| 434 |
$url = $this->config->item('curl_base_url').$paymentSubmit->response->redirectUrl;
|
435 |
$url = $this->config->item('curl_base_url').$paymentSubmit->response->redirectUrl;
|
| 435 |
//echo $url;
|
436 |
//echo $url;
|
| 436 |
$params = array();
|
437 |
$params = array();
|
| 437 |
$authorized = $this->session->userdata('authorized');
|
438 |
$authorized = $this->session->userdata('authorized');
|
| 438 |
if(isset($authorized) && !empty($authorized)){
|
439 |
if(isset($authorized) && !empty($authorized)){
|
| Line 501... |
Line 502... |
| 501 |
</body>
|
502 |
</body>
|
| 502 |
</html>';
|
503 |
</html>';
|
| 503 |
}else{
|
504 |
}else{
|
| 504 |
redirect(base_url().'payment');
|
505 |
redirect(base_url().'payment');
|
| 505 |
}
|
506 |
}
|
| - |
|
507 |
} //Handle Payu here
|
| - |
|
508 |
elseif(isset($paymentSubmit->response->redirectUrl) && strpos($paymentSubmit->response->redirectUrl, 'payu-pay') !== false) {
|
| - |
|
509 |
$url = $this->config->item('curl_base_url').$paymentSubmit->response->redirectUrl;
|
| - |
|
510 |
//echo $url;
|
| - |
|
511 |
$params = array();
|
| - |
|
512 |
$authorized = $this->session->userdata('authorized');
|
| - |
|
513 |
if(isset($authorized) && !empty($authorized)){
|
| - |
|
514 |
$params['userId'] = $authorized['Id'];
|
| - |
|
515 |
if($authorized['isLoggedIn'] == 1){
|
| - |
|
516 |
$params['isLoggedIn'] = 'true';
|
| - |
|
517 |
}
|
| - |
|
518 |
elseif(isset($authorized['isLoggedIn']) && empty($authorized['isLoggedIn'])) {
|
| - |
|
519 |
$params['isLoggedIn'] = 'false';
|
| - |
|
520 |
}
|
| - |
|
521 |
}
|
| - |
|
522 |
$this->mcurl->add_call('payu','get',$url,$params);
|
| - |
|
523 |
$response = $this->mcurl->execute($url);
|
| - |
|
524 |
error_log("payu response".print_r($response,1));
|
| - |
|
525 |
$data['response'] = $response['payu']['response'];
|
| - |
|
526 |
$response = $this->magento_model->payment_submit($data);
|
| - |
|
527 |
if(isset($response) && !empty($response)){
|
| - |
|
528 |
$payu = $response[0]->response;
|
| - |
|
529 |
$image = './assets/images/loading.gif';
|
| - |
|
530 |
// $return_url = base_url().'ebs-pay-processing/?DR={DR}';
|
| - |
|
531 |
$ci = get_instance();
|
| - |
|
532 |
}?>
|
| - |
|
533 |
<html>
|
| - |
|
534 |
<head>
|
| - |
|
535 |
<meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=no">
|
| - |
|
536 |
<title>m.saholic.com: Redirecting to EBS Payment Page</title>
|
| - |
|
537 |
</head>
|
| - |
|
538 |
<body>
|
| - |
|
539 |
<div style="text-align:center; margin-top:200px;">Please wait while we redirect you to the Payment Gateway.</div>
|
| - |
|
540 |
<div align="center" class="img">
|
| - |
|
541 |
<img title="loading" alt="loading" src="'.$image.'">
|
| - |
|
542 |
</div>
|
| - |
|
543 |
<div style="display:none">
|
| - |
|
544 |
<form action="<?php echo $payu->postActionUrl; ?>" method="post" id="payuForm">
|
| - |
|
545 |
<input type="hidden" name="key" value="<?php echo $payu->key; ?>" />
|
| - |
|
546 |
<input type="hidden" name="hash" value="<?php echo $payu->hash ?>"/>
|
| - |
|
547 |
<input type="hidden" name="txnid" value="<?php echo $payu->txnid ?>" />
|
| - |
|
548 |
<input name="amount" value="<?php echo $payu->amount; ?>" />
|
| - |
|
549 |
<input name="firstname" id="firstname" value="<?php echo $payu->firstname;?>" />
|
| - |
|
550 |
<input name="email" id="email" value="<?php echo $payu->email; ?>" />
|
| - |
|
551 |
<input name="phone" value="<?php echo $payu->phone; ?>" />
|
| - |
|
552 |
<input name="productinfo" value="<?php echo $payu->productinfo; ?>" />
|
| - |
|
553 |
<input name="surl" value="<?php echo base_url().$payu->surl; ?>" />
|
| - |
|
554 |
<input name="furl" value="<?php echo base_url().$payu->furl; ?>" />
|
| - |
|
555 |
<input name="bankcode" value="<?php echo $payu->bankcode; ?>" />
|
| - |
|
556 |
<input name="pg" value="<?php echo $payu->pg; ?>" />
|
| - |
|
557 |
<input name="curl" value="<?php echo base_url().$payu->curl; ?>" />
|
| - |
|
558 |
<input type="submit" value="Submit" />
|
| - |
|
559 |
</form>
|
| - |
|
560 |
</div>
|
| - |
|
561 |
<script type="text/javascript">
|
| - |
|
562 |
document.getElementById("payuForm").submit();
|
| - |
|
563 |
</script>
|
| - |
|
564 |
</body>
|
| - |
|
565 |
</html>
|
| - |
|
566 |
<?php
|
| - |
|
567 |
}else{
|
| - |
|
568 |
redirect(base_url().'payment');
|
| - |
|
569 |
}
|
| 506 |
}
|
570 |
}
|
| 507 |
else{
|
571 |
else{
|
| 508 |
redirect(base_url().'recharge');
|
- |
|
| 509 |
}
|
- |
|
| 510 |
}else{
|
- |
|
| 511 |
redirect(base_url().'recharge');
|
572 |
redirect(base_url().'recharge');
|
| 512 |
}
|
573 |
}
|
| 513 |
}
|
574 |
}
|
| 514 |
|
575 |
|
| 515 |
}
|
576 |
}
|