Subversion Repositories SmartDukaan

Rev

Rev 20622 | Rev 20877 | Go to most recent revision | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 20622 Rev 20862
Line 144... Line 144...
144
					$data['skipcaptcha'] = 1;
144
					$data['skipcaptcha'] = 1;
145
				}
145
				}
146
			}
146
			}
147
			$addressId = $this->session->userdata('addressId');
147
			$addressId = $this->session->userdata('addressId');
148
			$_GET['addressid'] = $addressId;
148
			$_GET['addressid'] = $addressId;
-
 
149
			
149
			$this->lessphp->object()->ccompile('assets/css/shipping.less','assets/css/shipping.css');
150
			$this->lessphp->object()->ccompile('assets/css/shipping.less','assets/css/shipping.css');
150
      		$data['stylesheet'] = 'shipping.css';
151
      		$data['stylesheet'] = 'shipping.css';
151
      		$data['title'] = 'Saholic';
152
      		$data['title'] = 'Saholic';
152
			$data['response']=$this->checkout_model->getCheckoutDetails($this->input->get(),'',$paymentconfig);
153
			$data['response']=$this->checkout_model->getCheckoutDetails($this->input->get(),'',$paymentconfig);
153
			if(isset($data['response']['response']['payment_process1'])){
154
			if(isset($data['response']['response']['payment_process1'])){
154
				$result = json_decode($data['response']['response']['payment_process1'][0]);
155
				$result = json_decode($data['response']['response']['payment_process1'][0]);
155
				$totalAmount = $result->results->totalAmount;
-
 
156
				if(isset($result->results->isTotalAmountZero)){
156
				if(isset($_GET['walletUsed'])) {
157
					$isTotalAmountZero = $result->results->isTotalAmountZero;
157
					$walletUsed = float($_GET['walletUsed']);
158
				}
158
				}
159
				$totalAmount = number_format((float)$totalAmount,0,'.','');
-
 
160
				$captcha = $this->captcha_model->generateCaptcha();
159
				$result->results->totalAmount -= $walletUsed;
161
				$this->session->set_userdata('captcha',$captcha['word']);
160
				$this->session->set_userdata('walletUsed',$walletUsed);
162
				$data['captcha'] = $captcha;
-
 
163
				// if($totalAmount == 0 && isset($isTotalAmountZero) && $isTotalAmountZero == 1){
-
 
164
				// 	$captcha = $this->captcha_model->generateCaptcha();
-
 
165
				// 	$this->session->set_userdata('captcha',$captcha['word']);
-
 
166
				// 	$this->session->set_userdata('captchaDisplay',$isTotalAmountZero);
-
 
167
				// 	$data['captcha'] = $captcha;
-
 
168
				// }
-
 
169
				$this->layout->view('checkout/checkout_view',$data);
161
				$this->layout->view('checkout/checkout_view',$data);
170
			}
162
			}
171
			else{
163
			else{
172
				redirect(base_url()."cart");
164
				redirect(base_url()."cart");
173
			}
165
			}
Line 192... Line 184...
192
				elseif(isset($authorized['isLoggedIn']) && empty($authorized['isLoggedIn'])) {
184
				elseif(isset($authorized['isLoggedIn']) && empty($authorized['isLoggedIn'])) {
193
					$_POST['isLoggedIn'] = 'false';
185
					$_POST['isLoggedIn'] = 'false';
194
				}
186
				}
195
			}
187
			}
196
			$addressId = $this->session->userdata('addressId');
188
			$addressId = $this->session->userdata('addressId');
-
 
189
			$walletUsed = $this->session->userdata('walletUsed');
197
			$_POST['addressid'] = $addressId;
190
			$_POST['addressid'] = $addressId;
-
 
191
			$_POST['walletUsed'] = $walletUsed;
198
			$_POST['payment_option'] = $_POST['payoption'];
192
			$_POST['payment_option'] = $_POST['payoption'];
199
			$data['response']=$this->checkout_model->getCheckoutDetails($this->input->get(),$this->input->post(),$paymentconfig);
193
			$data['response']=$this->checkout_model->getCheckoutDetails($this->input->get(),$this->input->post(),$paymentconfig);
200
			error_log('[USER] ' .print_r($authorized,1),3,'/tmp/payments.log');
194
			error_log('[USER] ' .print_r($authorized,1),3,'/tmp/payments.log');
201
			error_log('[RESPONSE] '. print_r($data['response']['response'],1),3,'/tmp/payments.log');
195
			error_log('[RESPONSE] '. print_r($data['response']['response'],1),3,'/tmp/payments.log');
202
			if(isset($data['response']['response']['payment_submit'][0]) && !empty($data['response']['response']['payment_submit'][0])) {
196
			if(isset($data['response']['response']['payment_submit'][0]) && !empty($data['response']['response']['payment_submit'][0])) {