<?php 







class Paymentneipay extends Payment {







	function __construct(&$locator) {







		$this->session   =& $locator->get('session');



		$this->address  =& $locator->get('address');



		$this->cart     =& $locator->get('cart');



		$this->config   =& $locator->get('config');



		$this->currency =& $locator->get('currency');



		$this->customer =& $locator->get('customer');



		$this->database =& $locator->get('database');



		$this->language =& $locator->get('language');



		$this->mail     =& $locator->create('mail');



		$this->order    =& $locator->get('order');



		$this->request  =& $locator->get('request');



		$this->session  =& $locator->get('session');



		$this->shipping =& $locator->get('shipping');



		$this->tax      =& $locator->get('tax');



		$this->url      =& $locator->get('url');	 



		$this->language->load('extension/payment/neipay.php');



  	}



	function getTitle() {



		return $this->language->get('text_neipay_title');



  	}







  	function getMethod() {



  //			ini_set("display_errors", "On");



		if ($this->config->get('neipay_status')) {



      		if (!$this->config->get('neipay_geo_zone_id')) {



        		$status = true;



      		} elseif ($this->database->getRows("select * from zone_to_geo_zone where geo_zone_id = '" . (int)$this->config->get('neipay_geo_zone_id') . "' and country_id = '" . (int)$this->address->getCountryId($this->session->get('payment_address_id')) . "' and (zone_id = '" . (int)$this->address->getZoneId($this->session->get('payment_address_id')) . "' or zone_id = '0')")) {



      		  	$status = true;



      		} else {



     	  		$status = false;



			}	



      	} else {



			$status = false;



		}



		



	$customer_sql="select customer_id,current_points,country_id from customer where customer_id='?'";



        $customer_row=$this->database->getRow($this->database->parse($customer_sql, (int)$this->customer->getId()));  



        $shipping_address=$this->address->get($this->session->get('shipping_address_id'));



        				



		$method_data = array();







		if ($status) {  



	         $description=$this->database->getRow("select extension_id from extension where filename='neipay.php'");  



			   $extension_description=$this->database->getRow("select description from extension_description where extension_id='".$description['extension_id']."'");  



	      		$method_data = array( 



	        		'id'         => 'neipay',



	        		'title'      => $this->language->get('text_neipay_title'),



					'sort_order' => $this->config->get('neipay_sort_order'),				



					'desc'       =>$extension_description['description']



	      		);



    	}



    	return $method_data;



  	}







  	function getActionUrl() {



		return 'https://www.beststoreitems.com/index.php?controller=neipay';



	}







  	function fields() {	



		



  	}







	function payment_bridge()



	{



			$this->order->load($this->request->get('reference', 'get'));	



			$this->order->process();	



	}







	function callback() {



  	}







}







?>