Renaming Namespaces and Organizing Classes

- Updated OpenId classes to be in API namespace
- Updated PP Naming Convention to PayPal Naming Convention
- FormatConverter Class got its own namespace
- Handlers are grouped in Handler namespace
- Samples and Tests Updated Accordingly
This commit is contained in:
japatel
2014-12-17 17:15:01 -06:00
parent 20038e7525
commit 29a8d8f50d
246 changed files with 1068 additions and 1057 deletions

View File

@@ -1,24 +1,24 @@
<?php
namespace PayPal\Transport;
use PayPal\Core\PPLoggingManager;
use PayPal\Core\PPHttpConfig;
use PayPal\Core\PPHttpConnection;
use PayPal\Core\PayPalLoggingManager;
use PayPal\Core\PayPalHttpConfig;
use PayPal\Core\PayPalHttpConnection;
use PayPal\Rest\ApiContext;
/**
* Class PPRestCall
* Class PayPalRestCall
*
* @package PayPal\Transport
*/
class PPRestCall
class PayPalRestCall
{
/**
* Paypal Logger
*
* @var PPLoggingManager logger interface
* @var PayPalLoggingManager logger interface
*/
private $logger;
@@ -38,7 +38,7 @@ class PPRestCall
public function __construct(ApiContext $apiContext)
{
$this->apiContext = $apiContext;
$this->logger = PPLoggingManager::getInstance(__CLASS__);
$this->logger = PayPalLoggingManager::getInstance(__CLASS__);
}
/**
@@ -48,13 +48,13 @@ class PPRestCall
* @param string $data Request payload
* @param array $headers HTTP headers
* @return mixed
* @throws \PayPal\Exception\PPConnectionException
* @throws \PayPal\Exception\PayPalConnectionException
*/
public function execute($handlers = array(), $path, $method, $data = '', $headers = array())
{
$config = $this->apiContext->getConfig();
$httpConfig = new PPHttpConfig(null, $method);
$httpConfig = new PayPalHttpConfig(null, $method);
$headers = $headers ? $headers : array();
$httpConfig->setHeaders($headers +
array(
@@ -62,7 +62,7 @@ class PPRestCall
)
);
/** @var \Paypal\Handler\IPPHandler $handler */
/** @var \Paypal\Handler\IPayPalHandler $handler */
foreach ($handlers as $handler) {
if (!is_object($handler)) {
$fullHandler = "\\" . (string)$handler;
@@ -70,7 +70,7 @@ class PPRestCall
}
$handler->handle($httpConfig, $data, array('path' => $path, 'apiContext' => $this->apiContext));
}
$connection = new PPHttpConnection($httpConfig, $config);
$connection = new PayPalHttpConnection($httpConfig, $config);
$response = $connection->execute($data);
return $response;