forked from LiveCarta/PayPal-PHP-SDK
Removing Dependency from SDK Core Project
- Copied files required for Rest API SDK - Removed PPApiContext and directly connected APIContext with PPConfigManager - Removed duplicate data storage of configuration and credentials. - Code Style Fixes - Remove build.xml file as it is not required anymore - Updated the samples - Updated the documentations
This commit is contained in:
23
lib/PayPal/Exception/PPConfigurationException.php
Normal file
23
lib/PayPal/Exception/PPConfigurationException.php
Normal file
@@ -0,0 +1,23 @@
|
||||
<?php
|
||||
|
||||
namespace PayPal\Exception;
|
||||
|
||||
/**
|
||||
* Class PPConfigurationException
|
||||
*
|
||||
* @package PayPal\Exception
|
||||
*/
|
||||
class PPConfigurationException extends \Exception
|
||||
{
|
||||
|
||||
/**
|
||||
* Default Constructor
|
||||
*
|
||||
* @param string|null $message
|
||||
* @param int $code
|
||||
*/
|
||||
public function __construct($message = null, $code = 0)
|
||||
{
|
||||
parent::__construct($message, $code);
|
||||
}
|
||||
}
|
||||
68
lib/PayPal/Exception/PPConnectionException.php
Normal file
68
lib/PayPal/Exception/PPConnectionException.php
Normal file
@@ -0,0 +1,68 @@
|
||||
<?php
|
||||
|
||||
namespace PayPal\Exception;
|
||||
|
||||
/**
|
||||
* Class PPConnectionException
|
||||
*
|
||||
* @package PayPal\Exception
|
||||
*/
|
||||
class PPConnectionException extends \Exception
|
||||
{
|
||||
/**
|
||||
* The url that was being connected to when the exception occured
|
||||
*
|
||||
* @var string
|
||||
*/
|
||||
private $url;
|
||||
|
||||
/**
|
||||
* Any response data that was returned by the server
|
||||
*
|
||||
* @var string
|
||||
*/
|
||||
private $data;
|
||||
|
||||
/**
|
||||
* Default Constructor
|
||||
*
|
||||
* @param string $url
|
||||
* @param string $message
|
||||
* @param int $code
|
||||
*/
|
||||
public function __construct($url, $message, $code = 0)
|
||||
{
|
||||
parent::__construct($message, $code);
|
||||
$this->url = $url;
|
||||
}
|
||||
|
||||
/**
|
||||
* Sets Data
|
||||
*
|
||||
* @param $data
|
||||
*/
|
||||
public function setData($data)
|
||||
{
|
||||
$this->data = $data;
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets Data
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
public function getData()
|
||||
{
|
||||
return $this->data;
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets Url
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
public function getUrl()
|
||||
{
|
||||
return $this->url;
|
||||
}
|
||||
}
|
||||
36
lib/PayPal/Exception/PPInvalidCredentialException.php
Normal file
36
lib/PayPal/Exception/PPInvalidCredentialException.php
Normal file
@@ -0,0 +1,36 @@
|
||||
<?php
|
||||
|
||||
namespace PayPal\Exception;
|
||||
|
||||
/**
|
||||
* Class PPInvalidCredentialException
|
||||
*
|
||||
* @package PayPal\Exception
|
||||
*/
|
||||
class PPInvalidCredentialException extends \Exception
|
||||
{
|
||||
|
||||
/**
|
||||
* Default Constructor
|
||||
*
|
||||
* @param string|null $message
|
||||
* @param int $code
|
||||
*/
|
||||
public function __construct($message = null, $code = 0)
|
||||
{
|
||||
parent::__construct($message, $code);
|
||||
}
|
||||
|
||||
/**
|
||||
* prints error message
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
public function errorMessage()
|
||||
{
|
||||
$errorMsg = 'Error on line ' . $this->getLine() . ' in ' . $this->getFile()
|
||||
. ': <b>' . $this->getMessage() . '</b>';
|
||||
return $errorMsg;
|
||||
}
|
||||
|
||||
}
|
||||
37
lib/PayPal/Exception/PPMissingCredentialException.php
Normal file
37
lib/PayPal/Exception/PPMissingCredentialException.php
Normal file
@@ -0,0 +1,37 @@
|
||||
<?php
|
||||
|
||||
namespace PayPal\Exception;
|
||||
|
||||
/**
|
||||
* Class PPMissingCredentialException
|
||||
*
|
||||
* @package PayPal\Exception
|
||||
*/
|
||||
class PPMissingCredentialException extends \Exception
|
||||
{
|
||||
|
||||
/**
|
||||
* Default Constructor
|
||||
*
|
||||
* @param string $message
|
||||
* @param int $code
|
||||
*/
|
||||
public function __construct($message = null, $code = 0)
|
||||
{
|
||||
parent::__construct($message, $code);
|
||||
}
|
||||
|
||||
/**
|
||||
* prints error message
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
public function errorMessage()
|
||||
{
|
||||
$errorMsg = 'Error on line ' . $this->getLine() . ' in ' . $this->getFile()
|
||||
. ': <b>' . $this->getMessage() . '</b>';
|
||||
|
||||
return $errorMsg;
|
||||
}
|
||||
|
||||
}
|
||||
Reference in New Issue
Block a user