| Line 199... |
Line 199... |
| 199 |
$this->session->set_userdata('userId',$data['response']['response']['recharge_confirmation'][0]->userId);
|
199 |
$this->session->set_userdata('userId',$data['response']['response']['recharge_confirmation'][0]->userId);
|
| 200 |
$this->layout->view('recharge/recharge_view',$data);
|
200 |
$this->layout->view('recharge/recharge_view',$data);
|
| 201 |
}else{
|
201 |
}else{
|
| 202 |
redirect(base_url().'recharge');
|
202 |
redirect(base_url().'recharge');
|
| 203 |
}
|
203 |
}
|
| 204 |
}elseif(strcmp($captcha,$_POST['captcha_response_field']) == 0){
|
204 |
} else {
|
| 205 |
if(isset($userId) && !empty($userId)){
|
205 |
if(isset($userId) && !empty($userId)){
|
| 206 |
if(isset($authorized) && !empty($authorized)){
|
206 |
if(isset($authorized) && !empty($authorized)){
|
| 207 |
if($authorized['isLoggedIn'] == 1){
|
207 |
if($authorized['isLoggedIn'] == 1){
|
| 208 |
$_POST['userId'] = $authorized['Id'];
|
208 |
$_POST['userId'] = $authorized['Id'];
|
| 209 |
$_POST['rechargeUserId'] = $userId;
|
209 |
$_POST['rechargeUserId'] = $userId;
|
| 210 |
$_POST['isLoggedIn'] = 'true';
|
210 |
$_POST['isLoggedIn'] = 'true';
|
| 211 |
}
|
211 |
}
|
| 212 |
elseif(isset($authorized['isLoggedIn']) && empty($authorized['isLoggedIn'])) {
|
212 |
elseif(isset($authorized['isLoggedIn']) && empty($authorized['isLoggedIn'])) {
|
| 213 |
$_POST['userId'] = $authorized['Id'];
|
213 |
$_POST['userId'] = $authorized['Id'];
|
| - |
|
214 |
$_POST['rechargeUserId'] = $userId;
|
| - |
|
215 |
$_POST['isLoggedIn'] = 'false';
|
| - |
|
216 |
}
|
| - |
|
217 |
}else{
|
| - |
|
218 |
$_POST['userId'] = -1;
|
| 214 |
$_POST['rechargeUserId'] = $userId;
|
219 |
$_POST['rechargeUserId'] = $userId;
|
| 215 |
$_POST['isLoggedIn'] = 'false';
|
220 |
$_POST['isLoggedIn'] = 'false';
|
| 216 |
}
|
221 |
}
|
| 217 |
}else{
|
- |
|
| 218 |
$_POST['userId'] = -1;
|
- |
|
| 219 |
$_POST['rechargeUserId'] = $userId;
|
- |
|
| 220 |
$_POST['isLoggedIn'] = 'false';
|
- |
|
| 221 |
}
|
- |
|
| 222 |
foreach (getallheaders() as $name => $value) {
|
222 |
foreach (getallheaders() as $name => $value) {
|
| 223 |
if($name == "X-FORWARDED-FOR" || $name == 'X-Forwarded-For'){
|
223 |
if($name == "X-FORWARDED-FOR" || $name == 'X-Forwarded-For'){
|
| 224 |
$ips = explode(',',$value);
|
224 |
$ips = explode(',',$value);
|
| 225 |
if(sizeof($ips)>1){
|
225 |
if(sizeof($ips)>1){
|
| 226 |
$ipAddress = trim($ips[sizeof($ips)-1]);
|
226 |
$ipAddress = trim($ips[sizeof($ips)-1]);
|
| 227 |
}else{
|
227 |
}else{
|
| 228 |
$ipAddress = $value;
|
228 |
$ipAddress = $value;
|
| - |
|
229 |
}
|
| 229 |
}
|
230 |
}
|
| 230 |
}
|
- |
|
| 231 |
}
|
231 |
}
|
| 232 |
$_POST['ipAddress'] = isset($ipAddress)?$ipAddress:$_SERVER['REMOTE_ADDR'];
|
232 |
$_POST['ipAddress'] = isset($ipAddress)?$ipAddress:$_SERVER['REMOTE_ADDR'];
|
| 233 |
error_log("[ipAddress] ".$_POST['ipAddress']);
|
233 |
error_log("[ipAddress] ".$_POST['ipAddress']);
|
| 234 |
if($_POST['ipAddress']=='192.168.255.1'){
|
234 |
if($_POST['ipAddress']=='192.168.255.1'){
|
| 235 |
error_log("[headers] ".print_r(getallheaders(),1));
|
235 |
error_log("[headers] ".print_r(getallheaders(),1));
|
| 236 |
}
|
236 |
}
|
| 237 |
$data = array();
|
237 |
$data = array();
|
| 238 |
$data['response']=$this->recharge_model->getList($this->input->get(),$this->input->post(),$this->config->item('rechargeConfirm'));
|
238 |
$data['response']=$this->recharge_model->getList($this->input->get(),$this->input->post(),$this->config->item('rechargeConfirm'));
|
| 239 |
if(isset($data['response']['response']['recharge_confirm'][0]->response) && !empty($data['response']['response']['recharge_confirm'][0]->response)){
|
239 |
if(isset($data['response']['response']['recharge_confirm'][0]->response) && !empty($data['response']['response']['recharge_confirm'][0]->response)){
|
| 240 |
$redirectUrl = $data['response']['response']['recharge_confirm'][0]->response->redirectUrl;
|
240 |
$redirectUrl = $data['response']['response']['recharge_confirm'][0]->response->redirectUrl;
|
| 241 |
if(strpos($redirectUrl, 'zero-pay-recharge') !== false){
|
241 |
if(strpos($redirectUrl, 'zero-pay-recharge') !== false){
|
| 242 |
$url = $this->config->item('curl_base_url').$redirectUrl;
|
242 |
$url = $this->config->item('curl_base_url').$redirectUrl;
|
| 243 |
$params = array();
|
243 |
$params = array();
|
| 244 |
$this->mcurl->add_call('zero_pay','get',$url,$params);
|
244 |
$this->mcurl->add_call('zero_pay','get',$url,$params);
|
| 245 |
$response = $this->mcurl->execute($url);
|
245 |
$response = $this->mcurl->execute($url);
|
| 246 |
$data['response'] = $response['zero_pay']['response'];
|
246 |
$data['response'] = $response['zero_pay']['response'];
|
| 247 |
$response = $this->magento_model->payment_submit($data);
|
247 |
$response = $this->magento_model->payment_submit($data);
|
| 248 |
$redirectUrl = $response[0]->response->redirectUrl;
|
248 |
$redirectUrl = $response[0]->response->redirectUrl;
|
| 249 |
$redirectUrl = explode('?', $redirectUrl);
|
249 |
$redirectUrl = explode('?', $redirectUrl);
|
| 250 |
redirect(base_url().'recharge-result?'.$redirectUrl[1]);
|
250 |
redirect(base_url().'recharge-result?'.$redirectUrl[1]);
|
| 251 |
}else{
|
251 |
}else{
|
| 252 |
redirect(base_url().$redirectUrl);
|
252 |
redirect(base_url().$redirectUrl);
|
| - |
|
253 |
}
|
| - |
|
254 |
} else{
|
| - |
|
255 |
redirect(base_url().'confirm');
|
| 253 |
}
|
256 |
}
|
| 254 |
}
|
257 |
}
|
| 255 |
else{
|
258 |
else {
|
| 256 |
redirect(base_url().'confirm');
|
259 |
redirect(base_url().'recharge');
|
| 257 |
}
|
260 |
}
|
| 258 |
}
|
- |
|
| 259 |
else{
|
- |
|
| 260 |
|
- |
|
| 261 |
redirect(base_url().'recharge');
|
- |
|
| 262 |
}
|
- |
|
| 263 |
}else{
|
- |
|
| 264 |
redirect(base_url().'recharge');
|
- |
|
| 265 |
}
|
261 |
}
|
| 266 |
}
|
262 |
}
|
| 267 |
elseif(isset($_POST['submit']) && (($_POST['submit'] == 'Confirm') || ($_POST['submit'] == 'Recharge Now')) && (!isset($_POST['captcha_response_field']) || empty($_POST['captcha_response_field']))){
|
263 |
elseif(isset($_POST['submit']) && (($_POST['submit'] == 'Confirm') || ($_POST['submit'] == 'Recharge Now')) && (!isset($_POST['captcha_response_field']) || empty($_POST['captcha_response_field']))){
|
| 268 |
$userId = $this->session->userdata('userId');
|
264 |
$userId = $this->session->userdata('userId');
|
| 269 |
if(isset($userId) && !empty($userId)){
|
265 |
if(isset($userId) && !empty($userId)){
|
| Line 735... |
Line 731... |
| 735 |
|
731 |
|
| 736 |
public function getstatus() {
|
732 |
public function getstatus() {
|
| 737 |
if(isset($_GET['rechargeOrderId']) && !empty($_GET['rechargeOrderId'])){
|
733 |
if(isset($_GET['rechargeOrderId']) && !empty($_GET['rechargeOrderId'])){
|
| 738 |
//$_GET['rechargeOrderId'] = $_GET['rechargeOrderId'];
|
734 |
//$_GET['rechargeOrderId'] = $_GET['rechargeOrderId'];
|
| 739 |
// $this->lessphp->object()->ccompile('assets/css/recharge.less','assets/css/recharge.css');
|
735 |
// $this->lessphp->object()->ccompile('assets/css/recharge.less','assets/css/recharge.css');
|
| 740 |
$rechargeId = $_GET['id'];
|
736 |
#$rechargeId = $_GET['id'];
|
| 741 |
$isFinal = isset($_GET['isFinal'])?$_GET['isFinal']:false;
|
737 |
$isFinal = isset($_GET['isFinal'])?$_GET['isFinal']:false;
|
| 742 |
// $data['stylesheet'] = 'recharge.css';
|
738 |
// $data['stylesheet'] = 'recharge.css';
|
| 743 |
$data['response']=$this->recharge_model->getList($this->input->get(),$this->input->post(),$this->config->item('rechargeStatus'));
|
739 |
$data['response']=$this->recharge_model->getList($this->input->get(),$this->input->post(),$this->config->item('rechargeStatus'));
|
| 744 |
if(!empty($data['response']['response'])){
|
740 |
if(!empty($data['response']['response'])){
|
| 745 |
print_r($data['response']['response']['recharge_status'][0]->response->rechargeStatus);die;
|
741 |
print_r($data['response']['response']['recharge_status'][0]->response->rechargeStatus);die;
|