403Webshell
Server IP : 208.122.213.31  /  Your IP : 216.73.216.185
Web Server : Apache
System : Linux msd6191.mjhst.com 4.18.0-553.137.1.el8_10.x86_64 #1 SMP Wed Jun 24 11:40:24 UTC 2026 x86_64
User : WHMCS_MIA_382 ( 1001)
PHP Version : 7.4.33
Disable Function : NONE
MySQL : ON  |  cURL : ON  |  WGET : ON  |  Perl : ON  |  Python : OFF  |  Sudo : ON  |  Pkexec : ON
Directory :  /home/httpd/html/baberankings.com.bak/photorater-old/

Upload File :
current_dir [ Writeable ] document_root [ Writeable ]

 

Command :


[ Back ]     

Current File : /home/httpd/html/baberankings.com.bak/photorater-old/paypal_ipn.php
<?php

// class that works with PayPal Instant Payment Notification. It takes what was
// sent from PayPal and sends an indentical response back to PayPal, then waits
// for verification from PayPal
class paypal_ipn
{
	var $paypal_post_vars;
	var $paypal_response;
	var $paypal_amount;
	var $paypal_sellerusername;

	var $timeout;

	// error logging info
	var $error_log_file;
	var $error_email;

	function paypal_ipn($paypal_post_vars)
	{
		$this->paypal_post_vars = $paypal_post_vars;

		$this->timeout = 120;
	}

	// sends response back to paypal
	function send_response()
	{
		$fp = @fsockopen( "www.paypal.com", 80, $errno, $errstr, 120 ); 

		if( !$fp )
		{ 
			$this->error_out("PHP fsockopen() error: " . $errstr);
		}

		else 
		{
			// put all POST variables received from Paypal back into a URL encoded string
			foreach($this->paypal_post_vars AS $key => $value)
			{
				// if magic quotes gpc is on, PHP added slashes to the values so we need
				// to strip them before we send the data back to Paypal.
				if( @get_magic_quotes_gpc() )
				{
					$value = stripslashes($value);
				}

				// make an array of URL encoded values
				$values[] = "$key" . "=" . urlencode($value);
			}

			// join the values together into one url encoded string
			$response = @implode("&", $values);

			// add paypal cmd variable
			$response .= "&cmd=_notify-validate";

			fputs( $fp, "POST /cgi-bin/webscr HTTP/1.0\r\n" ); 
			fputs( $fp, "Host: https://www.paypal.com\r\n" ); 
			fputs( $fp, "User-Agent: ".$GLOBALS['HTTP_USER_AGENT'] ."\r\n" ); 
			fputs( $fp, "Accept: */*\r\n" ); 
			fputs( $fp, "Accept: image/gif\r\n" ); 
			fputs( $fp, "Accept: image/x-xbitmap\r\n" ); 
			fputs( $fp, "Accept: image/jpeg\r\n" ); 
			fputs( $fp, "Content-type: application/x-www-form-urlencoded\r\n" ); 
			fputs( $fp, "Content-length: " . strlen($response) . "\r\n\n" ); 

			// send url encoded string of data
			fputs( $fp, "$response\n\r" ); 
			fputs( $fp, "\r\n" );

			$this->send_time = time();
			$this->paypal_response = ""; 

			// get response from paypal
			while( !feof( $fp ) ) 
			{ 
				$this->paypal_response .= fgets( $fp, 1024 ); 

				// waited too long?
				if( $this->send_time < time() - $this->timeout )
				{
					$this->error_out("Timed out waiting for a response from PayPal. ($this->timeout seconds)");
				}

			} // end while

			fclose( $fp );

		} // end else

	} // end function send_response()

	// returns true if paypal says the order is good, false if not
	function is_verified()
	{
		if( ereg("VERIFIED", $this->paypal_response) )
		{
			return true;
		}
		else
		{
			return false;
		}

	} // end function is_verified

	// returns the paypal payment status
	function get_payment_status()
	{
		$this->paypal_amount = $this->paypal_post_vars['amount3'];
		$this->paypal_sellerusername = $this->paypal_post_vars['custom'];
		//return $this->paypal_post_vars['payment_status']; // all transaction
		return $this->paypal_post_vars['txn_type']; //Subscription
	}

	// writes error to logfile, exits script
	function error_out($message)
	{

		$date = date("D M j G:i:s T Y", time());

		// add on the data we sent:
		$message .= "\n\nThe following input was received from (and sent back to) PayPal:\n\n";

		@reset($this->paypal_post_vars);
		while( @list($key,$value) = @each($this->paypal_post_vars) )
		{
			$message .= $key . ':' . " \t$value\n";
		}

		// log to file?
		if( $this->error_log_file )
		{
			@fopen($this->error_log_file, 'a');
			$message = "$date\n\n" . $message . "\n\n";
			@fputs($fp, $message);
			@fclose($fp);
		}

		// email errors?
		if( $this->error_email )
		{
			mail($this->error_email, "[$date] paypay_ipn error", $message);
		}

		exit;

	} // end function error_out

} // end class paypal_ipn

?>

Youez - 2016 - github.com/yon3zu
LinuXploit