From 1401d5563d85d6e6d5947e9bda2e8bd46b6b723e Mon Sep 17 00:00:00 2001 From: Jay Patel Date: Thu, 14 Jul 2016 13:06:24 -0500 Subject: [PATCH 1/3] [PSR] Fixed library source - Using `php-cs-fixer` tool. --- lib/PayPal/Cache/AuthorizationCache.php | 14 ++++++++------ lib/PayPal/Common/PayPalModel.php | 13 ++++++++----- lib/PayPal/Common/PayPalResourceModel.php | 2 +- lib/PayPal/Common/PayPalUserAgent.php | 1 - lib/PayPal/Common/ReflectionUtil.php | 5 +++-- lib/PayPal/Converter/FormatConverter.php | 2 +- lib/PayPal/Core/PayPalConfigManager.php | 6 ------ lib/PayPal/Core/PayPalCredentialManager.php | 4 +--- lib/PayPal/Core/PayPalHttpConfig.php | 2 +- lib/PayPal/Core/PayPalHttpConnection.php | 12 +++++------- lib/PayPal/Core/PayPalLoggingManager.php | 1 - .../Exception/PayPalInvalidCredentialException.php | 1 - .../Exception/PayPalMissingCredentialException.php | 1 - lib/PayPal/Handler/OauthHandler.php | 4 ++-- lib/PayPal/Handler/RestHandler.php | 3 +-- lib/PayPal/Log/PayPalDefaultLogFactory.php | 2 +- lib/PayPal/Log/PayPalLogFactory.php | 3 +-- lib/PayPal/Log/PayPalLogger.php | 5 ++--- lib/PayPal/Security/Cipher.php | 6 +++--- lib/PayPal/Transport/PayPalRestCall.php | 2 -- lib/PayPal/Validation/ArgumentValidator.php | 2 +- lib/PayPal/Validation/JsonValidator.php | 2 +- lib/PayPal/Validation/NumericValidator.php | 1 - lib/PayPal/Validation/UrlValidator.php | 2 +- 24 files changed, 41 insertions(+), 55 deletions(-) diff --git a/lib/PayPal/Cache/AuthorizationCache.php b/lib/PayPal/Cache/AuthorizationCache.php index 46e86fdf..83910d3b 100644 --- a/lib/PayPal/Cache/AuthorizationCache.php +++ b/lib/PayPal/Cache/AuthorizationCache.php @@ -20,7 +20,9 @@ abstract class AuthorizationCache public static function pull($config = null, $clientId = null) { // Return if not enabled - if (!self::isEnabled($config)) { return null; } + if (!self::isEnabled($config)) { + return null; + } $tokens = null; $cachePath = self::cachePath($config); @@ -32,7 +34,7 @@ public static function pull($config = null, $clientId = null) if ($clientId && is_array($tokens) && array_key_exists($clientId, $tokens)) { // If client Id is found, just send in that data only return $tokens[$clientId]; - } else if ($clientId) { + } elseif ($clientId) { // If client Id is provided, but no key in persisted data found matching it. return null; } @@ -54,7 +56,9 @@ public static function pull($config = null, $clientId = null) public static function push($config = null, $clientId, $accessToken, $tokenCreateTime, $tokenExpiresIn) { // Return if not enabled - if (!self::isEnabled($config)) { return; } + if (!self::isEnabled($config)) { + return; + } $cachePath = self::cachePath($config); if (!is_dir(dirname($cachePath))) { @@ -74,7 +78,7 @@ public static function push($config = null, $clientId, $accessToken, $tokenCreat 'tokenExpiresIn' => $tokenExpiresIn ); } - if(!file_put_contents($cachePath, json_encode($tokens))) { + if (!file_put_contents($cachePath, json_encode($tokens))) { throw new \Exception("Failed to write cache"); }; } @@ -116,6 +120,4 @@ private static function getConfigValue($key, $config) $config = ($config && is_array($config)) ? $config : PayPalConfigManager::getInstance()->getConfigHashmap(); return (array_key_exists($key, $config)) ? trim($config[$key]) : null; } - - } diff --git a/lib/PayPal/Common/PayPalModel.php b/lib/PayPal/Common/PayPalModel.php index fdfaba8d..78734efa 100644 --- a/lib/PayPal/Common/PayPalModel.php +++ b/lib/PayPal/Common/PayPalModel.php @@ -1,6 +1,7 @@ $v) { if ($v instanceof PayPalModel) { $ret[$k] = $v->toArray(); - } else if (sizeof($v) <= 0 && is_array($v)) { + } elseif (sizeof($v) <= 0 && is_array($v)) { $ret[$k] = array(); - } else if (is_array($v)) { + } elseif (is_array($v)) { $ret[$k] = $this->_convertToArray($v); } else { $ret[$k] = $v; @@ -204,9 +207,9 @@ public function fromArray($arr) // If the value is an array, it means, it is an object after conversion if (is_array($v)) { // Determine the class of the object - if (($clazz = ReflectionUtil::getPropertyClass(get_class($this), $k)) != null){ + if (($clazz = ReflectionUtil::getPropertyClass(get_class($this), $k)) != null) { // If the value is an associative array, it means, its an object. Just make recursive call to it. - if (empty($v)){ + if (empty($v)) { if (ReflectionUtil::isPropertyClassArray(get_class($this), $k)) { // It means, it is an array of objects. $this->assignValue($k, array()); diff --git a/lib/PayPal/Common/PayPalResourceModel.php b/lib/PayPal/Common/PayPalResourceModel.php index 18ddb388..927a379e 100644 --- a/lib/PayPal/Common/PayPalResourceModel.php +++ b/lib/PayPal/Common/PayPalResourceModel.php @@ -115,4 +115,4 @@ public function updateAccessToken($refreshToken, $apiContext) $apiContext = $apiContext ? $apiContext : new ApiContext(self::$credential); $apiContext->getCredential()->updateAccessToken($apiContext->getConfig(), $refreshToken); } -} +} diff --git a/lib/PayPal/Common/PayPalUserAgent.php b/lib/PayPal/Common/PayPalUserAgent.php index d072b2fb..c3131ed4 100644 --- a/lib/PayPal/Common/PayPalUserAgent.php +++ b/lib/PayPal/Common/PayPalUserAgent.php @@ -21,7 +21,6 @@ class PayPalUserAgent */ public static function getValue($sdkName, $sdkVersion) { - $featureList = array( 'platform-ver=' . PHP_VERSION, 'bit=' . self::_getPHPBit(), diff --git a/lib/PayPal/Common/ReflectionUtil.php b/lib/PayPal/Common/ReflectionUtil.php index 0b92a5ca..f7b397ad 100644 --- a/lib/PayPal/Common/ReflectionUtil.php +++ b/lib/PayPal/Common/ReflectionUtil.php @@ -1,6 +1,7 @@ getDocComment(), $annots, @@ -120,7 +121,7 @@ public static function propertyAnnotations($class, $propertyName) return null; } foreach ($annots[1] as $i => $annot) { - $annotations[strtolower($annot)] = empty($annots[2][$i]) ? TRUE : rtrim($annots[2][$i], " \t\n\r)"); + $annotations[strtolower($annot)] = empty($annots[2][$i]) ? true : rtrim($annots[2][$i], " \t\n\r)"); } return $annotations; diff --git a/lib/PayPal/Converter/FormatConverter.php b/lib/PayPal/Converter/FormatConverter.php index e564742c..a237766e 100644 --- a/lib/PayPal/Converter/FormatConverter.php +++ b/lib/PayPal/Converter/FormatConverter.php @@ -53,7 +53,7 @@ public static function formatToPrice($value, $currency = null) throw new \InvalidArgumentException("value cannot have decimals for $currency currency"); } $decimals = $currencyDecimals[$currency]; - } else if (strpos($value, ".") === false) { + } elseif (strpos($value, ".") === false) { // Check if value has decimal values. If not no need to assign 2 decimals with .00 at the end $decimals = 0; } diff --git a/lib/PayPal/Core/PayPalConfigManager.php b/lib/PayPal/Core/PayPalConfigManager.php index f884df4e..a7ee1caf 100644 --- a/lib/PayPal/Core/PayPalConfigManager.php +++ b/lib/PayPal/Core/PayPalConfigManager.php @@ -95,7 +95,6 @@ public function addConfigs($configs = array()) */ public function get($searchKey) { - if (array_key_exists($searchKey, $this->configs)) { return $this->configs[$searchKey]; } else { @@ -108,7 +107,6 @@ public function get($searchKey) return $arr; } - } /** @@ -123,7 +121,6 @@ public function get($searchKey) */ public function getIniPrefix($userId = null) { - if ($userId == null) { $arr = array(); foreach ($this->configs as $key => $value) { @@ -157,7 +154,4 @@ public function __clone() { trigger_error('Clone is not allowed.', E_USER_ERROR); } - } - - diff --git a/lib/PayPal/Core/PayPalCredentialManager.php b/lib/PayPal/Core/PayPalCredentialManager.php index 77a884e4..8f1edd63 100644 --- a/lib/PayPal/Core/PayPalCredentialManager.php +++ b/lib/PayPal/Core/PayPalCredentialManager.php @@ -113,7 +113,6 @@ private function initCredential($config) $suffix++; $key = $prefix . $suffix; } - } /** @@ -146,7 +145,7 @@ public function getCredentialObject($userId = null) { if ($userId == null && array_key_exists($this->defaultAccountName, $this->credentialHashmap)) { $credObj = $this->credentialHashmap[$this->defaultAccountName]; - } else if (array_key_exists($userId, $this->credentialHashmap)) { + } elseif (array_key_exists($userId, $this->credentialHashmap)) { $credObj = $this->credentialHashmap[$userId]; } @@ -164,5 +163,4 @@ public function __clone() { trigger_error('Clone is not allowed.', E_USER_ERROR); } - } diff --git a/lib/PayPal/Core/PayPalHttpConfig.php b/lib/PayPal/Core/PayPalHttpConfig.php index 6bd4454c..8a2b2a3f 100644 --- a/lib/PayPal/Core/PayPalHttpConfig.php +++ b/lib/PayPal/Core/PayPalHttpConfig.php @@ -21,7 +21,7 @@ class PayPalHttpConfig public static $defaultCurlOptions = array( CURLOPT_SSLVERSION => 6, CURLOPT_CONNECTTIMEOUT => 10, - CURLOPT_RETURNTRANSFER => TRUE, + CURLOPT_RETURNTRANSFER => true, CURLOPT_TIMEOUT => 60, // maximum number of seconds to allow cURL functions to execute CURLOPT_USERAGENT => 'PayPal-PHP-SDK', CURLOPT_HTTPHEADER => array(), diff --git a/lib/PayPal/Core/PayPalHttpConnection.php b/lib/PayPal/Core/PayPalHttpConnection.php index ea0dffd8..7e809ec2 100644 --- a/lib/PayPal/Core/PayPalHttpConnection.php +++ b/lib/PayPal/Core/PayPalHttpConnection.php @@ -55,7 +55,6 @@ public function __construct(PayPalHttpConfig $httpConfig, array $config) */ private function getHttpHeaders() { - $ret = array(); foreach ($this->httpConfig->getHeaders() as $k => $v) { $ret[] = "$k: $v"; @@ -78,8 +77,8 @@ public function execute($data) //Initialize Curl Options $ch = curl_init($this->httpConfig->getUrl()); $options = $this->httpConfig->getCurlOptions(); - if(empty($options[CURLOPT_HTTPHEADER])) { - unset ($options[CURLOPT_HTTPHEADER]); + if (empty($options[CURLOPT_HTTPHEADER])) { + unset($options[CURLOPT_HTTPHEADER]); } curl_setopt_array($ch, $options); curl_setopt($ch, CURLOPT_URL, $this->httpConfig->getUrl()); @@ -101,7 +100,7 @@ public function execute($data) } //Default Option if Method not of given types in switch case - if ($this->httpConfig->getMethod() != NULL) { + if ($this->httpConfig->getMethod() != null) { curl_setopt($ch, CURLOPT_CUSTOMREQUEST, $this->httpConfig->getMethod()); } @@ -174,14 +173,14 @@ public function execute($data) "Retried $retries times." . $result); $this->logger->debug("\n\n" . str_repeat('=', 128) . "\n"); throw $ex; - } else if ($httpStatus < 200 || $httpStatus >= 300) { + } elseif ($httpStatus < 200 || $httpStatus >= 300) { $ex = new PayPalConnectionException( $this->httpConfig->getUrl(), "Got Http response code $httpStatus when accessing {$this->httpConfig->getUrl()}.", $httpStatus ); $ex->setData($result); - $this->logger->error("Got Http response code $httpStatus when accessing {$this->httpConfig->getUrl()}. " . $result ); + $this->logger->error("Got Http response code $httpStatus when accessing {$this->httpConfig->getUrl()}. " . $result); $this->logger->debug("\n\n" . str_repeat('=', 128) . "\n"); throw $ex; } @@ -191,5 +190,4 @@ public function execute($data) //Return result object return $result; } - } diff --git a/lib/PayPal/Core/PayPalLoggingManager.php b/lib/PayPal/Core/PayPalLoggingManager.php index b9e58924..90521a89 100644 --- a/lib/PayPal/Core/PayPalLoggingManager.php +++ b/lib/PayPal/Core/PayPalLoggingManager.php @@ -116,5 +116,4 @@ public function debug($message) $this->logger->debug($message); } } - } diff --git a/lib/PayPal/Exception/PayPalInvalidCredentialException.php b/lib/PayPal/Exception/PayPalInvalidCredentialException.php index 2531f5b8..09ad27ad 100644 --- a/lib/PayPal/Exception/PayPalInvalidCredentialException.php +++ b/lib/PayPal/Exception/PayPalInvalidCredentialException.php @@ -32,5 +32,4 @@ public function errorMessage() . ': ' . $this->getMessage() . ''; return $errorMsg; } - } diff --git a/lib/PayPal/Exception/PayPalMissingCredentialException.php b/lib/PayPal/Exception/PayPalMissingCredentialException.php index 9fac996a..6ace3b4d 100644 --- a/lib/PayPal/Exception/PayPalMissingCredentialException.php +++ b/lib/PayPal/Exception/PayPalMissingCredentialException.php @@ -33,5 +33,4 @@ public function errorMessage() return $errorMsg; } - } diff --git a/lib/PayPal/Handler/OauthHandler.php b/lib/PayPal/Handler/OauthHandler.php index f281eb0c..54115089 100644 --- a/lib/PayPal/Handler/OauthHandler.php +++ b/lib/PayPal/Handler/OauthHandler.php @@ -78,9 +78,9 @@ private static function _getEndpoint($config) { if (isset($config['oauth.EndPoint'])) { $baseEndpoint = $config['oauth.EndPoint']; - } else if (isset($config['service.EndPoint'])) { + } elseif (isset($config['service.EndPoint'])) { $baseEndpoint = $config['service.EndPoint']; - } else if (isset($config['mode'])) { + } elseif (isset($config['mode'])) { switch (strtoupper($config['mode'])) { case 'SANDBOX': $baseEndpoint = PayPalConstants::REST_SANDBOX_ENDPOINT; diff --git a/lib/PayPal/Handler/RestHandler.php b/lib/PayPal/Handler/RestHandler.php index ad581d7e..ec5298d1 100644 --- a/lib/PayPal/Handler/RestHandler.php +++ b/lib/PayPal/Handler/RestHandler.php @@ -47,7 +47,6 @@ public function __construct($apiContext) */ public function handle($httpConfig, $request, $options) { - $credential = $this->apiContext->getCredential(); $config = $this->apiContext->getConfig(); @@ -105,7 +104,7 @@ private function _getEndpoint($config) { if (isset($config['service.EndPoint'])) { return $config['service.EndPoint']; - } else if (isset($config['mode'])) { + } elseif (isset($config['mode'])) { switch (strtoupper($config['mode'])) { case 'SANDBOX': return PayPalConstants::REST_SANDBOX_ENDPOINT; diff --git a/lib/PayPal/Log/PayPalDefaultLogFactory.php b/lib/PayPal/Log/PayPalDefaultLogFactory.php index 1ac894f6..30668109 100644 --- a/lib/PayPal/Log/PayPalDefaultLogFactory.php +++ b/lib/PayPal/Log/PayPalDefaultLogFactory.php @@ -23,4 +23,4 @@ public function getLogger($className) { return new PayPalLogger($className); } -} \ No newline at end of file +} diff --git a/lib/PayPal/Log/PayPalLogFactory.php b/lib/PayPal/Log/PayPalLogFactory.php index ef773183..986adf27 100644 --- a/lib/PayPal/Log/PayPalLogFactory.php +++ b/lib/PayPal/Log/PayPalLogFactory.php @@ -13,5 +13,4 @@ interface PayPalLogFactory * @return LoggerInterface instance of logger object implementing LoggerInterface */ public function getLogger($className); - -} \ No newline at end of file +} diff --git a/lib/PayPal/Log/PayPalLogger.php b/lib/PayPal/Log/PayPalLogger.php index 17cd229f..ed7a80c0 100644 --- a/lib/PayPal/Log/PayPalLogger.php +++ b/lib/PayPal/Log/PayPalLogger.php @@ -6,7 +6,6 @@ use Psr\Log\AbstractLogger; use Psr\Log\LogLevel; - class PayPalLogger extends AbstractLogger { @@ -75,11 +74,11 @@ public function initialize() public function log($level, $message, array $context = array()) { - if($this->isLoggingEnabled) { + if ($this->isLoggingEnabled) { // Checks if the message is at level below configured logging level if (array_search($level, $this->loggingLevels) <= array_search($this->loggingLevel, $this->loggingLevels)) { error_log("[" . date('d-m-Y h:i:s') . "] " . $this->loggerName . " : " . strtoupper($level) . ": $message\n", 3, $this->loggerFile); } } } -} \ No newline at end of file +} diff --git a/lib/PayPal/Security/Cipher.php b/lib/PayPal/Security/Cipher.php index 3b7b5a87..f95f21bd 100644 --- a/lib/PayPal/Security/Cipher.php +++ b/lib/PayPal/Security/Cipher.php @@ -18,7 +18,7 @@ class Cipher */ const IV_SIZE = 16; - function __construct($secretKey) + public function __construct($secretKey) { $this->secretKey = $secretKey; } @@ -29,7 +29,7 @@ function __construct($secretKey) * @param $input * @return string */ - function encrypt($input) + public function encrypt($input) { // Create a random IV. Not using mcrypt to generate one, as to not have a dependency on it. $iv = substr(uniqid("", true), 0, Cipher::IV_SIZE); @@ -45,7 +45,7 @@ function encrypt($input) * @param $input * @return string */ - function decrypt($input) + public function decrypt($input) { // Decode the IV + data $input = base64_decode($input); diff --git a/lib/PayPal/Transport/PayPalRestCall.php b/lib/PayPal/Transport/PayPalRestCall.php index e80f5ec0..f9edf033 100644 --- a/lib/PayPal/Transport/PayPalRestCall.php +++ b/lib/PayPal/Transport/PayPalRestCall.php @@ -52,7 +52,6 @@ public function __construct(ApiContext $apiContext) */ public function execute($handlers = array(), $path, $method, $data = '', $headers = array()) { - $config = $this->apiContext->getConfig(); $httpConfig = new PayPalHttpConfig(null, $method, $config); $headers = $headers ? $headers : array(); @@ -75,5 +74,4 @@ public function execute($handlers = array(), $path, $method, $data = '', $header return $response; } - } diff --git a/lib/PayPal/Validation/ArgumentValidator.php b/lib/PayPal/Validation/ArgumentValidator.php index 5f2d3bfc..29e7fa39 100644 --- a/lib/PayPal/Validation/ArgumentValidator.php +++ b/lib/PayPal/Validation/ArgumentValidator.php @@ -23,7 +23,7 @@ public static function validate($argument, $argumentName = null) if ($argument === null) { // Error if Object Null throw new \InvalidArgumentException("$argumentName cannot be null"); - } else if (gettype($argument) == 'string' && trim($argument) == ''){ + } elseif (gettype($argument) == 'string' && trim($argument) == '') { // Error if String Empty throw new \InvalidArgumentException("$argumentName string cannot be empty"); } diff --git a/lib/PayPal/Validation/JsonValidator.php b/lib/PayPal/Validation/JsonValidator.php index 11592377..5522ff21 100644 --- a/lib/PayPal/Validation/JsonValidator.php +++ b/lib/PayPal/Validation/JsonValidator.php @@ -32,4 +32,4 @@ public static function validate($string, $silent = false) } return true; } -} +} diff --git a/lib/PayPal/Validation/NumericValidator.php b/lib/PayPal/Validation/NumericValidator.php index 67445288..62fa5605 100644 --- a/lib/PayPal/Validation/NumericValidator.php +++ b/lib/PayPal/Validation/NumericValidator.php @@ -21,7 +21,6 @@ public static function validate($argument, $argumentName = null) { if (trim($argument) != null && !is_numeric($argument)) { throw new \InvalidArgumentException("$argumentName is not a valid numeric value"); - } return true; } diff --git a/lib/PayPal/Validation/UrlValidator.php b/lib/PayPal/Validation/UrlValidator.php index ffd195c7..1b423f2c 100644 --- a/lib/PayPal/Validation/UrlValidator.php +++ b/lib/PayPal/Validation/UrlValidator.php @@ -23,4 +23,4 @@ public static function validate($url, $urlName = null) throw new \InvalidArgumentException("$urlName is not a fully qualified URL"); } } -} \ No newline at end of file +} From cffa2463b1ca2833fa78475ecf82440928e30934 Mon Sep 17 00:00:00 2001 From: Jay Patel Date: Thu, 14 Jul 2016 13:08:18 -0500 Subject: [PATCH 2/3] [PSR] Fixed Tests - Using `php-cs-fixer` tool. --- sample/billing/CreateBillingAgreementWithCreditCard.php | 1 - sample/billing/CreateBillingAgreementWithPayPal.php | 1 - sample/billing/CreatePlan.php | 2 +- sample/billing/DeletePlan.php | 2 +- sample/billing/ExecuteAgreement.php | 6 ++---- sample/billing/GetBillingAgreement.php | 2 +- sample/billing/GetPlan.php | 2 +- sample/billing/ListPlans.php | 2 +- sample/billing/ReactivateBillingAgreement.php | 2 -- sample/billing/SearchBillingTransactions.php | 2 +- sample/billing/SuspendBillingAgreement.php | 4 +--- sample/billing/UpdateBillingAgreement.php | 3 +-- sample/billing/UpdatePlan.php | 3 +-- sample/billing/UpdatePlanPaymentDefinitions.php | 3 +-- sample/common.php | 3 +-- sample/invoice/CancelInvoice.php | 2 +- sample/invoice/CreateInvoice.php | 2 +- sample/invoice/CreateThirdPartyInvoice.php | 2 +- sample/invoice/DeleteInvoice.php | 2 +- sample/invoice/GetInvoice.php | 2 +- sample/invoice/GetNextInvoiceNumber.php | 2 +- sample/invoice/ListInvoice.php | 2 +- sample/invoice/RecordPayment.php | 4 ++-- sample/invoice/RecordRefund.php | 4 ++-- sample/invoice/RemindInvoice.php | 4 ++-- sample/invoice/RetrieveQRCode.php | 5 +---- sample/invoice/SearchInvoices.php | 2 +- sample/invoice/SendInvoice.php | 2 +- sample/invoice/UpdateInvoice.php | 4 ++-- sample/lipp/GenerateAccessTokenFromRefreshToken.php | 4 +--- sample/lipp/GetUserInfo.php | 4 +--- sample/lipp/ObtainUserConsent.php | 2 +- sample/lipp/UserConsentRedirect.php | 4 +--- sample/notifications/CreateWebhook.php | 4 ++-- sample/notifications/DeleteAllWebhooks.php | 2 +- sample/notifications/DeleteWebhook.php | 2 +- sample/notifications/GetWebhook.php | 2 +- sample/notifications/ListSubscribedWebhookEventTypes.php | 4 ++-- sample/notifications/ListWebhooks.php | 4 ++-- sample/notifications/SearchWebhookEvents.php | 2 +- sample/notifications/UpdateWebhook.php | 2 +- sample/notifications/ValidateWebhookEvent.php | 2 -- sample/notifications/WebhookEventTypesList.php | 2 +- sample/payment-experience/CreateWebProfile.php | 2 +- sample/payment-experience/DeleteWebProfile.php | 2 +- sample/payment-experience/GetWebProfile.php | 2 +- sample/payment-experience/ListWebProfiles.php | 2 +- sample/payment-experience/PartiallyUpdateWebProfile.php | 2 +- sample/payment-experience/UpdateWebProfile.php | 2 +- sample/payments/AuthorizationCapture.php | 3 +-- sample/payments/AuthorizePayment.php | 2 +- sample/payments/AuthorizePaymentUsingPayPal.php | 2 +- sample/payments/CreateFuturePayment.php | 3 +-- sample/payments/CreatePayment.php | 2 +- sample/payments/CreatePaymentUsingPayPal.php | 2 +- sample/payments/CreatePaymentUsingSavedCard.php | 2 +- sample/payments/ExecutePayment.php | 6 ++---- sample/payments/GetAuthorization.php | 2 +- sample/payments/GetCapture.php | 2 +- sample/payments/GetPayment.php | 2 +- sample/payments/ListPayments.php | 4 +--- sample/payments/OrderAuthorize.php | 3 +-- sample/payments/OrderCapture.php | 3 +-- sample/payments/OrderCreateForAuthorization.php | 2 +- sample/payments/OrderCreateForCapture.php | 2 +- sample/payments/OrderCreateForVoid.php | 2 +- sample/payments/OrderCreateUsingPayPal.php | 2 +- sample/payments/OrderDoVoid.php | 3 +-- sample/payments/OrderGet.php | 4 +--- sample/payments/Reauthorization.php | 3 +-- sample/payments/RefundCapture.php | 2 +- sample/payments/UpdatePayment.php | 3 +-- sample/payments/VoidAuthorization.php | 3 +-- sample/payouts/CancelPayoutItem.php | 4 ++-- sample/payouts/CreateBatchPayout.php | 2 +- sample/payouts/CreateSinglePayout.php | 2 +- sample/payouts/GetPayoutBatchStatus.php | 2 +- sample/payouts/GetPayoutItemStatus.php | 2 +- sample/sale/GetSale.php | 2 +- sample/sale/RefundSale.php | 2 +- sample/vault/CreateBankAccount.php | 2 +- sample/vault/CreateCreditCard.php | 2 +- sample/vault/DeleteBankAccount.php | 2 +- sample/vault/DeleteCreditCard.php | 2 +- sample/vault/GetBankAccount.php | 2 +- sample/vault/GetCreditCard.php | 2 +- sample/vault/ListCreditCards.php | 2 +- sample/vault/UpdateCreditCard.php | 2 +- 88 files changed, 94 insertions(+), 131 deletions(-) diff --git a/sample/billing/CreateBillingAgreementWithCreditCard.php b/sample/billing/CreateBillingAgreementWithCreditCard.php index f0866b9a..ae4f25c6 100644 --- a/sample/billing/CreateBillingAgreementWithCreditCard.php +++ b/sample/billing/CreateBillingAgreementWithCreditCard.php @@ -99,7 +99,6 @@ try { // Please note that as the agreement has not yet activated, we wont be receiving the ID just yet. $agreement = $agreement->create($apiContext); - } catch (Exception $ex) { // NOTE: PLEASE DO NOT USE RESULTPRINTER CLASS IN YOUR ORIGINAL CODE. FOR SAMPLE ONLY ResultPrinter::printError("Created Billing Agreement.", "Agreement", $agreement->getId(), $request, $ex); diff --git a/sample/billing/CreateBillingAgreementWithPayPal.php b/sample/billing/CreateBillingAgreementWithPayPal.php index f781267d..51cee3c3 100644 --- a/sample/billing/CreateBillingAgreementWithPayPal.php +++ b/sample/billing/CreateBillingAgreementWithPayPal.php @@ -74,7 +74,6 @@ // the buyer to. Retrieve the url from the $agreement->getApprovalLink() // method $approvalUrl = $agreement->getApprovalLink(); - } catch (Exception $ex) { // NOTE: PLEASE DO NOT USE RESULTPRINTER CLASS IN YOUR ORIGINAL CODE. FOR SAMPLE ONLY ResultPrinter::printError("Created Billing Agreement.", "Agreement", null, $request, $ex); diff --git a/sample/billing/CreatePlan.php b/sample/billing/CreatePlan.php index 1050efa1..b71a90bd 100644 --- a/sample/billing/CreatePlan.php +++ b/sample/billing/CreatePlan.php @@ -66,7 +66,7 @@ $output = $plan->create($apiContext); } catch (Exception $ex) { // NOTE: PLEASE DO NOT USE RESULTPRINTER CLASS IN YOUR ORIGINAL CODE. FOR SAMPLE ONLY - ResultPrinter::printError("Created Plan", "Plan", null, $request, $ex); + ResultPrinter::printError("Created Plan", "Plan", null, $request, $ex); exit(1); } diff --git a/sample/billing/DeletePlan.php b/sample/billing/DeletePlan.php index c86e3b3d..9556b952 100644 --- a/sample/billing/DeletePlan.php +++ b/sample/billing/DeletePlan.php @@ -16,7 +16,7 @@ $result = $createdPlan->delete($apiContext); } catch (Exception $ex) { // NOTE: PLEASE DO NOT USE RESULTPRINTER CLASS IN YOUR ORIGINAL CODE. FOR SAMPLE ONLY - ResultPrinter::printError("Deleted a Plan", "Plan", $createdPlan->getId(), null, $ex); + ResultPrinter::printError("Deleted a Plan", "Plan", $createdPlan->getId(), null, $ex); exit(1); } diff --git a/sample/billing/ExecuteAgreement.php b/sample/billing/ExecuteAgreement.php index 35e17eab..b8656daa 100644 --- a/sample/billing/ExecuteAgreement.php +++ b/sample/billing/ExecuteAgreement.php @@ -8,7 +8,6 @@ // ## Approval Status // Determine if the user accepted or denied the request if (isset($_GET['success']) && $_GET['success'] == 'true') { - $token = $_GET['token']; $agreement = new \PayPal\Api\Agreement(); try { @@ -17,7 +16,7 @@ $agreement->execute($token, $apiContext); } catch (Exception $ex) { // NOTE: PLEASE DO NOT USE RESULTPRINTER CLASS IN YOUR ORIGINAL CODE. FOR SAMPLE ONLY - ResultPrinter::printError("Executed an Agreement", "Agreement", $agreement->getId(), $_GET['token'], $ex); + ResultPrinter::printError("Executed an Agreement", "Agreement", $agreement->getId(), $_GET['token'], $ex); exit(1); } @@ -30,13 +29,12 @@ $agreement = \PayPal\Api\Agreement::get($agreement->getId(), $apiContext); } catch (Exception $ex) { // NOTE: PLEASE DO NOT USE RESULTPRINTER CLASS IN YOUR ORIGINAL CODE. FOR SAMPLE ONLY - ResultPrinter::printError("Get Agreement", "Agreement", null, null, $ex); + ResultPrinter::printError("Get Agreement", "Agreement", null, null, $ex); exit(1); } // NOTE: PLEASE DO NOT USE RESULTPRINTER CLASS IN YOUR ORIGINAL CODE. FOR SAMPLE ONLY ResultPrinter::printResult("Get Agreement", "Agreement", $agreement->getId(), null, $agreement); - } else { // NOTE: PLEASE DO NOT USE RESULTPRINTER CLASS IN YOUR ORIGINAL CODE. FOR SAMPLE ONLY ResultPrinter::printResult("User Cancelled the Approval", null); diff --git a/sample/billing/GetBillingAgreement.php b/sample/billing/GetBillingAgreement.php index c1d347d7..97d5f827 100644 --- a/sample/billing/GetBillingAgreement.php +++ b/sample/billing/GetBillingAgreement.php @@ -16,7 +16,7 @@ $agreement = Agreement::get($createdAgreement->getId(), $apiContext); } catch (Exception $ex) { // NOTE: PLEASE DO NOT USE RESULTPRINTER CLASS IN YOUR ORIGINAL CODE. FOR SAMPLE ONLY - ResultPrinter::printError("Retrieved an Agreement", "Agreement", $agreement->getId(), $createdAgreement->getId(), $ex); + ResultPrinter::printError("Retrieved an Agreement", "Agreement", $agreement->getId(), $createdAgreement->getId(), $ex); exit(1); } diff --git a/sample/billing/GetPlan.php b/sample/billing/GetPlan.php index 054e48e7..5d259c63 100644 --- a/sample/billing/GetPlan.php +++ b/sample/billing/GetPlan.php @@ -16,7 +16,7 @@ $plan = Plan::get($createdPlan->getId(), $apiContext); } catch (Exception $ex) { // NOTE: PLEASE DO NOT USE RESULTPRINTER CLASS IN YOUR ORIGINAL CODE. FOR SAMPLE ONLY - ResultPrinter::printError("Retrieved a Plan", "Plan", $plan->getId(), null, $ex); + ResultPrinter::printError("Retrieved a Plan", "Plan", $plan->getId(), null, $ex); exit(1); } diff --git a/sample/billing/ListPlans.php b/sample/billing/ListPlans.php index f56746d4..6636904b 100644 --- a/sample/billing/ListPlans.php +++ b/sample/billing/ListPlans.php @@ -21,7 +21,7 @@ $planList = Plan::all($params, $apiContext); } catch (Exception $ex) { // NOTE: PLEASE DO NOT USE RESULTPRINTER CLASS IN YOUR ORIGINAL CODE. FOR SAMPLE ONLY - ResultPrinter::printError("List of Plans", "Plan", null, $params, $ex); + ResultPrinter::printError("List of Plans", "Plan", null, $params, $ex); exit(1); } diff --git a/sample/billing/ReactivateBillingAgreement.php b/sample/billing/ReactivateBillingAgreement.php index b82e1efa..ed6f189f 100644 --- a/sample/billing/ReactivateBillingAgreement.php +++ b/sample/billing/ReactivateBillingAgreement.php @@ -18,12 +18,10 @@ $agreementStateDescriptor->setNote("Reactivating the agreement"); try { - $suspendedAgreement->reActivate($agreementStateDescriptor, $apiContext); // Lets get the updated Agreement Object $agreement = Agreement::get($suspendedAgreement->getId(), $apiContext); - } catch (Exception $ex) { // NOTE: PLEASE DO NOT USE RESULTPRINTER CLASS IN YOUR ORIGINAL CODE. FOR SAMPLE ONLY ResultPrinter::printResult("Reactivate the Agreement", "Agreement", $agreement->getId(), $suspendedAgreement, $ex); diff --git a/sample/billing/SearchBillingTransactions.php b/sample/billing/SearchBillingTransactions.php index 5713b522..7b9ca0df 100644 --- a/sample/billing/SearchBillingTransactions.php +++ b/sample/billing/SearchBillingTransactions.php @@ -22,7 +22,7 @@ $result = Agreement::searchTransactions($agreementId, $params, $apiContext); } catch (Exception $ex) { // NOTE: PLEASE DO NOT USE RESULTPRINTER CLASS IN YOUR ORIGINAL CODE. FOR SAMPLE ONLY - ResultPrinter::printError("Search for Transactions", "AgreementTransaction", $agreementId, null, $ex); + ResultPrinter::printError("Search for Transactions", "AgreementTransaction", $agreementId, null, $ex); exit(1); } diff --git a/sample/billing/SuspendBillingAgreement.php b/sample/billing/SuspendBillingAgreement.php index fb12581b..67e4c3dd 100644 --- a/sample/billing/SuspendBillingAgreement.php +++ b/sample/billing/SuspendBillingAgreement.php @@ -18,15 +18,13 @@ $agreementStateDescriptor->setNote("Suspending the agreement"); try { - $createdAgreement->suspend($agreementStateDescriptor, $apiContext); // Lets get the updated Agreement Object $agreement = Agreement::get($createdAgreement->getId(), $apiContext); - } catch (Exception $ex) { // NOTE: PLEASE DO NOT USE RESULTPRINTER CLASS IN YOUR ORIGINAL CODE. FOR SAMPLE ONLY - ResultPrinter::printError("Suspended the Agreement", "Agreement", null, $agreementStateDescriptor, $ex); + ResultPrinter::printError("Suspended the Agreement", "Agreement", null, $agreementStateDescriptor, $ex); exit(1); } diff --git a/sample/billing/UpdateBillingAgreement.php b/sample/billing/UpdateBillingAgreement.php index ba8fb813..0f6edcde 100644 --- a/sample/billing/UpdateBillingAgreement.php +++ b/sample/billing/UpdateBillingAgreement.php @@ -35,10 +35,9 @@ // Lets get the updated Agreement Object $agreement = Agreement::get($createdAgreement->getId(), $apiContext); - } catch (Exception $ex) { // NOTE: PLEASE DO NOT USE RESULTPRINTER CLASS IN YOUR ORIGINAL CODE. FOR SAMPLE ONLY - ResultPrinter::printError("Updated the Agreement with new Description and Updated Shipping Address", "Agreement", null, $patchRequest, $ex); + ResultPrinter::printError("Updated the Agreement with new Description and Updated Shipping Address", "Agreement", null, $patchRequest, $ex); exit(1); } diff --git a/sample/billing/UpdatePlan.php b/sample/billing/UpdatePlan.php index cfe2039b..c01433d6 100644 --- a/sample/billing/UpdatePlan.php +++ b/sample/billing/UpdatePlan.php @@ -34,10 +34,9 @@ $createdPlan->update($patchRequest, $apiContext); $plan = Plan::get($createdPlan->getId(), $apiContext); - } catch (Exception $ex) { // NOTE: PLEASE DO NOT USE RESULTPRINTER CLASS IN YOUR ORIGINAL CODE. FOR SAMPLE ONLY - ResultPrinter::printError("Updated the Plan to Active State", "Plan", null, $patchRequest, $ex); + ResultPrinter::printError("Updated the Plan to Active State", "Plan", null, $patchRequest, $ex); exit(1); } diff --git a/sample/billing/UpdatePlanPaymentDefinitions.php b/sample/billing/UpdatePlanPaymentDefinitions.php index 8132d6f0..7be025bd 100644 --- a/sample/billing/UpdatePlanPaymentDefinitions.php +++ b/sample/billing/UpdatePlanPaymentDefinitions.php @@ -40,10 +40,9 @@ $createdPlan->update($patchRequest, $apiContext); $plan = Plan::get($createdPlan->getId(), $apiContext); - } catch (Exception $ex) { // NOTE: PLEASE DO NOT USE RESULTPRINTER CLASS IN YOUR ORIGINAL CODE. FOR SAMPLE ONLY - ResultPrinter::printError("Updated the Plan Payment Definition", "Plan", null, $patchRequest, $ex); + ResultPrinter::printError("Updated the Plan Payment Definition", "Plan", null, $patchRequest, $ex); exit(1); } diff --git a/sample/common.php b/sample/common.php index 8dd22ffb..1ca7db66 100644 --- a/sample/common.php +++ b/sample/common.php @@ -1,7 +1,7 @@ cancel($notify, $apiContext); } catch (Exception $ex) { // NOTE: PLEASE DO NOT USE RESULTPRINTER CLASS IN YOUR ORIGINAL CODE. FOR SAMPLE ONLY - ResultPrinter::printError("Cancel Invoice", "Invoice", null, $notify, $ex); + ResultPrinter::printError("Cancel Invoice", "Invoice", null, $notify, $ex); exit(1); } diff --git a/sample/invoice/CreateInvoice.php b/sample/invoice/CreateInvoice.php index 7e244fbe..82a20a8e 100644 --- a/sample/invoice/CreateInvoice.php +++ b/sample/invoice/CreateInvoice.php @@ -155,7 +155,7 @@ $invoice->create($apiContext); } catch (Exception $ex) { // NOTE: PLEASE DO NOT USE RESULTPRINTER CLASS IN YOUR ORIGINAL CODE. FOR SAMPLE ONLY - ResultPrinter::printError("Create Invoice", "Invoice", null, $request, $ex); + ResultPrinter::printError("Create Invoice", "Invoice", null, $request, $ex); exit(1); } diff --git a/sample/invoice/CreateThirdPartyInvoice.php b/sample/invoice/CreateThirdPartyInvoice.php index 81867c23..59a6aacb 100644 --- a/sample/invoice/CreateThirdPartyInvoice.php +++ b/sample/invoice/CreateThirdPartyInvoice.php @@ -98,7 +98,7 @@ $invoice->create($apiContext); } catch (Exception $ex) { // NOTE: PLEASE DO NOT USE RESULTPRINTER CLASS IN YOUR ORIGINAL CODE. FOR SAMPLE ONLY - ResultPrinter::printError("Create Invoice", "Invoice", null, $request, $ex); + ResultPrinter::printError("Create Invoice", "Invoice", null, $request, $ex); exit(1); } diff --git a/sample/invoice/DeleteInvoice.php b/sample/invoice/DeleteInvoice.php index 7657b9d8..207d3779 100644 --- a/sample/invoice/DeleteInvoice.php +++ b/sample/invoice/DeleteInvoice.php @@ -20,7 +20,7 @@ $deleteStatus = $invoice->delete($apiContext); } catch (Exception $ex) { // NOTE: PLEASE DO NOT USE RESULTPRINTER CLASS IN YOUR ORIGINAL CODE. FOR SAMPLE ONLY - ResultPrinter::printError("Delete Invoice", "Invoice", null, $deleteStatus, $ex); + ResultPrinter::printError("Delete Invoice", "Invoice", null, $deleteStatus, $ex); exit(1); } diff --git a/sample/invoice/GetInvoice.php b/sample/invoice/GetInvoice.php index d2560488..29b5b640 100644 --- a/sample/invoice/GetInvoice.php +++ b/sample/invoice/GetInvoice.php @@ -20,7 +20,7 @@ $invoice = Invoice::get($invoiceId, $apiContext); } catch (Exception $ex) { // NOTE: PLEASE DO NOT USE RESULTPRINTER CLASS IN YOUR ORIGINAL CODE. FOR SAMPLE ONLY - ResultPrinter::printError("Get Invoice", "Invoice", $invoice->getId(), $invoiceId, $ex); + ResultPrinter::printError("Get Invoice", "Invoice", $invoice->getId(), $invoiceId, $ex); exit(1); } diff --git a/sample/invoice/GetNextInvoiceNumber.php b/sample/invoice/GetNextInvoiceNumber.php index 948484ac..52711ad2 100644 --- a/sample/invoice/GetNextInvoiceNumber.php +++ b/sample/invoice/GetNextInvoiceNumber.php @@ -14,7 +14,7 @@ $number = Invoice::generateNumber($apiContext); } catch (Exception $ex) { // NOTE: PLEASE DO NOT USE RESULTPRINTER CLASS IN YOUR ORIGINAL CODE. FOR SAMPLE ONLY - ResultPrinter::printError("Get Next Invoice Number", "InvoiceNumber", null, null, $ex); + ResultPrinter::printError("Get Next Invoice Number", "InvoiceNumber", null, null, $ex); exit(1); } diff --git a/sample/invoice/ListInvoice.php b/sample/invoice/ListInvoice.php index 99a3cc0b..291dd34c 100644 --- a/sample/invoice/ListInvoice.php +++ b/sample/invoice/ListInvoice.php @@ -17,7 +17,7 @@ $invoices = Invoice::getAll(array('page' => 0, 'page_size' => 4, 'total_count_required' => "true"), $apiContext); } catch (Exception $ex) { // NOTE: PLEASE DO NOT USE RESULTPRINTER CLASS IN YOUR ORIGINAL CODE. FOR SAMPLE ONLY - ResultPrinter::printError("Lookup Invoice History", "Invoice", null, null, $ex); + ResultPrinter::printError("Lookup Invoice History", "Invoice", null, null, $ex); exit(1); } // NOTE: PLEASE DO NOT USE RESULTPRINTER CLASS IN YOUR ORIGINAL CODE. FOR SAMPLE ONLY diff --git a/sample/invoice/RecordPayment.php b/sample/invoice/RecordPayment.php index b413b374..48520180 100644 --- a/sample/invoice/RecordPayment.php +++ b/sample/invoice/RecordPayment.php @@ -31,7 +31,7 @@ $recordStatus = $invoice->recordPayment($record, $apiContext); } catch (Exception $ex) { // NOTE: PLEASE DO NOT USE RESULTPRINTER CLASS IN YOUR ORIGINAL CODE. FOR SAMPLE ONLY - ResultPrinter::printError("Payment for Invoice", "Invoice", null, null, $ex); + ResultPrinter::printError("Payment for Invoice", "Invoice", null, null, $ex); exit(1); } @@ -48,7 +48,7 @@ $invoice = Invoice::get($invoice->getId(), $apiContext); } catch (Exception $ex) { // NOTE: PLEASE DO NOT USE RESULTPRINTER CLASS IN YOUR ORIGINAL CODE. FOR SAMPLE ONLY - ResultPrinter::printError("Get Invoice (Not Required - For Sample Only)", "Invoice", $invoice->getId(), $invoice->getId(), $ex); + ResultPrinter::printError("Get Invoice (Not Required - For Sample Only)", "Invoice", $invoice->getId(), $invoice->getId(), $ex); exit(1); } diff --git a/sample/invoice/RecordRefund.php b/sample/invoice/RecordRefund.php index 12144fe4..d3faabb2 100644 --- a/sample/invoice/RecordRefund.php +++ b/sample/invoice/RecordRefund.php @@ -30,7 +30,7 @@ $refundStatus = $invoice->recordRefund($refund, $apiContext); } catch (Exception $ex) { // NOTE: PLEASE DO NOT USE RESULTPRINTER CLASS IN YOUR ORIGINAL CODE. FOR SAMPLE ONLY - ResultPrinter::printError("Refund for Invoice", "Invoice", null, null, $ex); + ResultPrinter::printError("Refund for Invoice", "Invoice", null, null, $ex); exit(1); } @@ -47,7 +47,7 @@ $invoice = Invoice::get($invoice->getId(), $apiContext); } catch (Exception $ex) { // NOTE: PLEASE DO NOT USE RESULTPRINTER CLASS IN YOUR ORIGINAL CODE. FOR SAMPLE ONLY - ResultPrinter::printError("Get Invoice (Not Required - For Sample Only)", "Invoice", $invoice->getId(), $invoice->getId(), $ex); + ResultPrinter::printError("Get Invoice (Not Required - For Sample Only)", "Invoice", $invoice->getId(), $invoice->getId(), $ex); exit(1); } diff --git a/sample/invoice/RemindInvoice.php b/sample/invoice/RemindInvoice.php index dc8ab167..7e047173 100644 --- a/sample/invoice/RemindInvoice.php +++ b/sample/invoice/RemindInvoice.php @@ -31,7 +31,7 @@ $remindStatus = $invoice->remind($notify, $apiContext); } catch (Exception $ex) { // NOTE: PLEASE DO NOT USE RESULTPRINTER CLASS IN YOUR ORIGINAL CODE. FOR SAMPLE ONLY - ResultPrinter::printError("Remind Invoice", "Invoice", null, $notify, $ex); + ResultPrinter::printError("Remind Invoice", "Invoice", null, $notify, $ex); exit(1); } @@ -48,7 +48,7 @@ $invoice = Invoice::get($invoice->getId(), $apiContext); } catch (Exception $ex) { // NOTE: PLEASE DO NOT USE RESULTPRINTER CLASS IN YOUR ORIGINAL CODE. FOR SAMPLE ONLY - ResultPrinter::printError("Get Invoice (Not Required - For Sample Only)", "Invoice", $invoice->getId(), $invoice->getId(), $ex); + ResultPrinter::printError("Get Invoice (Not Required - For Sample Only)", "Invoice", $invoice->getId(), $invoice->getId(), $ex); exit(1); } diff --git a/sample/invoice/RetrieveQRCode.php b/sample/invoice/RetrieveQRCode.php index e9cbd1d3..4db3f59a 100644 --- a/sample/invoice/RetrieveQRCode.php +++ b/sample/invoice/RetrieveQRCode.php @@ -23,11 +23,9 @@ // 'saveToFile' method with proper file name. // This will save the image as /samples/invoice/images/sample.png $path = $image->saveToFile("images/sample.png"); - - } catch (Exception $ex) { // NOTE: PLEASE DO NOT USE RESULTPRINTER CLASS IN YOUR ORIGINAL CODE. FOR SAMPLE ONLY - ResultPrinter::printError("Retrieved QR Code for Invoice", "Invoice", $invoice->getId(), null, $ex); + ResultPrinter::printError("Retrieved QR Code for Invoice", "Invoice", $invoice->getId(), null, $ex); exit(1); } @@ -39,4 +37,3 @@ // One of the ways, you could directly inject the base64-encoded string // with proper image information in front of it. echo 'Invoice QR Code'; - diff --git a/sample/invoice/SearchInvoices.php b/sample/invoice/SearchInvoices.php index b94a3a86..793baa3b 100644 --- a/sample/invoice/SearchInvoices.php +++ b/sample/invoice/SearchInvoices.php @@ -31,7 +31,7 @@ $invoices = Invoice::search($search, $apiContext); } catch (Exception $ex) { // NOTE: PLEASE DO NOT USE RESULTPRINTER CLASS IN YOUR ORIGINAL CODE. FOR SAMPLE ONLY - ResultPrinter::printError("Search Invoice", "Invoice", null, null, $ex); + ResultPrinter::printError("Search Invoice", "Invoice", null, null, $ex); exit(1); } // NOTE: PLEASE DO NOT USE RESULTPRINTER CLASS IN YOUR ORIGINAL CODE. FOR SAMPLE ONLY diff --git a/sample/invoice/SendInvoice.php b/sample/invoice/SendInvoice.php index 01ca388c..9c8c59d6 100644 --- a/sample/invoice/SendInvoice.php +++ b/sample/invoice/SendInvoice.php @@ -34,7 +34,7 @@ $invoice = Invoice::get($invoice->getId(), $apiContext); } catch (Exception $ex) { // NOTE: PLEASE DO NOT USE RESULTPRINTER CLASS IN YOUR ORIGINAL CODE. FOR SAMPLE ONLY - ResultPrinter::printError("Get Invoice (Not Required - For Sample Only)", "Invoice", $invoice->getId(), $invoice->getId(), $ex); + ResultPrinter::printError("Get Invoice (Not Required - For Sample Only)", "Invoice", $invoice->getId(), $invoice->getId(), $ex); exit(1); } diff --git a/sample/invoice/UpdateInvoice.php b/sample/invoice/UpdateInvoice.php index 57ca6222..020e1ea9 100644 --- a/sample/invoice/UpdateInvoice.php +++ b/sample/invoice/UpdateInvoice.php @@ -30,7 +30,7 @@ $invoice->update($apiContext); } catch (Exception $ex) { // NOTE: PLEASE DO NOT USE RESULTPRINTER CLASS IN YOUR ORIGINAL CODE. FOR SAMPLE ONLY - ResultPrinter::printError("Invoice Updated", "Invoice", null, $request, $ex); + ResultPrinter::printError("Invoice Updated", "Invoice", null, $request, $ex); exit(1); } @@ -47,7 +47,7 @@ $invoice = Invoice::get($invoice->getId(), $apiContext); } catch (Exception $ex) { // NOTE: PLEASE DO NOT USE RESULTPRINTER CLASS IN YOUR ORIGINAL CODE. FOR SAMPLE ONLY - ResultPrinter::printError("Get Invoice (Not Required - For Sample Only)", "Invoice", $invoice->getId(), $invoice->getId(), $ex); + ResultPrinter::printError("Get Invoice (Not Required - For Sample Only)", "Invoice", $invoice->getId(), $invoice->getId(), $ex); exit(1); } diff --git a/sample/lipp/GenerateAccessTokenFromRefreshToken.php b/sample/lipp/GenerateAccessTokenFromRefreshToken.php index ff905403..31c21aa0 100644 --- a/sample/lipp/GenerateAccessTokenFromRefreshToken.php +++ b/sample/lipp/GenerateAccessTokenFromRefreshToken.php @@ -9,13 +9,11 @@ $refreshToken = 'yzX4AkmMyBKR4on7vB5he-tDu38s24Zy-kTibhSuqA8kTdy0Yinxj7NpAyULx0bxqC5G8dbXOt0aVMlMmtpiVmSzhcjVZhYDM7WUQLC9KpaXGBHyltJPkLLQkXE'; try { - $tokenInfo = new OpenIdTokeninfo(); $tokenInfo = $tokenInfo->createFromRefreshToken(array('refresh_token' => $refreshToken), $apiContext); - } catch (Exception $ex) { // NOTE: PLEASE DO NOT USE RESULTPRINTER CLASS IN YOUR ORIGINAL CODE. FOR SAMPLE ONLY - ResultPrinter::printError("Obtained Access Token From Refresh Token", "Access Token", null, null, $ex); + ResultPrinter::printError("Obtained Access Token From Refresh Token", "Access Token", null, null, $ex); exit(1); } diff --git a/sample/lipp/GetUserInfo.php b/sample/lipp/GetUserInfo.php index 52b8be78..0ec4525c 100644 --- a/sample/lipp/GetUserInfo.php +++ b/sample/lipp/GetUserInfo.php @@ -21,16 +21,14 @@ $refreshToken = 'W1JmxG-Cogm-4aSc5Vlen37XaQTj74aQcQiTtXax5UgY7M_AJ--kLX8xNVk8LtCpmueFfcYlRK6UgQLJ-XHsxpw6kZzPpKKccRQeC4z2ldTMfXdIWajZ6CHuebs'; try { - $tokenInfo = new OpenIdTokeninfo(); $tokenInfo = $tokenInfo->createFromRefreshToken(array('refresh_token' => $refreshToken), $apiContext); $params = array('access_token' => $tokenInfo->getAccessToken()); $userInfo = OpenIdUserinfo::getUserinfo($params, $apiContext); - } catch (Exception $ex) { // NOTE: PLEASE DO NOT USE RESULTPRINTER CLASS IN YOUR ORIGINAL CODE. FOR SAMPLE ONLY - ResultPrinter::printError("User Information", "User Info", null, $params, $ex); + ResultPrinter::printError("User Information", "User Info", null, $params, $ex); exit(1); } diff --git a/sample/lipp/ObtainUserConsent.php b/sample/lipp/ObtainUserConsent.php index ee970217..914e4cb8 100644 --- a/sample/lipp/ObtainUserConsent.php +++ b/sample/lipp/ObtainUserConsent.php @@ -13,7 +13,7 @@ $redirectUrl = OpenIdSession::getAuthorizationUrl( $baseUrl, array('openid', 'profile', 'address', 'email', 'phone', - 'https://uri.paypal.com/services/paypalattributes', + 'https://uri.paypal.com/services/paypalattributes', 'https://uri.paypal.com/services/expresscheckout', 'https://uri.paypal.com/services/invoicing'), null, diff --git a/sample/lipp/UserConsentRedirect.php b/sample/lipp/UserConsentRedirect.php index 6ac77e7d..2911afb3 100644 --- a/sample/lipp/UserConsentRedirect.php +++ b/sample/lipp/UserConsentRedirect.php @@ -11,7 +11,6 @@ // PayPal would redirect the user to the redirect_uri mentioned when creating the consent URL. // The user would then able to retrieve the access token by getting the code, which is returned as a GET parameter. if (isset($_GET['success']) && $_GET['success'] == 'true') { - $code = $_GET['code']; try { @@ -19,11 +18,10 @@ $accessToken = OpenIdTokeninfo::createFromAuthorizationCode(array('code' => $code), null, null, $apiContext); } catch (PayPalConnectionException $ex) { // NOTE: PLEASE DO NOT USE RESULTPRINTER CLASS IN YOUR ORIGINAL CODE. FOR SAMPLE ONLY - ResultPrinter::printError("Obtained Access Token", "Access Token", null, $_GET['code'], $ex); + ResultPrinter::printError("Obtained Access Token", "Access Token", null, $_GET['code'], $ex); exit(1); } // NOTE: PLEASE DO NOT USE RESULTPRINTER CLASS IN YOUR ORIGINAL CODE. FOR SAMPLE ONLY ResultPrinter::printResult("Obtained Access Token", "Access Token", $accessToken->getAccessToken(), $_GET['code'], $accessToken); - } diff --git a/sample/notifications/CreateWebhook.php b/sample/notifications/CreateWebhook.php index 7606b52c..c82796e9 100644 --- a/sample/notifications/CreateWebhook.php +++ b/sample/notifications/CreateWebhook.php @@ -58,7 +58,7 @@ $data = $ex->getData(); // NOTE: PLEASE DO NOT USE RESULTPRINTER CLASS IN YOUR ORIGINAL CODE. FOR SAMPLE ONLY ResultPrinter::printError("Created Webhook Failed. Checking if it is Webhook Number Limit Exceeded. Trying to delete all existing webhooks", "Webhook", "Please Use Delete All Webhooks Sample to delete all existing webhooks in sample", $request, $ex); - if (strpos($data,'WEBHOOK_NUMBER_LIMIT_EXCEEDED') !== false) { + if (strpos($data, 'WEBHOOK_NUMBER_LIMIT_EXCEEDED') !== false) { require 'DeleteAllWebhooks.php'; try { $output = $webhook->create($apiContext); @@ -69,7 +69,7 @@ } } else { // NOTE: PLEASE DO NOT USE RESULTPRINTER CLASS IN YOUR ORIGINAL CODE. FOR SAMPLE ONLY - ResultPrinter::printError("Created Webhook", "Webhook", null, $request, $ex); + ResultPrinter::printError("Created Webhook", "Webhook", null, $request, $ex); exit(1); } } else { diff --git a/sample/notifications/DeleteAllWebhooks.php b/sample/notifications/DeleteAllWebhooks.php index 746a7b08..27b1fc0d 100644 --- a/sample/notifications/DeleteAllWebhooks.php +++ b/sample/notifications/DeleteAllWebhooks.php @@ -16,7 +16,7 @@ } } catch (Exception $ex) { // NOTE: PLEASE DO NOT USE RESULTPRINTER CLASS IN YOUR ORIGINAL CODE. FOR SAMPLE ONLY - ResultPrinter::printError("Deleted all Webhooks", "WebhookList", null, null, $ex); + ResultPrinter::printError("Deleted all Webhooks", "WebhookList", null, null, $ex); exit(1); } diff --git a/sample/notifications/DeleteWebhook.php b/sample/notifications/DeleteWebhook.php index c1c70bcf..09bb898a 100644 --- a/sample/notifications/DeleteWebhook.php +++ b/sample/notifications/DeleteWebhook.php @@ -17,7 +17,7 @@ $output = $webhook->delete($apiContext); } catch (Exception $ex) { // NOTE: PLEASE DO NOT USE RESULTPRINTER CLASS IN YOUR ORIGINAL CODE. FOR SAMPLE ONLY - ResultPrinter::printError("Delete a Webhook", "Webhook", null, $webhookId, $ex); + ResultPrinter::printError("Delete a Webhook", "Webhook", null, $webhookId, $ex); exit(1); } diff --git a/sample/notifications/GetWebhook.php b/sample/notifications/GetWebhook.php index 3ec7a7f7..ce88368d 100644 --- a/sample/notifications/GetWebhook.php +++ b/sample/notifications/GetWebhook.php @@ -18,7 +18,7 @@ $output = \PayPal\Api\Webhook::get($webhookId, $apiContext); } catch (Exception $ex) { // NOTE: PLEASE DO NOT USE RESULTPRINTER CLASS IN YOUR ORIGINAL CODE. FOR SAMPLE ONLY - ResultPrinter::printError("Get a Webhook", "Webhook", null, $webhookId, $ex); + ResultPrinter::printError("Get a Webhook", "Webhook", null, $webhookId, $ex); exit(1); } diff --git a/sample/notifications/ListSubscribedWebhookEventTypes.php b/sample/notifications/ListSubscribedWebhookEventTypes.php index 186d23b6..bfb37e90 100644 --- a/sample/notifications/ListSubscribedWebhookEventTypes.php +++ b/sample/notifications/ListSubscribedWebhookEventTypes.php @@ -18,11 +18,11 @@ $output = \PayPal\Api\WebhookEventType::subscribedEventTypes($webhookId, $apiContext); } catch (Exception $ex) { // NOTE: PLEASE DO NOT USE RESULTPRINTER CLASS IN YOUR ORIGINAL CODE. FOR SAMPLE ONLY - ResultPrinter::printError("List subscribed webhook event types", "WebhookEventTypeList", null, $webhookId, $ex); + ResultPrinter::printError("List subscribed webhook event types", "WebhookEventTypeList", null, $webhookId, $ex); exit(1); } // NOTE: PLEASE DO NOT USE RESULTPRINTER CLASS IN YOUR ORIGINAL CODE. FOR SAMPLE ONLY - ResultPrinter::printResult("List subscribed webhook event types", "WebhookEventTypeList",null, null, $output); + ResultPrinter::printResult("List subscribed webhook event types", "WebhookEventTypeList", null, null, $output); return $output; diff --git a/sample/notifications/ListWebhooks.php b/sample/notifications/ListWebhooks.php index 05c1dbfe..f3b3b189 100644 --- a/sample/notifications/ListWebhooks.php +++ b/sample/notifications/ListWebhooks.php @@ -19,11 +19,11 @@ $output = \PayPal\Api\Webhook::getAll($apiContext); } catch (Exception $ex) { // NOTE: PLEASE DO NOT USE RESULTPRINTER CLASS IN YOUR ORIGINAL CODE. FOR SAMPLE ONLY - ResultPrinter::printError("List all webhooks", "WebhookList", null, $webhookId, $ex); + ResultPrinter::printError("List all webhooks", "WebhookList", null, $webhookId, $ex); exit(1); } // NOTE: PLEASE DO NOT USE RESULTPRINTER CLASS IN YOUR ORIGINAL CODE. FOR SAMPLE ONLY - ResultPrinter::printResult("List all webhooks", "WebhookList",null, null, $output); + ResultPrinter::printResult("List all webhooks", "WebhookList", null, null, $output); return $output; diff --git a/sample/notifications/SearchWebhookEvents.php b/sample/notifications/SearchWebhookEvents.php index cabbc6a0..45a7d93b 100644 --- a/sample/notifications/SearchWebhookEvents.php +++ b/sample/notifications/SearchWebhookEvents.php @@ -23,7 +23,7 @@ $output = \PayPal\Api\WebhookEvent::all($params, $apiContext); } catch (Exception $ex) { // NOTE: PLEASE DO NOT USE RESULTPRINTER CLASS IN YOUR ORIGINAL CODE. FOR SAMPLE ONLY - ResultPrinter::printError("Search Webhook events", "WebhookEventList", null, null, $ex); + ResultPrinter::printError("Search Webhook events", "WebhookEventList", null, null, $ex); exit(1); } diff --git a/sample/notifications/UpdateWebhook.php b/sample/notifications/UpdateWebhook.php index 043733bc..c216cf02 100644 --- a/sample/notifications/UpdateWebhook.php +++ b/sample/notifications/UpdateWebhook.php @@ -47,7 +47,7 @@ $output = $webhook->update($patchRequest, $apiContext); } catch (Exception $ex) { // NOTE: PLEASE DO NOT USE RESULTPRINTER CLASS IN YOUR ORIGINAL CODE. FOR SAMPLE ONLY - ResultPrinter::printError("Updated a Webhook", "Webhook", null, $patchRequest, $ex); + ResultPrinter::printError("Updated a Webhook", "Webhook", null, $patchRequest, $ex); exit(1); } diff --git a/sample/notifications/ValidateWebhookEvent.php b/sample/notifications/ValidateWebhookEvent.php index e8c53721..3e24a173 100644 --- a/sample/notifications/ValidateWebhookEvent.php +++ b/sample/notifications/ValidateWebhookEvent.php @@ -32,5 +32,3 @@ // NOTE: PLEASE DO NOT USE RESULTPRINTER CLASS IN YOUR ORIGINAL CODE. FOR SAMPLE ONLY ResultPrinter::printResult("Validate Received Webhook Event", "WebhookEvent", $output->getId(), $bodyReceived, $output); - - diff --git a/sample/notifications/WebhookEventTypesList.php b/sample/notifications/WebhookEventTypesList.php index f19d591e..c8589b5f 100644 --- a/sample/notifications/WebhookEventTypesList.php +++ b/sample/notifications/WebhookEventTypesList.php @@ -13,7 +13,7 @@ $output = \PayPal\Api\WebhookEventType::availableEventTypes($apiContext); } catch (Exception $ex) { // NOTE: PLEASE DO NOT USE RESULTPRINTER CLASS IN YOUR ORIGINAL CODE. FOR SAMPLE ONLY - ResultPrinter::printError("Get List of All Webhook Event Types", "WebhookEventTypeList", null, null, $ex); + ResultPrinter::printError("Get List of All Webhook Event Types", "WebhookEventTypeList", null, null, $ex); exit(1); } diff --git a/sample/payment-experience/CreateWebProfile.php b/sample/payment-experience/CreateWebProfile.php index cac85c8c..43007b04 100644 --- a/sample/payment-experience/CreateWebProfile.php +++ b/sample/payment-experience/CreateWebProfile.php @@ -53,7 +53,7 @@ $createProfileResponse = $webProfile->create($apiContext); } catch (\PayPal\Exception\PayPalConnectionException $ex) { // NOTE: PLEASE DO NOT USE RESULTPRINTER CLASS IN YOUR ORIGINAL CODE. FOR SAMPLE ONLY - ResultPrinter::printError("Created Web Profile", "Web Profile", null, $request, $ex); + ResultPrinter::printError("Created Web Profile", "Web Profile", null, $request, $ex); exit(1); } diff --git a/sample/payment-experience/DeleteWebProfile.php b/sample/payment-experience/DeleteWebProfile.php index 9cf0c1f8..dc66b9a3 100644 --- a/sample/payment-experience/DeleteWebProfile.php +++ b/sample/payment-experience/DeleteWebProfile.php @@ -20,7 +20,7 @@ $webProfile->delete($apiContext); } catch (\PayPal\Exception\PayPalConnectionException $ex) { // NOTE: PLEASE DO NOT USE RESULTPRINTER CLASS IN YOUR ORIGINAL CODE. FOR SAMPLE ONLY - ResultPrinter::printError("Deleted Web Profile", "Web Profile", $createProfileResponse->getId(), null, $ex); + ResultPrinter::printError("Deleted Web Profile", "Web Profile", $createProfileResponse->getId(), null, $ex); exit(1); } diff --git a/sample/payment-experience/GetWebProfile.php b/sample/payment-experience/GetWebProfile.php index 09bcc93e..6b06f823 100644 --- a/sample/payment-experience/GetWebProfile.php +++ b/sample/payment-experience/GetWebProfile.php @@ -16,7 +16,7 @@ $webProfile = \PayPal\Api\WebProfile::get($createProfileResponse->getId(), $apiContext); } catch (\PayPal\Exception\PayPalConnectionException $ex) { // NOTE: PLEASE DO NOT USE RESULTPRINTER CLASS IN YOUR ORIGINAL CODE. FOR SAMPLE ONLY - ResultPrinter::printError("Get Web Profile", "Web Profile", $webProfile->getId(), null, $ex); + ResultPrinter::printError("Get Web Profile", "Web Profile", $webProfile->getId(), null, $ex); exit(1); } diff --git a/sample/payment-experience/ListWebProfiles.php b/sample/payment-experience/ListWebProfiles.php index 57762c76..6b838e19 100644 --- a/sample/payment-experience/ListWebProfiles.php +++ b/sample/payment-experience/ListWebProfiles.php @@ -12,7 +12,7 @@ $list = \PayPal\Api\WebProfile::get_list($apiContext); } catch (\PayPal\Exception\PayPalConnectionException $ex) { // NOTE: PLEASE DO NOT USE RESULTPRINTER CLASS IN YOUR ORIGINAL CODE. FOR SAMPLE ONLY - ResultPrinter::printError("Get List of All Web Profiles", "Web Profiles", null, null, $ex); + ResultPrinter::printError("Get List of All Web Profiles", "Web Profiles", null, null, $ex); exit(1); } $result = ''; diff --git a/sample/payment-experience/PartiallyUpdateWebProfile.php b/sample/payment-experience/PartiallyUpdateWebProfile.php index 79b25f8b..5ab53b57 100644 --- a/sample/payment-experience/PartiallyUpdateWebProfile.php +++ b/sample/payment-experience/PartiallyUpdateWebProfile.php @@ -38,7 +38,7 @@ } } catch (\Exception $ex) { // NOTE: PLEASE DO NOT USE RESULTPRINTER CLASS IN YOUR ORIGINAL CODE. FOR SAMPLE ONLY - ResultPrinter::printError("Partially Updated Web Profile", "Web Profile", $webProfile->getId(), $patches, $ex); + ResultPrinter::printError("Partially Updated Web Profile", "Web Profile", $webProfile->getId(), $patches, $ex); exit(1); } diff --git a/sample/payment-experience/UpdateWebProfile.php b/sample/payment-experience/UpdateWebProfile.php index 4cf4770f..697a92b9 100644 --- a/sample/payment-experience/UpdateWebProfile.php +++ b/sample/payment-experience/UpdateWebProfile.php @@ -22,7 +22,7 @@ } } catch (\Exception $ex) { // NOTE: PLEASE DO NOT USE RESULTPRINTER CLASS IN YOUR ORIGINAL CODE. FOR SAMPLE ONLY - ResultPrinter::printError("Updated Web Profile", "Web Profile", $webProfile->getId(), $webProfile, $ex); + ResultPrinter::printError("Updated Web Profile", "Web Profile", $webProfile->getId(), $webProfile, $ex); exit(1); } diff --git a/sample/payments/AuthorizationCapture.php b/sample/payments/AuthorizationCapture.php index 493e4c51..0cbe9c0d 100644 --- a/sample/payments/AuthorizationCapture.php +++ b/sample/payments/AuthorizationCapture.php @@ -11,7 +11,6 @@ use PayPal\Api\Authorization; use PayPal\Api\Capture; - // ### Capture Payment // You can capture and process a previously created authorization // by invoking the $authorization->capture method @@ -31,7 +30,7 @@ $getCapture = $authorization->capture($capture, $apiContext); } catch (Exception $ex) { // NOTE: PLEASE DO NOT USE RESULTPRINTER CLASS IN YOUR ORIGINAL CODE. FOR SAMPLE ONLY - ResultPrinter::printError("Capture Payment", "Authorization", null, $capture, $ex); + ResultPrinter::printError("Capture Payment", "Authorization", null, $capture, $ex); exit(1); } diff --git a/sample/payments/AuthorizePayment.php b/sample/payments/AuthorizePayment.php index c32b5811..f7959fe2 100644 --- a/sample/payments/AuthorizePayment.php +++ b/sample/payments/AuthorizePayment.php @@ -69,7 +69,7 @@ $payment->create($apiContext); } catch (Exception $ex) { // NOTE: PLEASE DO NOT USE RESULTPRINTER CLASS IN YOUR ORIGINAL CODE. FOR SAMPLE ONLY - ResultPrinter::printError('Authorize a Payment', 'Authorized Payment', $payment->getId(), $request, $ex); + ResultPrinter::printError('Authorize a Payment', 'Authorized Payment', $payment->getId(), $request, $ex); exit(1); } diff --git a/sample/payments/AuthorizePaymentUsingPayPal.php b/sample/payments/AuthorizePaymentUsingPayPal.php index 10900ed5..bb4eb657 100644 --- a/sample/payments/AuthorizePaymentUsingPayPal.php +++ b/sample/payments/AuthorizePaymentUsingPayPal.php @@ -101,7 +101,7 @@ $payment->create($apiContext); } catch (Exception $ex) { // NOTE: PLEASE DO NOT USE RESULTPRINTER CLASS IN YOUR ORIGINAL CODE. FOR SAMPLE ONLY - ResultPrinter::printError("Created Payment Authorization Using PayPal. Please visit the URL to Authorize.", "Payment", null, $request, $ex); + ResultPrinter::printError("Created Payment Authorization Using PayPal. Please visit the URL to Authorize.", "Payment", null, $request, $ex); exit(1); } diff --git a/sample/payments/CreateFuturePayment.php b/sample/payments/CreateFuturePayment.php index c3e3f599..10aa4582 100644 --- a/sample/payments/CreateFuturePayment.php +++ b/sample/payments/CreateFuturePayment.php @@ -84,10 +84,9 @@ // for payment approval // Please note that currently future payments works only with PayPal as a funding instrument. $payment->create($apiContext, $clientMetadataId); - } catch (Exception $ex) { // NOTE: PLEASE DO NOT USE RESULTPRINTER CLASS IN YOUR ORIGINAL CODE. FOR SAMPLE ONLY - ResultPrinter::printError("Future Payment", "Payment", null, $payment, $ex); + ResultPrinter::printError("Future Payment", "Payment", null, $payment, $ex); exit(1); } diff --git a/sample/payments/CreatePayment.php b/sample/payments/CreatePayment.php index 54da48b5..bbebc1ff 100644 --- a/sample/payments/CreatePayment.php +++ b/sample/payments/CreatePayment.php @@ -114,7 +114,7 @@ $payment->create($apiContext); } catch (Exception $ex) { // NOTE: PLEASE DO NOT USE RESULTPRINTER CLASS IN YOUR ORIGINAL CODE. FOR SAMPLE ONLY - ResultPrinter::printError('Create Payment Using Credit Card. If 500 Exception, try creating a new Credit Card using Step 4, on this link, and using it.', 'Payment', null, $request, $ex); + ResultPrinter::printError('Create Payment Using Credit Card. If 500 Exception, try creating a new Credit Card using Step 4, on this link, and using it.', 'Payment', null, $request, $ex); exit(1); } diff --git a/sample/payments/CreatePaymentUsingPayPal.php b/sample/payments/CreatePaymentUsingPayPal.php index 88d5aa5d..47a7925b 100644 --- a/sample/payments/CreatePaymentUsingPayPal.php +++ b/sample/payments/CreatePaymentUsingPayPal.php @@ -101,7 +101,7 @@ $payment->create($apiContext); } catch (Exception $ex) { // NOTE: PLEASE DO NOT USE RESULTPRINTER CLASS IN YOUR ORIGINAL CODE. FOR SAMPLE ONLY - ResultPrinter::printError("Created Payment Using PayPal. Please visit the URL to Approve.", "Payment", null, $request, $ex); + ResultPrinter::printError("Created Payment Using PayPal. Please visit the URL to Approve.", "Payment", null, $request, $ex); exit(1); } diff --git a/sample/payments/CreatePaymentUsingSavedCard.php b/sample/payments/CreatePaymentUsingSavedCard.php index 96f8512b..115bc65b 100644 --- a/sample/payments/CreatePaymentUsingSavedCard.php +++ b/sample/payments/CreatePaymentUsingSavedCard.php @@ -105,7 +105,7 @@ $payment->create($apiContext); } catch (Exception $ex) { // NOTE: PLEASE DO NOT USE RESULTPRINTER CLASS IN YOUR ORIGINAL CODE. FOR SAMPLE ONLY - ResultPrinter::printError("Create Payment using Saved Card", "Payment", null, $request, $ex); + ResultPrinter::printError("Create Payment using Saved Card", "Payment", null, $request, $ex); exit(1); } diff --git a/sample/payments/ExecutePayment.php b/sample/payments/ExecutePayment.php index c1fb9e52..21fc4ef6 100644 --- a/sample/payments/ExecutePayment.php +++ b/sample/payments/ExecutePayment.php @@ -69,12 +69,12 @@ $payment = Payment::get($paymentId, $apiContext); } catch (Exception $ex) { // NOTE: PLEASE DO NOT USE RESULTPRINTER CLASS IN YOUR ORIGINAL CODE. FOR SAMPLE ONLY - ResultPrinter::printError("Get Payment", "Payment", null, null, $ex); + ResultPrinter::printError("Get Payment", "Payment", null, null, $ex); exit(1); } } catch (Exception $ex) { // NOTE: PLEASE DO NOT USE RESULTPRINTER CLASS IN YOUR ORIGINAL CODE. FOR SAMPLE ONLY - ResultPrinter::printError("Executed Payment", "Payment", null, null, $ex); + ResultPrinter::printError("Executed Payment", "Payment", null, null, $ex); exit(1); } @@ -82,8 +82,6 @@ ResultPrinter::printResult("Get Payment", "Payment", $payment->getId(), null, $payment); return $payment; - - } else { // NOTE: PLEASE DO NOT USE RESULTPRINTER CLASS IN YOUR ORIGINAL CODE. FOR SAMPLE ONLY ResultPrinter::printResult("User Cancelled the Approval", null); diff --git a/sample/payments/GetAuthorization.php b/sample/payments/GetAuthorization.php index 6e423af7..674bdf40 100644 --- a/sample/payments/GetAuthorization.php +++ b/sample/payments/GetAuthorization.php @@ -20,7 +20,7 @@ $result = Authorization::get($authorizationId, $apiContext); } catch (Exception $ex) { // NOTE: PLEASE DO NOT USE RESULTPRINTER CLASS IN YOUR ORIGINAL CODE. FOR SAMPLE ONLY - ResultPrinter::printError("Get Authorization", "Authorization", null, null, $ex); + ResultPrinter::printError("Get Authorization", "Authorization", null, null, $ex); exit(1); } diff --git a/sample/payments/GetCapture.php b/sample/payments/GetCapture.php index 19cea3a1..01333f43 100644 --- a/sample/payments/GetCapture.php +++ b/sample/payments/GetCapture.php @@ -16,7 +16,7 @@ $capture = Capture::get($request->getId(), $apiContext); } catch (Exception $ex) { // NOTE: PLEASE DO NOT USE RESULTPRINTER CLASS IN YOUR ORIGINAL CODE. FOR SAMPLE ONLY - ResultPrinter::printError("Get Captured Payment", "Capture", $request->getId(), null, $ex); + ResultPrinter::printError("Get Captured Payment", "Capture", $request->getId(), null, $ex); exit(1); } diff --git a/sample/payments/GetPayment.php b/sample/payments/GetPayment.php index 9df9b665..c77335f0 100644 --- a/sample/payments/GetPayment.php +++ b/sample/payments/GetPayment.php @@ -24,7 +24,7 @@ $payment = Payment::get($paymentId, $apiContext); } catch (Exception $ex) { // NOTE: PLEASE DO NOT USE RESULTPRINTER CLASS IN YOUR ORIGINAL CODE. FOR SAMPLE ONLY - ResultPrinter::printError("Get Payment", "Payment", null, null, $ex); + ResultPrinter::printError("Get Payment", "Payment", null, null, $ex); exit(1); } diff --git a/sample/payments/ListPayments.php b/sample/payments/ListPayments.php index 5811072f..b2c0bafa 100644 --- a/sample/payments/ListPayments.php +++ b/sample/payments/ListPayments.php @@ -12,7 +12,6 @@ require 'CreatePayment.php'; use PayPal\Api\Payment; - // ### Retrieve payment // Retrieve the PaymentHistory object by calling the // static `get` method on the Payment class, @@ -21,13 +20,12 @@ // Refer the method doc for valid values for keys // (See bootstrap.php for more on `ApiContext`) try { - $params = array('count' => 10, 'start_index' => 5); $payments = Payment::all($params, $apiContext); } catch (Exception $ex) { // NOTE: PLEASE DO NOT USE RESULTPRINTER CLASS IN YOUR ORIGINAL CODE. FOR SAMPLE ONLY - ResultPrinter::printError("List Payments", "Payment", null, $params, $ex); + ResultPrinter::printError("List Payments", "Payment", null, $params, $ex); exit(1); } diff --git a/sample/payments/OrderAuthorize.php b/sample/payments/OrderAuthorize.php index 441dfa94..77bb34e2 100644 --- a/sample/payments/OrderAuthorize.php +++ b/sample/payments/OrderAuthorize.php @@ -40,12 +40,11 @@ ResultPrinter::printResult("Authorized Order", "Authorization", $result->getId(), $authorization, $result); } catch (Exception $ex) { // NOTE: PLEASE DO NOT USE RESULTPRINTER CLASS IN YOUR ORIGINAL CODE. FOR SAMPLE ONLY - ResultPrinter::printError("Authorized Order", "Authorization", null, $authorization, $ex); + ResultPrinter::printError("Authorized Order", "Authorization", null, $authorization, $ex); exit(1); } return $result; - } else { // NOTE: PLEASE DO NOT USE RESULTPRINTER CLASS IN YOUR ORIGINAL CODE. FOR SAMPLE ONLY ResultPrinter::printResult("User Cancelled the Approval", null); diff --git a/sample/payments/OrderCapture.php b/sample/payments/OrderCapture.php index d7040811..7a628178 100644 --- a/sample/payments/OrderCapture.php +++ b/sample/payments/OrderCapture.php @@ -41,12 +41,11 @@ ResultPrinter::printResult("Captured Order", "Capture", $result->getId(), $capture, $result); } catch (Exception $ex) { // NOTE: PLEASE DO NOT USE RESULTPRINTER CLASS IN YOUR ORIGINAL CODE. FOR SAMPLE ONLY - ResultPrinter::printError("Captured Order", "Capture", null, $capture, $ex); + ResultPrinter::printError("Captured Order", "Capture", null, $capture, $ex); exit(1); } return $result; - } else { // NOTE: PLEASE DO NOT USE RESULTPRINTER CLASS IN YOUR ORIGINAL CODE. FOR SAMPLE ONLY ResultPrinter::printResult("User Cancelled the Approval", null); diff --git a/sample/payments/OrderCreateForAuthorization.php b/sample/payments/OrderCreateForAuthorization.php index 704e39a5..cbda732d 100644 --- a/sample/payments/OrderCreateForAuthorization.php +++ b/sample/payments/OrderCreateForAuthorization.php @@ -98,7 +98,7 @@ $payment->create($apiContext); } catch (Exception $ex) { // NOTE: PLEASE DO NOT USE RESULTPRINTER CLASS IN YOUR ORIGINAL CODE. FOR SAMPLE ONLY - ResultPrinter::printError("Created Payment Order Using PayPal. Please visit the URL to Approve.", "Payment", null, $request, $ex); + ResultPrinter::printError("Created Payment Order Using PayPal. Please visit the URL to Approve.", "Payment", null, $request, $ex); exit(1); } diff --git a/sample/payments/OrderCreateForCapture.php b/sample/payments/OrderCreateForCapture.php index d0882c47..43ed5222 100644 --- a/sample/payments/OrderCreateForCapture.php +++ b/sample/payments/OrderCreateForCapture.php @@ -98,7 +98,7 @@ $payment->create($apiContext); } catch (Exception $ex) { // NOTE: PLEASE DO NOT USE RESULTPRINTER CLASS IN YOUR ORIGINAL CODE. FOR SAMPLE ONLY - ResultPrinter::printError("Created Payment Order Using PayPal. Please visit the URL to Approve.", "Payment", null, $request, $ex); + ResultPrinter::printError("Created Payment Order Using PayPal. Please visit the URL to Approve.", "Payment", null, $request, $ex); exit(1); } diff --git a/sample/payments/OrderCreateForVoid.php b/sample/payments/OrderCreateForVoid.php index eea420dd..20c67c55 100644 --- a/sample/payments/OrderCreateForVoid.php +++ b/sample/payments/OrderCreateForVoid.php @@ -98,7 +98,7 @@ $payment->create($apiContext); } catch (Exception $ex) { // NOTE: PLEASE DO NOT USE RESULTPRINTER CLASS IN YOUR ORIGINAL CODE. FOR SAMPLE ONLY - ResultPrinter::printError("Created Payment Order Using PayPal. Please visit the URL to Approve.", "Payment", null, $request, $ex); + ResultPrinter::printError("Created Payment Order Using PayPal. Please visit the URL to Approve.", "Payment", null, $request, $ex); exit(1); } diff --git a/sample/payments/OrderCreateUsingPayPal.php b/sample/payments/OrderCreateUsingPayPal.php index f1943944..8750c21e 100644 --- a/sample/payments/OrderCreateUsingPayPal.php +++ b/sample/payments/OrderCreateUsingPayPal.php @@ -98,7 +98,7 @@ $payment->create($apiContext); } catch (Exception $ex) { // NOTE: PLEASE DO NOT USE RESULTPRINTER CLASS IN YOUR ORIGINAL CODE. FOR SAMPLE ONLY - ResultPrinter::printError("Created Payment Order Using PayPal. Please visit the URL to Approve.", "Payment", null, $request, $ex); + ResultPrinter::printError("Created Payment Order Using PayPal. Please visit the URL to Approve.", "Payment", null, $request, $ex); exit(1); } diff --git a/sample/payments/OrderDoVoid.php b/sample/payments/OrderDoVoid.php index 7c0e2870..062d7093 100644 --- a/sample/payments/OrderDoVoid.php +++ b/sample/payments/OrderDoVoid.php @@ -27,12 +27,11 @@ ResultPrinter::printResult("Voided Order", "Order", $result->getId(), null, $result); } catch (Exception $ex) { // NOTE: PLEASE DO NOT USE RESULTPRINTER CLASS IN YOUR ORIGINAL CODE. FOR SAMPLE ONLY - ResultPrinter::printError("Voided Order", "Order", null, null, $ex); + ResultPrinter::printError("Voided Order", "Order", null, null, $ex); exit(1); } return $result; - } else { // NOTE: PLEASE DO NOT USE RESULTPRINTER CLASS IN YOUR ORIGINAL CODE. FOR SAMPLE ONLY ResultPrinter::printResult("User Cancelled the Approval", null); diff --git a/sample/payments/OrderGet.php b/sample/payments/OrderGet.php index 05da1e20..d1d93864 100644 --- a/sample/payments/OrderGet.php +++ b/sample/payments/OrderGet.php @@ -9,7 +9,6 @@ // ### Approval Status // Determine if the user approved the payment or not if (isset($_GET['success']) && $_GET['success'] == 'true') { - $transactions = $payment->getTransactions(); $transaction = $transactions[0]; $relatedResources = $transaction->getRelatedResources(); @@ -22,12 +21,11 @@ ResultPrinter::printResult("Get Order", "Order", $result->getId(), null, $result); } catch (Exception $ex) { // NOTE: PLEASE DO NOT USE RESULTPRINTER CLASS IN YOUR ORIGINAL CODE. FOR SAMPLE ONLY - ResultPrinter::printError("Get Order", "Order", null, null, $ex); + ResultPrinter::printError("Get Order", "Order", null, null, $ex); exit(1); } return $result; - } else { // NOTE: PLEASE DO NOT USE RESULTPRINTER CLASS IN YOUR ORIGINAL CODE. FOR SAMPLE ONLY ResultPrinter::printResult("User Cancelled the Approval", null); diff --git a/sample/payments/Reauthorization.php b/sample/payments/Reauthorization.php index dbebdfa1..3dfd462a 100644 --- a/sample/payments/Reauthorization.php +++ b/sample/payments/Reauthorization.php @@ -17,7 +17,6 @@ // has expired. try { - $amount = new Amount(); $amount->setCurrency("USD"); $amount->setTotal(1); @@ -28,7 +27,7 @@ $reAuthorization = $authorization->reauthorize($apiContext); } catch (Exception $ex) { // NOTE: PLEASE DO NOT USE RESULTPRINTER CLASS IN YOUR ORIGINAL CODE. FOR SAMPLE ONLY - ResultPrinter::printError("Reauthorize Payment", "Payment", null, null, $ex); + ResultPrinter::printError("Reauthorize Payment", "Payment", null, null, $ex); exit(1); } diff --git a/sample/payments/RefundCapture.php b/sample/payments/RefundCapture.php index 1ebbdaf1..9fbc5eb4 100644 --- a/sample/payments/RefundCapture.php +++ b/sample/payments/RefundCapture.php @@ -24,7 +24,7 @@ $captureRefund = $capture->refund($refund, $apiContext); } catch (Exception $ex) { // NOTE: PLEASE DO NOT USE RESULTPRINTER CLASS IN YOUR ORIGINAL CODE. FOR SAMPLE ONLY - ResultPrinter::printError("Refund Capture", "Capture", null, $refund, $ex); + ResultPrinter::printError("Refund Capture", "Capture", null, $refund, $ex); exit(1); } diff --git a/sample/payments/UpdatePayment.php b/sample/payments/UpdatePayment.php index 1f4170bb..f6cad80b 100644 --- a/sample/payments/UpdatePayment.php +++ b/sample/payments/UpdatePayment.php @@ -81,10 +81,9 @@ // (See bootstrap.php for more on `ApiContext`) try { $result = $createdPayment->update($patchRequest, $apiContext); - } catch (Exception $ex) { // NOTE: PLEASE DO NOT USE RESULTPRINTER CLASS IN YOUR ORIGINAL CODE. FOR SAMPLE ONLY - ResultPrinter::printError("Update Payment", "PatchRequest", null, $patchRequest, $ex); + ResultPrinter::printError("Update Payment", "PatchRequest", null, $patchRequest, $ex); exit(1); } diff --git a/sample/payments/VoidAuthorization.php b/sample/payments/VoidAuthorization.php index 2eb59962..e943a3f9 100644 --- a/sample/payments/VoidAuthorization.php +++ b/sample/payments/VoidAuthorization.php @@ -10,7 +10,6 @@ $authorizationId = '1BF65516U6866543H'; // $authorization->getId(); use PayPal\Api\Authorization; - // ### VoidAuthorization // You can void a previously authorized payment // by invoking the $authorization->void method @@ -24,7 +23,7 @@ $voidedAuth = $authorization->void($apiContext); } catch (Exception $ex) { // NOTE: PLEASE DO NOT USE RESULTPRINTER CLASS IN YOUR ORIGINAL CODE. FOR SAMPLE ONLY - ResultPrinter::printError("Void Authorization", "Authorization", null, null, $ex); + ResultPrinter::printError("Void Authorization", "Authorization", null, null, $ex); exit(1); } diff --git a/sample/payouts/CancelPayoutItem.php b/sample/payouts/CancelPayoutItem.php index 0e8aac6e..c1ad421e 100644 --- a/sample/payouts/CancelPayoutItem.php +++ b/sample/payouts/CancelPayoutItem.php @@ -26,11 +26,11 @@ } else { // The item transaction status is not unclaimed. You can only cancel an unclaimed transaction. // NOTE: PLEASE DO NOT USE RESULTPRINTER CLASS IN YOUR ORIGINAL CODE. FOR SAMPLE ONLY - ResultPrinter::printError("Cancel Unclaimed Payout Item", "PayoutItem", null, $payoutItemId, new Exception("Payout Item Status is not UNCLAIMED")); + ResultPrinter::printError("Cancel Unclaimed Payout Item", "PayoutItem", null, $payoutItemId, new Exception("Payout Item Status is not UNCLAIMED")); } } catch (Exception $ex) { // NOTE: PLEASE DO NOT USE RESULTPRINTER CLASS IN YOUR ORIGINAL CODE. FOR SAMPLE ONLY - ResultPrinter::printError("Cancel Unclaimed Payout Item", "PayoutItem", null, $payoutItemId, $ex); + ResultPrinter::printError("Cancel Unclaimed Payout Item", "PayoutItem", null, $payoutItemId, $ex); exit(1); } diff --git a/sample/payouts/CreateBatchPayout.php b/sample/payouts/CreateBatchPayout.php index 5003c93a..a5e9ba19 100644 --- a/sample/payouts/CreateBatchPayout.php +++ b/sample/payouts/CreateBatchPayout.php @@ -116,7 +116,7 @@ $output = $payouts->create(null, $apiContext); } catch (Exception $ex) { // NOTE: PLEASE DO NOT USE RESULTPRINTER CLASS IN YOUR ORIGINAL CODE. FOR SAMPLE ONLY - ResultPrinter::printError("Created Batch Payout", "Payout", null, $request, $ex); + ResultPrinter::printError("Created Batch Payout", "Payout", null, $request, $ex); exit(1); } diff --git a/sample/payouts/CreateSinglePayout.php b/sample/payouts/CreateSinglePayout.php index dd487d94..56708eea 100644 --- a/sample/payouts/CreateSinglePayout.php +++ b/sample/payouts/CreateSinglePayout.php @@ -65,7 +65,7 @@ $output = $payouts->createSynchronous($apiContext); } catch (Exception $ex) { // NOTE: PLEASE DO NOT USE RESULTPRINTER CLASS IN YOUR ORIGINAL CODE. FOR SAMPLE ONLY - ResultPrinter::printError("Created Single Synchronous Payout", "Payout", null, $request, $ex); + ResultPrinter::printError("Created Single Synchronous Payout", "Payout", null, $request, $ex); exit(1); } diff --git a/sample/payouts/GetPayoutBatchStatus.php b/sample/payouts/GetPayoutBatchStatus.php index 6423abd2..68194df5 100644 --- a/sample/payouts/GetPayoutBatchStatus.php +++ b/sample/payouts/GetPayoutBatchStatus.php @@ -17,7 +17,7 @@ $output = \PayPal\Api\Payout::get($payoutBatchId, $apiContext); } catch (Exception $ex) { // NOTE: PLEASE DO NOT USE RESULTPRINTER CLASS IN YOUR ORIGINAL CODE. FOR SAMPLE ONLY - ResultPrinter::printError("Get Payout Batch Status", "PayoutBatch", null, $payoutBatchId, $ex); + ResultPrinter::printError("Get Payout Batch Status", "PayoutBatch", null, $payoutBatchId, $ex); exit(1); } diff --git a/sample/payouts/GetPayoutItemStatus.php b/sample/payouts/GetPayoutItemStatus.php index 6bc577f7..d0eb2878 100644 --- a/sample/payouts/GetPayoutItemStatus.php +++ b/sample/payouts/GetPayoutItemStatus.php @@ -19,7 +19,7 @@ $output = \PayPal\Api\PayoutItem::get($payoutItemId, $apiContext); } catch (Exception $ex) { // NOTE: PLEASE DO NOT USE RESULTPRINTER CLASS IN YOUR ORIGINAL CODE. FOR SAMPLE ONLY - ResultPrinter::printError("Get Payout Item Status", "PayoutItem", null, $payoutItemId, $ex); + ResultPrinter::printError("Get Payout Item Status", "PayoutItem", null, $payoutItemId, $ex); exit(1); } diff --git a/sample/sale/GetSale.php b/sample/sale/GetSale.php index 8b915010..2792b39a 100644 --- a/sample/sale/GetSale.php +++ b/sample/sale/GetSale.php @@ -25,7 +25,7 @@ $sale = Sale::get($saleId, $apiContext); } catch (Exception $ex) { // NOTE: PLEASE DO NOT USE RESULTPRINTER CLASS IN YOUR ORIGINAL CODE. FOR SAMPLE ONLY - ResultPrinter::printError("Look Up A Sale", "Sale", $sale->getId(), null, $ex); + ResultPrinter::printError("Look Up A Sale", "Sale", $sale->getId(), null, $ex); exit(1); } diff --git a/sample/sale/RefundSale.php b/sample/sale/RefundSale.php index ef51d1ee..ccf3b278 100644 --- a/sample/sale/RefundSale.php +++ b/sample/sale/RefundSale.php @@ -42,7 +42,7 @@ $refundedSale = $sale->refund($refund, $apiContext); } catch (Exception $ex) { // NOTE: PLEASE DO NOT USE RESULTPRINTER CLASS IN YOUR ORIGINAL CODE. FOR SAMPLE ONLY - ResultPrinter::printError("Refund Sale", "Sale", $refundedSale->getId(), $refund, $ex); + ResultPrinter::printError("Refund Sale", "Sale", $refundedSale->getId(), $refund, $ex); exit(1); } diff --git a/sample/vault/CreateBankAccount.php b/sample/vault/CreateBankAccount.php index aeda49bf..d8952aa8 100644 --- a/sample/vault/CreateBankAccount.php +++ b/sample/vault/CreateBankAccount.php @@ -73,7 +73,7 @@ $bankAccount->create($apiContext); } catch (Exception $ex) { // NOTE: PLEASE DO NOT USE RESULTPRINTER CLASS IN YOUR ORIGINAL CODE. FOR SAMPLE ONLY - ResultPrinter::printError("Create Bank Account", "Bank Account", null, $request, $ex); + ResultPrinter::printError("Create Bank Account", "Bank Account", null, $request, $ex); exit(1); } diff --git a/sample/vault/CreateCreditCard.php b/sample/vault/CreateCreditCard.php index e025b9a4..d1b98d77 100644 --- a/sample/vault/CreateCreditCard.php +++ b/sample/vault/CreateCreditCard.php @@ -46,7 +46,7 @@ $card->create($apiContext); } catch (Exception $ex) { // NOTE: PLEASE DO NOT USE RESULTPRINTER CLASS IN YOUR ORIGINAL CODE. FOR SAMPLE ONLY - ResultPrinter::printError("Create Credit Card", "Credit Card", null, $request, $ex); + ResultPrinter::printError("Create Credit Card", "Credit Card", null, $request, $ex); exit(1); } diff --git a/sample/vault/DeleteBankAccount.php b/sample/vault/DeleteBankAccount.php index 48b38356..b4d79143 100644 --- a/sample/vault/DeleteBankAccount.php +++ b/sample/vault/DeleteBankAccount.php @@ -15,7 +15,7 @@ $bankAccount->delete($apiContext); } catch (Exception $ex) { // NOTE: PLEASE DO NOT USE RESULTPRINTER CLASS IN YOUR ORIGINAL CODE. FOR SAMPLE ONLY - ResultPrinter::printError("Delete Bank Account", "Bank Account", null, null, $ex); + ResultPrinter::printError("Delete Bank Account", "Bank Account", null, null, $ex); exit(1); } diff --git a/sample/vault/DeleteCreditCard.php b/sample/vault/DeleteCreditCard.php index 3676f58d..b5e24f5c 100644 --- a/sample/vault/DeleteCreditCard.php +++ b/sample/vault/DeleteCreditCard.php @@ -16,7 +16,7 @@ $card->delete($apiContext); } catch (Exception $ex) { // NOTE: PLEASE DO NOT USE RESULTPRINTER CLASS IN YOUR ORIGINAL CODE. FOR SAMPLE ONLY - ResultPrinter::printError("Delete Credit Card", "Credit Card", null, null, $ex); + ResultPrinter::printError("Delete Credit Card", "Credit Card", null, null, $ex); exit(1); } diff --git a/sample/vault/GetBankAccount.php b/sample/vault/GetBankAccount.php index 721f2874..a76f51bf 100644 --- a/sample/vault/GetBankAccount.php +++ b/sample/vault/GetBankAccount.php @@ -17,7 +17,7 @@ $bankAccount = \PayPal\Api\BankAccount::get($bankAccount->getId(), $apiContext); } catch (Exception $ex) { // NOTE: PLEASE DO NOT USE RESULTPRINTER CLASS IN YOUR ORIGINAL CODE. FOR SAMPLE ONLY - ResultPrinter::printError("Get Bank Account", "Bank Account", $bankAccount->getId(), null, $ex); + ResultPrinter::printError("Get Bank Account", "Bank Account", $bankAccount->getId(), null, $ex); exit(1); } diff --git a/sample/vault/GetCreditCard.php b/sample/vault/GetCreditCard.php index e106d979..f183c022 100644 --- a/sample/vault/GetCreditCard.php +++ b/sample/vault/GetCreditCard.php @@ -18,7 +18,7 @@ $card = CreditCard::get($card->getId(), $apiContext); } catch (Exception $ex) { // NOTE: PLEASE DO NOT USE RESULTPRINTER CLASS IN YOUR ORIGINAL CODE. FOR SAMPLE ONLY - ResultPrinter::printError("Get Credit Card", "Credit Card", $card->getId(), null, $ex); + ResultPrinter::printError("Get Credit Card", "Credit Card", $card->getId(), null, $ex); exit(1); } diff --git a/sample/vault/ListCreditCards.php b/sample/vault/ListCreditCards.php index 8cd5d814..a198b19d 100644 --- a/sample/vault/ListCreditCards.php +++ b/sample/vault/ListCreditCards.php @@ -26,7 +26,7 @@ $cards = CreditCard::all($params, $apiContext); } catch (Exception $ex) { // NOTE: PLEASE DO NOT USE RESULTPRINTER CLASS IN YOUR ORIGINAL CODE. FOR SAMPLE ONLY - ResultPrinter::printError("List All Credit Cards", "CreditCardList", null, $params, $ex); + ResultPrinter::printError("List All Credit Cards", "CreditCardList", null, $params, $ex); exit(1); } diff --git a/sample/vault/UpdateCreditCard.php b/sample/vault/UpdateCreditCard.php index 9e659448..880cdc88 100644 --- a/sample/vault/UpdateCreditCard.php +++ b/sample/vault/UpdateCreditCard.php @@ -43,7 +43,7 @@ $card = $card->update($pathRequest, $apiContext); } catch (Exception $ex) { // NOTE: PLEASE DO NOT USE RESULTPRINTER CLASS IN YOUR ORIGINAL CODE. FOR SAMPLE ONLY - ResultPrinter::printError("Updated Credit Card", "Credit Card", $card->getId(), $pathRequest, $ex); + ResultPrinter::printError("Updated Credit Card", "Credit Card", $card->getId(), $pathRequest, $ex); exit(1); } From 8c907803e37653f5b5d7f4c03a5685a016f81510 Mon Sep 17 00:00:00 2001 From: Jay Patel Date: Thu, 14 Jul 2016 13:09:36 -0500 Subject: [PATCH 3/3] [PSR] Fixed Samples - Using `php-cs-fixer` tool. --- tests/PayPal/Test/Api/AddressTest.php | 2 -- .../PayPal/Test/Api/AgreementStateDescriptorTest.php | 1 - tests/PayPal/Test/Api/AgreementTransactionTest.php | 1 - tests/PayPal/Test/Api/AgreementTransactionsTest.php | 1 - tests/PayPal/Test/Api/AlternatePaymentTest.php | 2 -- tests/PayPal/Test/Api/AmountTest.php | 2 -- tests/PayPal/Test/Api/BankAccountTest.php | 2 -- tests/PayPal/Test/Api/BankAccountsListTest.php | 1 - tests/PayPal/Test/Api/BankTokenTest.php | 2 -- tests/PayPal/Test/Api/BillingInfoTest.php | 1 - tests/PayPal/Test/Api/BillingTest.php | 2 -- tests/PayPal/Test/Api/CancelNotificationTest.php | 1 - tests/PayPal/Test/Api/CarrierAccountTest.php | 2 -- tests/PayPal/Test/Api/CarrierAccountTokenTest.php | 2 -- tests/PayPal/Test/Api/CartBaseTest.php | 1 - tests/PayPal/Test/Api/ChargeModelTest.php | 1 - tests/PayPal/Test/Api/CostTest.php | 1 - tests/PayPal/Test/Api/CountryCodeTest.php | 2 -- tests/PayPal/Test/Api/CreateProfileResponseTest.php | 1 - tests/PayPal/Test/Api/CreditCardHistoryTest.php | 1 - tests/PayPal/Test/Api/CreditCardListTest.php | 1 - tests/PayPal/Test/Api/CreditCardTest.php | 2 -- tests/PayPal/Test/Api/CreditCardTokenTest.php | 2 -- tests/PayPal/Test/Api/CreditFinancingOfferedTest.php | 2 -- tests/PayPal/Test/Api/CreditTest.php | 2 -- tests/PayPal/Test/Api/CurrencyConversionTest.php | 1 - tests/PayPal/Test/Api/CurrencyTest.php | 2 -- tests/PayPal/Test/Api/CustomAmountTest.php | 1 - tests/PayPal/Test/Api/DetailsTest.php | 2 -- tests/PayPal/Test/Api/ErrorDetailsTest.php | 2 -- tests/PayPal/Test/Api/ErrorTest.php | 2 -- tests/PayPal/Test/Api/ExtendedBankAccountTest.php | 2 -- tests/PayPal/Test/Api/ExternalFundingTest.php | 2 -- tests/PayPal/Test/Api/FileAttachmentTest.php | 1 - tests/PayPal/Test/Api/FlowConfigTest.php | 1 - tests/PayPal/Test/Api/FmfDetailsTest.php | 2 -- tests/PayPal/Test/Api/FundingDetailTest.php | 2 -- tests/PayPal/Test/Api/FundingInstrumentTest.php | 2 -- tests/PayPal/Test/Api/FundingOptionTest.php | 2 -- tests/PayPal/Test/Api/FundingSourceTest.php | 2 -- tests/PayPal/Test/Api/HyperSchemaTest.php | 1 - tests/PayPal/Test/Api/ImageTest.php | 1 - tests/PayPal/Test/Api/IncentiveTest.php | 1 - tests/PayPal/Test/Api/InputFieldsTest.php | 1 - tests/PayPal/Test/Api/InstallmentInfoTest.php | 2 -- tests/PayPal/Test/Api/InstallmentOptionTest.php | 2 -- tests/PayPal/Test/Api/InvoiceAddressTest.php | 1 - tests/PayPal/Test/Api/InvoiceItemTest.php | 1 - tests/PayPal/Test/Api/InvoiceNumberTest.php | 3 +-- tests/PayPal/Test/Api/InvoiceSearchResponseTest.php | 1 - tests/PayPal/Test/Api/ItemListTest.php | 2 -- tests/PayPal/Test/Api/ItemTest.php | 1 - tests/PayPal/Test/Api/LinksTest.php | 1 - tests/PayPal/Test/Api/MeasurementTest.php | 2 -- tests/PayPal/Test/Api/MerchantInfoTest.php | 1 - tests/PayPal/Test/Api/MerchantPreferencesTest.php | 1 - tests/PayPal/Test/Api/MetadataTest.php | 1 - tests/PayPal/Test/Api/NameValuePairTest.php | 2 -- tests/PayPal/Test/Api/NotificationTest.php | 2 -- tests/PayPal/Test/Api/OpenIdSessionTest.php | 3 --- tests/PayPal/Test/Api/OpenIdTokeninfoTest.php | 2 -- tests/PayPal/Test/Api/OverrideChargeModelTest.php | 1 - tests/PayPal/Test/Api/ParticipantTest.php | 2 -- tests/PayPal/Test/Api/PatchRequestTest.php | 1 - tests/PayPal/Test/Api/PatchTest.php | 2 -- tests/PayPal/Test/Api/PayeeTest.php | 2 -- tests/PayPal/Test/Api/PayerInfoTest.php | 2 -- tests/PayPal/Test/Api/PayerTest.php | 2 -- tests/PayPal/Test/Api/PaymentCardTest.php | 2 -- tests/PayPal/Test/Api/PaymentCardTokenTest.php | 1 - tests/PayPal/Test/Api/PaymentDefinitionTest.php | 1 - tests/PayPal/Test/Api/PaymentDetailTest.php | 1 - tests/PayPal/Test/Api/PaymentExecutionTest.php | 2 -- tests/PayPal/Test/Api/PaymentHistoryTest.php | 2 -- tests/PayPal/Test/Api/PaymentOptionsTest.php | 2 -- tests/PayPal/Test/Api/PaymentSummaryTest.php | 2 -- tests/PayPal/Test/Api/PaymentTermTest.php | 1 - tests/PayPal/Test/Api/PayoutBatchHeaderTest.php | 1 - tests/PayPal/Test/Api/PayoutBatchTest.php | 1 - tests/PayPal/Test/Api/PayoutItemDetailsTest.php | 1 - .../PayPal/Test/Api/PayoutSenderBatchHeaderTest.php | 1 - tests/PayPal/Test/Api/PhoneTest.php | 2 -- tests/PayPal/Test/Api/PlanListTest.php | 1 - tests/PayPal/Test/Api/PotentialPayerInfoTest.php | 2 -- tests/PayPal/Test/Api/PresentationTest.php | 1 - tests/PayPal/Test/Api/PrivateLabelCardTest.php | 2 -- tests/PayPal/Test/Api/ProcessorResponseTest.php | 2 -- .../Test/Api/RecipientBankingInstructionTest.php | 2 -- tests/PayPal/Test/Api/RedirectUrlsTest.php | 1 - tests/PayPal/Test/Api/RefundDetailTest.php | 2 -- tests/PayPal/Test/Api/RelatedResourcesTest.php | 2 -- tests/PayPal/Test/Api/SearchTest.php | 1 - tests/PayPal/Test/Api/ShippingAddressTest.php | 2 -- tests/PayPal/Test/Api/ShippingCostTest.php | 1 - tests/PayPal/Test/Api/ShippingInfoTest.php | 1 - tests/PayPal/Test/Api/TaxTest.php | 1 - tests/PayPal/Test/Api/TemplateDataTest.php | 1 - .../PayPal/Test/Api/TemplateSettingsMetadataTest.php | 2 -- tests/PayPal/Test/Api/TemplateSettingsTest.php | 2 -- tests/PayPal/Test/Api/TemplateTest.php | 2 -- tests/PayPal/Test/Api/TermsTest.php | 1 - tests/PayPal/Test/Api/TransactionTest.php | 2 -- tests/PayPal/Test/Api/WebhookEventListTest.php | 1 - tests/PayPal/Test/Api/WebhookEventTest.php | 3 +-- tests/PayPal/Test/Api/WebhookEventTypeListTest.php | 1 - tests/PayPal/Test/Api/WebhookListTest.php | 1 - tests/PayPal/Test/Auth/OAuthTokenCredentialTest.php | 6 +----- tests/PayPal/Test/Cache/AuthorizationCacheTest.php | 2 -- tests/PayPal/Test/Common/ArrayUtilTest.php | 1 - tests/PayPal/Test/Common/ChildClass.php | 1 - tests/PayPal/Test/Common/FormatConverterTest.php | 1 - tests/PayPal/Test/Common/ModelTest.php | 2 -- tests/PayPal/Test/Common/PayPalModelTest.php | 12 +----------- tests/PayPal/Test/Core/PayPalHttpConfigTest.php | 3 --- tests/PayPal/Test/Core/PayPalLoggingManagerTest.php | 3 --- .../Exception/PayPalConfigurationExceptionTest.php | 2 -- .../Test/Exception/PayPalConnectionExceptionTest.php | 2 -- .../PayPalInvalidCredentialExceptionTest.php | 2 -- .../PayPalMissingCredentialExceptionTest.php | 2 -- .../Api/BillingAgreementsFunctionalTest.php | 1 - .../Functional/Api/BillingPlansFunctionalTest.php | 2 -- .../Test/Functional/Api/InvoiceFunctionalTest.php | 4 +--- .../Test/Functional/Api/PayoutsFunctionalTest.php | 1 - .../Test/Functional/Api/WebProfileFunctionalTest.php | 2 -- .../Test/Functional/Api/WebhookFunctionalTest.php | 4 ++-- tests/PayPal/Test/Handler/OauthHandlerTest.php | 3 --- tests/PayPal/Test/Rest/ApiContextTest.php | 1 - .../PayPal/Test/Validation/ArgumentValidatorTest.php | 1 - .../PayPal/Test/Validation/NumericValidatorTest.php | 3 +-- tests/PayPal/Test/Validation/UrlValidatorTest.php | 3 +-- 130 files changed, 9 insertions(+), 220 deletions(-) diff --git a/tests/PayPal/Test/Api/AddressTest.php b/tests/PayPal/Test/Api/AddressTest.php index b3ebcf92..bfac0655 100644 --- a/tests/PayPal/Test/Api/AddressTest.php +++ b/tests/PayPal/Test/Api/AddressTest.php @@ -70,6 +70,4 @@ public function testGetters($obj) $this->assertEquals($obj->getNormalizationStatus(), "TestSample"); $this->assertEquals($obj->getStatus(), "TestSample"); } - - } diff --git a/tests/PayPal/Test/Api/AgreementStateDescriptorTest.php b/tests/PayPal/Test/Api/AgreementStateDescriptorTest.php index 30996069..f6737e5a 100644 --- a/tests/PayPal/Test/Api/AgreementStateDescriptorTest.php +++ b/tests/PayPal/Test/Api/AgreementStateDescriptorTest.php @@ -53,5 +53,4 @@ public function testGetters($obj) $this->assertEquals($obj->getNote(), "TestSample"); $this->assertEquals($obj->getAmount(), CurrencyTest::getObject()); } - } diff --git a/tests/PayPal/Test/Api/AgreementTransactionTest.php b/tests/PayPal/Test/Api/AgreementTransactionTest.php index 47f02cae..2cea2007 100644 --- a/tests/PayPal/Test/Api/AgreementTransactionTest.php +++ b/tests/PayPal/Test/Api/AgreementTransactionTest.php @@ -69,5 +69,4 @@ public function testGetters($obj) $this->assertEquals($obj->getTimeStamp(), "TestSample"); $this->assertEquals($obj->getTimeZone(), "TestSample"); } - } diff --git a/tests/PayPal/Test/Api/AgreementTransactionsTest.php b/tests/PayPal/Test/Api/AgreementTransactionsTest.php index 5d513d2d..7abf98b0 100644 --- a/tests/PayPal/Test/Api/AgreementTransactionsTest.php +++ b/tests/PayPal/Test/Api/AgreementTransactionsTest.php @@ -51,5 +51,4 @@ public function testGetters($obj) { $this->assertEquals($obj->getAgreementTransactionList(), AgreementTransactionTest::getObject()); } - } diff --git a/tests/PayPal/Test/Api/AlternatePaymentTest.php b/tests/PayPal/Test/Api/AlternatePaymentTest.php index 13d9eeee..73c218a5 100644 --- a/tests/PayPal/Test/Api/AlternatePaymentTest.php +++ b/tests/PayPal/Test/Api/AlternatePaymentTest.php @@ -55,6 +55,4 @@ public function testGetters($obj) $this->assertEquals($obj->getExternalCustomerId(), "TestSample"); $this->assertEquals($obj->getAlternatePaymentProviderId(), "TestSample"); } - - } diff --git a/tests/PayPal/Test/Api/AmountTest.php b/tests/PayPal/Test/Api/AmountTest.php index ecd40618..ba511781 100644 --- a/tests/PayPal/Test/Api/AmountTest.php +++ b/tests/PayPal/Test/Api/AmountTest.php @@ -58,6 +58,4 @@ public function testGetters($obj) $this->assertEquals($obj->getTotal(), "12.34"); $this->assertEquals($obj->getDetails(), DetailsTest::getObject()); } - - } diff --git a/tests/PayPal/Test/Api/BankAccountTest.php b/tests/PayPal/Test/Api/BankAccountTest.php index d97cc5f0..8e21719f 100644 --- a/tests/PayPal/Test/Api/BankAccountTest.php +++ b/tests/PayPal/Test/Api/BankAccountTest.php @@ -100,6 +100,4 @@ public function testGetters($obj) $this->assertEquals($obj->getValidUntil(), "TestSample"); $this->assertEquals($obj->getLinks(), LinksTest::getObject()); } - - } diff --git a/tests/PayPal/Test/Api/BankAccountsListTest.php b/tests/PayPal/Test/Api/BankAccountsListTest.php index d834f3ff..1736e28d 100644 --- a/tests/PayPal/Test/Api/BankAccountsListTest.php +++ b/tests/PayPal/Test/Api/BankAccountsListTest.php @@ -55,5 +55,4 @@ public function testGetters($obj) $this->assertEquals($obj->getCount(), 123); $this->assertEquals($obj->getNextId(), "TestSample"); } - } diff --git a/tests/PayPal/Test/Api/BankTokenTest.php b/tests/PayPal/Test/Api/BankTokenTest.php index 659ff15b..f0a3206a 100644 --- a/tests/PayPal/Test/Api/BankTokenTest.php +++ b/tests/PayPal/Test/Api/BankTokenTest.php @@ -58,6 +58,4 @@ public function testGetters($obj) $this->assertEquals($obj->getExternalCustomerId(), "TestSample"); $this->assertEquals($obj->getMandateReferenceNumber(), "TestSample"); } - - } diff --git a/tests/PayPal/Test/Api/BillingInfoTest.php b/tests/PayPal/Test/Api/BillingInfoTest.php index 540b937b..b5b2188b 100644 --- a/tests/PayPal/Test/Api/BillingInfoTest.php +++ b/tests/PayPal/Test/Api/BillingInfoTest.php @@ -67,5 +67,4 @@ public function testGetters($obj) $this->assertEquals($obj->getNotificationChannel(), "TestSample"); $this->assertEquals($obj->getPhone(), PhoneTest::getObject()); } - } diff --git a/tests/PayPal/Test/Api/BillingTest.php b/tests/PayPal/Test/Api/BillingTest.php index b30210b5..332c4889 100644 --- a/tests/PayPal/Test/Api/BillingTest.php +++ b/tests/PayPal/Test/Api/BillingTest.php @@ -51,6 +51,4 @@ public function testGetters($obj) { $this->assertEquals($obj->getBillingAgreementId(), "TestSample"); } - - } diff --git a/tests/PayPal/Test/Api/CancelNotificationTest.php b/tests/PayPal/Test/Api/CancelNotificationTest.php index 6454cc2b..685a450e 100644 --- a/tests/PayPal/Test/Api/CancelNotificationTest.php +++ b/tests/PayPal/Test/Api/CancelNotificationTest.php @@ -57,5 +57,4 @@ public function testGetters($obj) $this->assertEquals($obj->getSendToMerchant(), true); $this->assertEquals($obj->getSendToPayer(), true); } - } diff --git a/tests/PayPal/Test/Api/CarrierAccountTest.php b/tests/PayPal/Test/Api/CarrierAccountTest.php index c4cef656..1efd2c68 100644 --- a/tests/PayPal/Test/Api/CarrierAccountTest.php +++ b/tests/PayPal/Test/Api/CarrierAccountTest.php @@ -59,6 +59,4 @@ public function testGetters($obj) $this->assertEquals($obj->getPhoneSource(), "TestSample"); $this->assertEquals($obj->getCountryCode(), CountryCodeTest::getObject()); } - - } diff --git a/tests/PayPal/Test/Api/CarrierAccountTokenTest.php b/tests/PayPal/Test/Api/CarrierAccountTokenTest.php index dfb909a5..c4986c3d 100644 --- a/tests/PayPal/Test/Api/CarrierAccountTokenTest.php +++ b/tests/PayPal/Test/Api/CarrierAccountTokenTest.php @@ -56,6 +56,4 @@ public function testGetters($obj) $this->assertEquals($obj->getCarrierAccountId(), "TestSample"); $this->assertEquals($obj->getExternalCustomerId(), "TestSample"); } - - } diff --git a/tests/PayPal/Test/Api/CartBaseTest.php b/tests/PayPal/Test/Api/CartBaseTest.php index 73ec0b37..e2e2037f 100644 --- a/tests/PayPal/Test/Api/CartBaseTest.php +++ b/tests/PayPal/Test/Api/CartBaseTest.php @@ -100,5 +100,4 @@ public function testUrlValidationForOrderUrl() $obj = new CartBase(); $obj->setOrderUrl(null); } - } diff --git a/tests/PayPal/Test/Api/ChargeModelTest.php b/tests/PayPal/Test/Api/ChargeModelTest.php index 46f4d2a5..d375008e 100644 --- a/tests/PayPal/Test/Api/ChargeModelTest.php +++ b/tests/PayPal/Test/Api/ChargeModelTest.php @@ -55,5 +55,4 @@ public function testGetters($obj) $this->assertEquals($obj->getType(), "TestSample"); $this->assertEquals($obj->getAmount(), CurrencyTest::getObject()); } - } diff --git a/tests/PayPal/Test/Api/CostTest.php b/tests/PayPal/Test/Api/CostTest.php index 61e38612..970c6321 100644 --- a/tests/PayPal/Test/Api/CostTest.php +++ b/tests/PayPal/Test/Api/CostTest.php @@ -53,5 +53,4 @@ public function testGetters($obj) $this->assertEquals($obj->getPercent(), "12.34"); $this->assertEquals($obj->getAmount(), CurrencyTest::getObject()); } - } diff --git a/tests/PayPal/Test/Api/CountryCodeTest.php b/tests/PayPal/Test/Api/CountryCodeTest.php index f5cbded3..6ddda751 100644 --- a/tests/PayPal/Test/Api/CountryCodeTest.php +++ b/tests/PayPal/Test/Api/CountryCodeTest.php @@ -51,6 +51,4 @@ public function testGetters($obj) { $this->assertEquals($obj->getCountryCode(), "TestSample"); } - - } diff --git a/tests/PayPal/Test/Api/CreateProfileResponseTest.php b/tests/PayPal/Test/Api/CreateProfileResponseTest.php index ec2da485..88138cd2 100644 --- a/tests/PayPal/Test/Api/CreateProfileResponseTest.php +++ b/tests/PayPal/Test/Api/CreateProfileResponseTest.php @@ -51,5 +51,4 @@ public function testGetters($obj) { $this->assertEquals($obj->getId(), "TestSample"); } - } diff --git a/tests/PayPal/Test/Api/CreditCardHistoryTest.php b/tests/PayPal/Test/Api/CreditCardHistoryTest.php index 14dd6a97..9308bb2a 100644 --- a/tests/PayPal/Test/Api/CreditCardHistoryTest.php +++ b/tests/PayPal/Test/Api/CreditCardHistoryTest.php @@ -39,7 +39,6 @@ public static function createCreditCard() public function setup() { - $card = self::createCreditCard(); $card->setBillingAddress(AddressTest::getObject()); $card->setLinks(array(LinksTest::getObject())); diff --git a/tests/PayPal/Test/Api/CreditCardListTest.php b/tests/PayPal/Test/Api/CreditCardListTest.php index 3a266c90..fb1f81d5 100644 --- a/tests/PayPal/Test/Api/CreditCardListTest.php +++ b/tests/PayPal/Test/Api/CreditCardListTest.php @@ -57,5 +57,4 @@ public function testGetters($obj) $this->assertEquals($obj->getTotalItems(), 123); $this->assertEquals($obj->getTotalPages(), 123); } - } diff --git a/tests/PayPal/Test/Api/CreditCardTest.php b/tests/PayPal/Test/Api/CreditCardTest.php index 0eb4f7c7..681ed1df 100644 --- a/tests/PayPal/Test/Api/CreditCardTest.php +++ b/tests/PayPal/Test/Api/CreditCardTest.php @@ -78,6 +78,4 @@ public function testGetters($obj) $this->assertEquals($obj->getValidUntil(), "TestSample"); $this->assertEquals($obj->getLinks(), LinksTest::getObject()); } - - } diff --git a/tests/PayPal/Test/Api/CreditCardTokenTest.php b/tests/PayPal/Test/Api/CreditCardTokenTest.php index 21aa2093..2d6bab11 100644 --- a/tests/PayPal/Test/Api/CreditCardTokenTest.php +++ b/tests/PayPal/Test/Api/CreditCardTokenTest.php @@ -64,6 +64,4 @@ public function testGetters($obj) $this->assertEquals($obj->getExpireMonth(), 123); $this->assertEquals($obj->getExpireYear(), 123); } - - } diff --git a/tests/PayPal/Test/Api/CreditFinancingOfferedTest.php b/tests/PayPal/Test/Api/CreditFinancingOfferedTest.php index 878371ac..c8d82082 100644 --- a/tests/PayPal/Test/Api/CreditFinancingOfferedTest.php +++ b/tests/PayPal/Test/Api/CreditFinancingOfferedTest.php @@ -61,6 +61,4 @@ public function testGetters($obj) $this->assertEquals($obj->getPayerAcceptance(), true); $this->assertEquals($obj->getCartAmountImmutable(), true); } - - } diff --git a/tests/PayPal/Test/Api/CreditTest.php b/tests/PayPal/Test/Api/CreditTest.php index 56cca3f7..51f91378 100644 --- a/tests/PayPal/Test/Api/CreditTest.php +++ b/tests/PayPal/Test/Api/CreditTest.php @@ -56,6 +56,4 @@ public function testGetters($obj) $this->assertEquals($obj->getId(), "TestSample"); $this->assertEquals($obj->getType(), "TestSample"); } - - } diff --git a/tests/PayPal/Test/Api/CurrencyConversionTest.php b/tests/PayPal/Test/Api/CurrencyConversionTest.php index 9027f3b2..1b1c2133 100644 --- a/tests/PayPal/Test/Api/CurrencyConversionTest.php +++ b/tests/PayPal/Test/Api/CurrencyConversionTest.php @@ -87,5 +87,4 @@ public function testUrlValidationForWebUrlDeprecated() $obj->setWebUrl(null); $this->assertNull($obj->getWebUrl()); } - } diff --git a/tests/PayPal/Test/Api/CurrencyTest.php b/tests/PayPal/Test/Api/CurrencyTest.php index 19cc0cf8..38dfeea0 100644 --- a/tests/PayPal/Test/Api/CurrencyTest.php +++ b/tests/PayPal/Test/Api/CurrencyTest.php @@ -56,6 +56,4 @@ public function testGetters($obj) $this->assertEquals($obj->getCurrency(), "TestSample"); $this->assertEquals($obj->getValue(), "12.34"); } - - } diff --git a/tests/PayPal/Test/Api/CustomAmountTest.php b/tests/PayPal/Test/Api/CustomAmountTest.php index 1b8d1a45..7c02682c 100644 --- a/tests/PayPal/Test/Api/CustomAmountTest.php +++ b/tests/PayPal/Test/Api/CustomAmountTest.php @@ -53,5 +53,4 @@ public function testGetters($obj) $this->assertEquals($obj->getLabel(), "TestSample"); $this->assertEquals($obj->getAmount(), CurrencyTest::getObject()); } - } diff --git a/tests/PayPal/Test/Api/DetailsTest.php b/tests/PayPal/Test/Api/DetailsTest.php index a1e708fc..78e03273 100644 --- a/tests/PayPal/Test/Api/DetailsTest.php +++ b/tests/PayPal/Test/Api/DetailsTest.php @@ -68,6 +68,4 @@ public function testGetters($obj) $this->assertEquals($obj->getGiftWrap(), "12.34"); $this->assertEquals($obj->getFee(), "12.34"); } - - } diff --git a/tests/PayPal/Test/Api/ErrorDetailsTest.php b/tests/PayPal/Test/Api/ErrorDetailsTest.php index 60b9e773..292c6fd2 100644 --- a/tests/PayPal/Test/Api/ErrorDetailsTest.php +++ b/tests/PayPal/Test/Api/ErrorDetailsTest.php @@ -60,6 +60,4 @@ public function testGetters($obj) $this->assertEquals($obj->getPurchaseUnitReferenceId(), "TestSample"); $this->assertEquals($obj->getCode(), "TestSample"); } - - } diff --git a/tests/PayPal/Test/Api/ErrorTest.php b/tests/PayPal/Test/Api/ErrorTest.php index 4d12f3fc..c20a5848 100644 --- a/tests/PayPal/Test/Api/ErrorTest.php +++ b/tests/PayPal/Test/Api/ErrorTest.php @@ -72,6 +72,4 @@ public function testGetters($obj) $this->assertEquals($obj->getDebugId(), "TestSample"); $this->assertEquals($obj->getLinks(), LinksTest::getObject()); } - - } diff --git a/tests/PayPal/Test/Api/ExtendedBankAccountTest.php b/tests/PayPal/Test/Api/ExtendedBankAccountTest.php index fc9533fa..edb427d9 100644 --- a/tests/PayPal/Test/Api/ExtendedBankAccountTest.php +++ b/tests/PayPal/Test/Api/ExtendedBankAccountTest.php @@ -54,6 +54,4 @@ public function testGetters($obj) { $this->assertEquals($obj->getMandateReferenceNumber(), "TestSample"); } - - } diff --git a/tests/PayPal/Test/Api/ExternalFundingTest.php b/tests/PayPal/Test/Api/ExternalFundingTest.php index f3fadd53..2e85b44a 100644 --- a/tests/PayPal/Test/Api/ExternalFundingTest.php +++ b/tests/PayPal/Test/Api/ExternalFundingTest.php @@ -59,6 +59,4 @@ public function testGetters($obj) $this->assertEquals($obj->getDisplayText(), "TestSample"); $this->assertEquals($obj->getAmount(), AmountTest::getObject()); } - - } diff --git a/tests/PayPal/Test/Api/FileAttachmentTest.php b/tests/PayPal/Test/Api/FileAttachmentTest.php index b0911647..15bc029b 100644 --- a/tests/PayPal/Test/Api/FileAttachmentTest.php +++ b/tests/PayPal/Test/Api/FileAttachmentTest.php @@ -64,5 +64,4 @@ public function testUrlValidationForUrl() $obj = new FileAttachment(); $obj->setUrl(null); } - } diff --git a/tests/PayPal/Test/Api/FlowConfigTest.php b/tests/PayPal/Test/Api/FlowConfigTest.php index 76448396..3c244573 100644 --- a/tests/PayPal/Test/Api/FlowConfigTest.php +++ b/tests/PayPal/Test/Api/FlowConfigTest.php @@ -63,5 +63,4 @@ public function testUrlValidationForBankTxnPendingUrl() $obj = new FlowConfig(); $obj->setBankTxnPendingUrl(null); } - } diff --git a/tests/PayPal/Test/Api/FmfDetailsTest.php b/tests/PayPal/Test/Api/FmfDetailsTest.php index 96eb7ad8..1a06b7bf 100644 --- a/tests/PayPal/Test/Api/FmfDetailsTest.php +++ b/tests/PayPal/Test/Api/FmfDetailsTest.php @@ -60,6 +60,4 @@ public function testGetters($obj) $this->assertEquals($obj->getName(), "TestSample"); $this->assertEquals($obj->getDescription(), "TestSample"); } - - } diff --git a/tests/PayPal/Test/Api/FundingDetailTest.php b/tests/PayPal/Test/Api/FundingDetailTest.php index 9f1f9476..09600730 100644 --- a/tests/PayPal/Test/Api/FundingDetailTest.php +++ b/tests/PayPal/Test/Api/FundingDetailTest.php @@ -60,6 +60,4 @@ public function testGetters($obj) $this->assertEquals($obj->getPaymentDebitDate(), "TestSample"); $this->assertEquals($obj->getProcessingType(), "TestSample"); } - - } diff --git a/tests/PayPal/Test/Api/FundingInstrumentTest.php b/tests/PayPal/Test/Api/FundingInstrumentTest.php index a3291716..401113ad 100644 --- a/tests/PayPal/Test/Api/FundingInstrumentTest.php +++ b/tests/PayPal/Test/Api/FundingInstrumentTest.php @@ -78,6 +78,4 @@ public function testGetters($obj) $this->assertEquals($obj->getBilling(), BillingTest::getObject()); $this->assertEquals($obj->getAlternatePayment(), AlternatePaymentTest::getObject()); } - - } diff --git a/tests/PayPal/Test/Api/FundingOptionTest.php b/tests/PayPal/Test/Api/FundingOptionTest.php index ed44ef1e..39182500 100644 --- a/tests/PayPal/Test/Api/FundingOptionTest.php +++ b/tests/PayPal/Test/Api/FundingOptionTest.php @@ -64,6 +64,4 @@ public function testGetters($obj) $this->assertEquals($obj->getInstallmentInfo(), InstallmentInfoTest::getObject()); $this->assertEquals($obj->getLinks(), LinksTest::getObject()); } - - } diff --git a/tests/PayPal/Test/Api/FundingSourceTest.php b/tests/PayPal/Test/Api/FundingSourceTest.php index d6160d4d..9f0756d1 100644 --- a/tests/PayPal/Test/Api/FundingSourceTest.php +++ b/tests/PayPal/Test/Api/FundingSourceTest.php @@ -70,6 +70,4 @@ public function testGetters($obj) $this->assertEquals($obj->getExtends(), FundingInstrumentTest::getObject()); $this->assertEquals($obj->getLinks(), LinksTest::getObject()); } - - } diff --git a/tests/PayPal/Test/Api/HyperSchemaTest.php b/tests/PayPal/Test/Api/HyperSchemaTest.php index c53772ee..68d7e75f 100644 --- a/tests/PayPal/Test/Api/HyperSchemaTest.php +++ b/tests/PayPal/Test/Api/HyperSchemaTest.php @@ -61,5 +61,4 @@ public function testGetters($obj) $this->assertEquals($obj->getPathStart(), "TestSample"); $this->assertEquals($obj->getMediaType(), "TestSample"); } - } diff --git a/tests/PayPal/Test/Api/ImageTest.php b/tests/PayPal/Test/Api/ImageTest.php index 6af355c7..107540dd 100644 --- a/tests/PayPal/Test/Api/ImageTest.php +++ b/tests/PayPal/Test/Api/ImageTest.php @@ -51,5 +51,4 @@ public function testGetters($obj) { $this->assertEquals($obj->getImage(), "TestSample"); } - } diff --git a/tests/PayPal/Test/Api/IncentiveTest.php b/tests/PayPal/Test/Api/IncentiveTest.php index 7f9aff84..cfe3cbab 100644 --- a/tests/PayPal/Test/Api/IncentiveTest.php +++ b/tests/PayPal/Test/Api/IncentiveTest.php @@ -80,5 +80,4 @@ public function testUrlValidationForLogoImageUrl() $obj = new Incentive(); $obj->setLogoImageUrl(null); } - } diff --git a/tests/PayPal/Test/Api/InputFieldsTest.php b/tests/PayPal/Test/Api/InputFieldsTest.php index 588f89c9..3b86bf1b 100644 --- a/tests/PayPal/Test/Api/InputFieldsTest.php +++ b/tests/PayPal/Test/Api/InputFieldsTest.php @@ -55,5 +55,4 @@ public function testGetters($obj) $this->assertEquals($obj->getNoShipping(), 123); $this->assertEquals($obj->getAddressOverride(), 123); } - } diff --git a/tests/PayPal/Test/Api/InstallmentInfoTest.php b/tests/PayPal/Test/Api/InstallmentInfoTest.php index 88678233..c8192293 100644 --- a/tests/PayPal/Test/Api/InstallmentInfoTest.php +++ b/tests/PayPal/Test/Api/InstallmentInfoTest.php @@ -60,6 +60,4 @@ public function testGetters($obj) $this->assertEquals($obj->getIssuer(), "TestSample"); $this->assertEquals($obj->getInstallmentOptions(), InstallmentOptionTest::getObject()); } - - } diff --git a/tests/PayPal/Test/Api/InstallmentOptionTest.php b/tests/PayPal/Test/Api/InstallmentOptionTest.php index 9c66ffc5..9c0a4133 100644 --- a/tests/PayPal/Test/Api/InstallmentOptionTest.php +++ b/tests/PayPal/Test/Api/InstallmentOptionTest.php @@ -60,6 +60,4 @@ public function testGetters($obj) $this->assertEquals($obj->getDiscountAmount(), CurrencyTest::getObject()); $this->assertEquals($obj->getDiscountPercentage(), "TestSample"); } - - } diff --git a/tests/PayPal/Test/Api/InvoiceAddressTest.php b/tests/PayPal/Test/Api/InvoiceAddressTest.php index 257f3de5..e0f70505 100644 --- a/tests/PayPal/Test/Api/InvoiceAddressTest.php +++ b/tests/PayPal/Test/Api/InvoiceAddressTest.php @@ -63,5 +63,4 @@ public function testGetters($obj) $this->assertEquals($obj->getState(), "TestSample"); $this->assertEquals($obj->getPhone(), PhoneTest::getObject()); } - } diff --git a/tests/PayPal/Test/Api/InvoiceItemTest.php b/tests/PayPal/Test/Api/InvoiceItemTest.php index fbb6c2cf..0ff8a44f 100644 --- a/tests/PayPal/Test/Api/InvoiceItemTest.php +++ b/tests/PayPal/Test/Api/InvoiceItemTest.php @@ -77,5 +77,4 @@ public function testUrlValidationForImageUrl() $obj = new InvoiceItem(); $obj->setImageUrl(null); } - } diff --git a/tests/PayPal/Test/Api/InvoiceNumberTest.php b/tests/PayPal/Test/Api/InvoiceNumberTest.php index 7c5985e6..4c6c0281 100644 --- a/tests/PayPal/Test/Api/InvoiceNumberTest.php +++ b/tests/PayPal/Test/Api/InvoiceNumberTest.php @@ -1,8 +1,8 @@ assertEquals($obj->getNumber(), "1234"); } - } diff --git a/tests/PayPal/Test/Api/InvoiceSearchResponseTest.php b/tests/PayPal/Test/Api/InvoiceSearchResponseTest.php index cbba180b..fbf6ee3d 100644 --- a/tests/PayPal/Test/Api/InvoiceSearchResponseTest.php +++ b/tests/PayPal/Test/Api/InvoiceSearchResponseTest.php @@ -53,5 +53,4 @@ public function testGetters($obj) $this->assertEquals($obj->getTotalCount(), 123); $this->assertEquals($obj->getInvoices(), InvoiceTest::getObject()); } - } diff --git a/tests/PayPal/Test/Api/ItemListTest.php b/tests/PayPal/Test/Api/ItemListTest.php index 2f9a805b..0099d940 100644 --- a/tests/PayPal/Test/Api/ItemListTest.php +++ b/tests/PayPal/Test/Api/ItemListTest.php @@ -60,6 +60,4 @@ public function testGetters($obj) $this->assertEquals($obj->getShippingMethod(), "TestSample"); $this->assertEquals($obj->getShippingPhoneNumber(), "TestSample"); } - - } diff --git a/tests/PayPal/Test/Api/ItemTest.php b/tests/PayPal/Test/Api/ItemTest.php index 311d108c..ae46b9d5 100644 --- a/tests/PayPal/Test/Api/ItemTest.php +++ b/tests/PayPal/Test/Api/ItemTest.php @@ -92,5 +92,4 @@ public function testUrlValidationForUrl() $obj = new Item(); $obj->setUrl(null); } - } diff --git a/tests/PayPal/Test/Api/LinksTest.php b/tests/PayPal/Test/Api/LinksTest.php index f8d008a8..5168144a 100644 --- a/tests/PayPal/Test/Api/LinksTest.php +++ b/tests/PayPal/Test/Api/LinksTest.php @@ -61,5 +61,4 @@ public function testGetters($obj) $this->assertEquals($obj->getEnctype(), "TestSample"); $this->assertEquals($obj->getSchema(), HyperSchemaTest::getObject()); } - } diff --git a/tests/PayPal/Test/Api/MeasurementTest.php b/tests/PayPal/Test/Api/MeasurementTest.php index 889f7ef8..dd23b680 100644 --- a/tests/PayPal/Test/Api/MeasurementTest.php +++ b/tests/PayPal/Test/Api/MeasurementTest.php @@ -56,6 +56,4 @@ public function testGetters($obj) $this->assertEquals($obj->getValue(), "TestSample"); $this->assertEquals($obj->getUnit(), "TestSample"); } - - } diff --git a/tests/PayPal/Test/Api/MerchantInfoTest.php b/tests/PayPal/Test/Api/MerchantInfoTest.php index f68a8e90..38466b4e 100644 --- a/tests/PayPal/Test/Api/MerchantInfoTest.php +++ b/tests/PayPal/Test/Api/MerchantInfoTest.php @@ -71,5 +71,4 @@ public function testGetters($obj) $this->assertEquals($obj->getAdditionalInfoLabel(), "TestSample"); $this->assertEquals($obj->getAdditionalInfo(), "TestSample"); } - } diff --git a/tests/PayPal/Test/Api/MerchantPreferencesTest.php b/tests/PayPal/Test/Api/MerchantPreferencesTest.php index 513925db..3f78c9a0 100644 --- a/tests/PayPal/Test/Api/MerchantPreferencesTest.php +++ b/tests/PayPal/Test/Api/MerchantPreferencesTest.php @@ -116,5 +116,4 @@ public function testUrlValidationForNotifyUrlDeprecated() $obj->setNotifyUrl(null); $this->assertNull($obj->getNotifyUrl()); } - } diff --git a/tests/PayPal/Test/Api/MetadataTest.php b/tests/PayPal/Test/Api/MetadataTest.php index 1e85fee8..a62a8077 100644 --- a/tests/PayPal/Test/Api/MetadataTest.php +++ b/tests/PayPal/Test/Api/MetadataTest.php @@ -86,5 +86,4 @@ public function testUrlValidationForPayerViewUrlDeprecated() $obj->setPayer_view_url(null); $this->assertNull($obj->getPayer_view_url()); } - } diff --git a/tests/PayPal/Test/Api/NameValuePairTest.php b/tests/PayPal/Test/Api/NameValuePairTest.php index c709df7c..8fd0d50b 100644 --- a/tests/PayPal/Test/Api/NameValuePairTest.php +++ b/tests/PayPal/Test/Api/NameValuePairTest.php @@ -56,6 +56,4 @@ public function testGetters($obj) $this->assertEquals($obj->getName(), "TestSample"); $this->assertEquals($obj->getValue(), "TestSample"); } - - } diff --git a/tests/PayPal/Test/Api/NotificationTest.php b/tests/PayPal/Test/Api/NotificationTest.php index eb0b91de..38af7542 100644 --- a/tests/PayPal/Test/Api/NotificationTest.php +++ b/tests/PayPal/Test/Api/NotificationTest.php @@ -55,6 +55,4 @@ public function testGetters($obj) $this->assertEquals($obj->getNote(), "TestSample"); $this->assertEquals($obj->getSendToMerchant(), true); } - - } diff --git a/tests/PayPal/Test/Api/OpenIdSessionTest.php b/tests/PayPal/Test/Api/OpenIdSessionTest.php index ee209f94..8ddb135b 100644 --- a/tests/PayPal/Test/Api/OpenIdSessionTest.php +++ b/tests/PayPal/Test/Api/OpenIdSessionTest.php @@ -44,7 +44,6 @@ protected function tearDown() */ public function testLoginUrlForMultipleScopes() { - $clientId = "AQkquBDf1zctJOWGKWUEtKXm6qVhueUEMvXO_-MCI4DQQ4-LWvkDLIN2fGsd"; $redirectUri = 'https://devtools-paypal.com/'; $scope = array('this', 'that', 'and more'); @@ -69,7 +68,6 @@ public function testLoginUrlForMultipleScopes() */ public function testLoginWithCustomConfig() { - $redirectUri = 'http://mywebsite.com'; $scope = array('this', 'that', 'and more'); @@ -84,7 +82,6 @@ public function testLoginWithCustomConfig() */ public function testLogoutWithCustomConfig() { - $redirectUri = 'http://mywebsite.com'; $idToken = 'abc'; diff --git a/tests/PayPal/Test/Api/OpenIdTokeninfoTest.php b/tests/PayPal/Test/Api/OpenIdTokeninfoTest.php index e22f4311..34cfa8c0 100644 --- a/tests/PayPal/Test/Api/OpenIdTokeninfoTest.php +++ b/tests/PayPal/Test/Api/OpenIdTokeninfoTest.php @@ -53,7 +53,6 @@ public function testSerializationDeserialization() */ public function t1estOperations() { - $clientId = 'AQkquBDf1zctJOWGKWUEtKXm6qVhueUEMvXO_-MCI4DQQ4-LWvkDLIN2fGsd'; $clientSecret = 'ELtVxAjhT7cJimnz5-Nsx9k2reTKSVfErNQF-CmrwJgxRtylkGTKlU4RvrX'; @@ -74,5 +73,4 @@ public function t1estOperations() $accessToken = $accessToken->createFromRefreshToken($params); $this->assertNotNull($accessToken); } - } diff --git a/tests/PayPal/Test/Api/OverrideChargeModelTest.php b/tests/PayPal/Test/Api/OverrideChargeModelTest.php index 4492418f..36337482 100644 --- a/tests/PayPal/Test/Api/OverrideChargeModelTest.php +++ b/tests/PayPal/Test/Api/OverrideChargeModelTest.php @@ -53,5 +53,4 @@ public function testGetters($obj) $this->assertEquals($obj->getChargeId(), "TestSample"); $this->assertEquals($obj->getAmount(), CurrencyTest::getObject()); } - } diff --git a/tests/PayPal/Test/Api/ParticipantTest.php b/tests/PayPal/Test/Api/ParticipantTest.php index f5b69dba..be8d5220 100644 --- a/tests/PayPal/Test/Api/ParticipantTest.php +++ b/tests/PayPal/Test/Api/ParticipantTest.php @@ -68,6 +68,4 @@ public function testGetters($obj) $this->assertEquals($obj->getAdditionalInfo(), "TestSample"); $this->assertEquals($obj->getAddress(), AddressTest::getObject()); } - - } diff --git a/tests/PayPal/Test/Api/PatchRequestTest.php b/tests/PayPal/Test/Api/PatchRequestTest.php index 12629d24..33cd25ad 100644 --- a/tests/PayPal/Test/Api/PatchRequestTest.php +++ b/tests/PayPal/Test/Api/PatchRequestTest.php @@ -50,5 +50,4 @@ public function testGetters($obj) { $this->assertEquals($obj->getPatches(), PatchTest::getObject()); } - } diff --git a/tests/PayPal/Test/Api/PatchTest.php b/tests/PayPal/Test/Api/PatchTest.php index 8ed800b0..7f8e946a 100644 --- a/tests/PayPal/Test/Api/PatchTest.php +++ b/tests/PayPal/Test/Api/PatchTest.php @@ -60,6 +60,4 @@ public function testGetters($obj) $this->assertEquals($obj->getValue(), "TestSampleObject"); $this->assertEquals($obj->getFrom(), "TestSample"); } - - } diff --git a/tests/PayPal/Test/Api/PayeeTest.php b/tests/PayPal/Test/Api/PayeeTest.php index 853e56b8..f951a9c5 100644 --- a/tests/PayPal/Test/Api/PayeeTest.php +++ b/tests/PayPal/Test/Api/PayeeTest.php @@ -64,6 +64,4 @@ public function testGetters($obj) $this->assertEquals($obj->getAccountNumber(), "TestSample"); $this->assertEquals($obj->getPhone(), PhoneTest::getObject()); } - - } diff --git a/tests/PayPal/Test/Api/PayerInfoTest.php b/tests/PayPal/Test/Api/PayerInfoTest.php index 7a1546a9..f8b17edf 100644 --- a/tests/PayPal/Test/Api/PayerInfoTest.php +++ b/tests/PayPal/Test/Api/PayerInfoTest.php @@ -86,6 +86,4 @@ public function testGetters($obj) $this->assertEquals($obj->getBillingAddress(), AddressTest::getObject()); $this->assertEquals($obj->getShippingAddress(), ShippingAddressTest::getObject()); } - - } diff --git a/tests/PayPal/Test/Api/PayerTest.php b/tests/PayPal/Test/Api/PayerTest.php index e5cab693..de7e272b 100644 --- a/tests/PayPal/Test/Api/PayerTest.php +++ b/tests/PayPal/Test/Api/PayerTest.php @@ -70,6 +70,4 @@ public function testGetters($obj) $this->assertEquals($obj->getRelatedFundingOption(), FundingOptionTest::getObject()); $this->assertEquals($obj->getPayerInfo(), PayerInfoTest::getObject()); } - - } diff --git a/tests/PayPal/Test/Api/PaymentCardTest.php b/tests/PayPal/Test/Api/PaymentCardTest.php index 44aa163f..fae01aba 100644 --- a/tests/PayPal/Test/Api/PaymentCardTest.php +++ b/tests/PayPal/Test/Api/PaymentCardTest.php @@ -86,6 +86,4 @@ public function testGetters($obj) $this->assertEquals($obj->getIssueNumber(), "TestSample"); $this->assertEquals($obj->getLinks(), LinksTest::getObject()); } - - } diff --git a/tests/PayPal/Test/Api/PaymentCardTokenTest.php b/tests/PayPal/Test/Api/PaymentCardTokenTest.php index 43f6a5cd..be8b3eb7 100644 --- a/tests/PayPal/Test/Api/PaymentCardTokenTest.php +++ b/tests/PayPal/Test/Api/PaymentCardTokenTest.php @@ -61,5 +61,4 @@ public function testGetters($obj) $this->assertEquals($obj->getExpireMonth(), 123); $this->assertEquals($obj->getExpireYear(), 123); } - } diff --git a/tests/PayPal/Test/Api/PaymentDefinitionTest.php b/tests/PayPal/Test/Api/PaymentDefinitionTest.php index 2043b8e0..05fad641 100644 --- a/tests/PayPal/Test/Api/PaymentDefinitionTest.php +++ b/tests/PayPal/Test/Api/PaymentDefinitionTest.php @@ -65,5 +65,4 @@ public function testGetters($obj) $this->assertEquals($obj->getAmount(), CurrencyTest::getObject()); $this->assertEquals($obj->getChargeModels(), ChargeModelTest::getObject()); } - } diff --git a/tests/PayPal/Test/Api/PaymentDetailTest.php b/tests/PayPal/Test/Api/PaymentDetailTest.php index 42ec7116..09a79e42 100644 --- a/tests/PayPal/Test/Api/PaymentDetailTest.php +++ b/tests/PayPal/Test/Api/PaymentDetailTest.php @@ -63,5 +63,4 @@ public function testGetters($obj) $this->assertEquals($obj->getNote(), "TestSample"); $this->assertEquals($obj->getAmount(), CurrencyTest::getObject()); } - } diff --git a/tests/PayPal/Test/Api/PaymentExecutionTest.php b/tests/PayPal/Test/Api/PaymentExecutionTest.php index fe25bd64..b1823446 100644 --- a/tests/PayPal/Test/Api/PaymentExecutionTest.php +++ b/tests/PayPal/Test/Api/PaymentExecutionTest.php @@ -58,6 +58,4 @@ public function testGetters($obj) $this->assertEquals($obj->getCarrierAccountId(), "TestSample"); $this->assertEquals($obj->getTransactions(), array(TransactionTest::getObject())); } - - } diff --git a/tests/PayPal/Test/Api/PaymentHistoryTest.php b/tests/PayPal/Test/Api/PaymentHistoryTest.php index dade26c0..ff2be382 100644 --- a/tests/PayPal/Test/Api/PaymentHistoryTest.php +++ b/tests/PayPal/Test/Api/PaymentHistoryTest.php @@ -58,6 +58,4 @@ public function testGetters($obj) $this->assertEquals($obj->getCount(), 123); $this->assertEquals($obj->getNextId(), "TestSample"); } - - } diff --git a/tests/PayPal/Test/Api/PaymentOptionsTest.php b/tests/PayPal/Test/Api/PaymentOptionsTest.php index e2bbda26..60e852ae 100644 --- a/tests/PayPal/Test/Api/PaymentOptionsTest.php +++ b/tests/PayPal/Test/Api/PaymentOptionsTest.php @@ -58,6 +58,4 @@ public function testGetters($obj) $this->assertEquals($obj->getRecurringFlag(), true); $this->assertEquals($obj->getSkipFmf(), true); } - - } diff --git a/tests/PayPal/Test/Api/PaymentSummaryTest.php b/tests/PayPal/Test/Api/PaymentSummaryTest.php index ebc9ef58..b7459003 100644 --- a/tests/PayPal/Test/Api/PaymentSummaryTest.php +++ b/tests/PayPal/Test/Api/PaymentSummaryTest.php @@ -54,6 +54,4 @@ public function testGetters($obj) $this->assertEquals($obj->getPaypal(), CurrencyTest::getObject()); $this->assertEquals($obj->getOther(), CurrencyTest::getObject()); } - - } diff --git a/tests/PayPal/Test/Api/PaymentTermTest.php b/tests/PayPal/Test/Api/PaymentTermTest.php index 24e9102c..f5593e7a 100644 --- a/tests/PayPal/Test/Api/PaymentTermTest.php +++ b/tests/PayPal/Test/Api/PaymentTermTest.php @@ -53,5 +53,4 @@ public function testGetters($obj) $this->assertEquals($obj->getTermType(), "TestSample"); $this->assertEquals($obj->getDueDate(), "TestSample"); } - } diff --git a/tests/PayPal/Test/Api/PayoutBatchHeaderTest.php b/tests/PayPal/Test/Api/PayoutBatchHeaderTest.php index 1f96f67b..6b44c25e 100644 --- a/tests/PayPal/Test/Api/PayoutBatchHeaderTest.php +++ b/tests/PayPal/Test/Api/PayoutBatchHeaderTest.php @@ -67,5 +67,4 @@ public function testGetters($obj) $this->assertEquals($obj->getErrors(), ErrorTest::getObject()); $this->assertEquals($obj->getLinks(), LinksTest::getObject()); } - } diff --git a/tests/PayPal/Test/Api/PayoutBatchTest.php b/tests/PayPal/Test/Api/PayoutBatchTest.php index 5b22a8a1..f8c8b2ba 100644 --- a/tests/PayPal/Test/Api/PayoutBatchTest.php +++ b/tests/PayPal/Test/Api/PayoutBatchTest.php @@ -53,5 +53,4 @@ public function testGetters($obj) $this->assertEquals($obj->getBatchHeader(), PayoutBatchHeaderTest::getObject()); $this->assertEquals($obj->getItems(), PayoutItemDetailsTest::getObject()); } - } diff --git a/tests/PayPal/Test/Api/PayoutItemDetailsTest.php b/tests/PayPal/Test/Api/PayoutItemDetailsTest.php index 46adfeff..822358af 100644 --- a/tests/PayPal/Test/Api/PayoutItemDetailsTest.php +++ b/tests/PayPal/Test/Api/PayoutItemDetailsTest.php @@ -69,5 +69,4 @@ public function testGetters($obj) $this->assertEquals($obj->getErrors(), ErrorTest::getObject()); $this->assertEquals($obj->getLinks(), LinksTest::getObject()); } - } diff --git a/tests/PayPal/Test/Api/PayoutSenderBatchHeaderTest.php b/tests/PayPal/Test/Api/PayoutSenderBatchHeaderTest.php index 64617ef4..2f2fe34f 100644 --- a/tests/PayPal/Test/Api/PayoutSenderBatchHeaderTest.php +++ b/tests/PayPal/Test/Api/PayoutSenderBatchHeaderTest.php @@ -55,5 +55,4 @@ public function testGetters($obj) $this->assertEquals($obj->getEmailSubject(), "TestSample"); $this->assertEquals($obj->getRecipientType(), "TestSample"); } - } diff --git a/tests/PayPal/Test/Api/PhoneTest.php b/tests/PayPal/Test/Api/PhoneTest.php index bae54530..185f8add 100644 --- a/tests/PayPal/Test/Api/PhoneTest.php +++ b/tests/PayPal/Test/Api/PhoneTest.php @@ -58,6 +58,4 @@ public function testGetters($obj) $this->assertEquals($obj->getNationalNumber(), "TestSample"); $this->assertEquals($obj->getExtension(), "TestSample"); } - - } diff --git a/tests/PayPal/Test/Api/PlanListTest.php b/tests/PayPal/Test/Api/PlanListTest.php index aa4954c2..3015ffd7 100644 --- a/tests/PayPal/Test/Api/PlanListTest.php +++ b/tests/PayPal/Test/Api/PlanListTest.php @@ -57,5 +57,4 @@ public function testGetters($obj) $this->assertEquals($obj->getTotalPages(), "TestSample"); $this->assertEquals($obj->getLinks(), LinksTest::getObject()); } - } diff --git a/tests/PayPal/Test/Api/PotentialPayerInfoTest.php b/tests/PayPal/Test/Api/PotentialPayerInfoTest.php index 50cd24d5..97b79040 100644 --- a/tests/PayPal/Test/Api/PotentialPayerInfoTest.php +++ b/tests/PayPal/Test/Api/PotentialPayerInfoTest.php @@ -57,6 +57,4 @@ public function testGetters($obj) $this->assertEquals($obj->getAccountNumber(), "TestSample"); $this->assertEquals($obj->getBillingAddress(), AddressTest::getObject()); } - - } diff --git a/tests/PayPal/Test/Api/PresentationTest.php b/tests/PayPal/Test/Api/PresentationTest.php index 2807f499..49eb021f 100644 --- a/tests/PayPal/Test/Api/PresentationTest.php +++ b/tests/PayPal/Test/Api/PresentationTest.php @@ -55,5 +55,4 @@ public function testGetters($obj) $this->assertEquals($obj->getLogoImage(), "TestSample"); $this->assertEquals($obj->getLocaleCode(), "TestSample"); } - } diff --git a/tests/PayPal/Test/Api/PrivateLabelCardTest.php b/tests/PayPal/Test/Api/PrivateLabelCardTest.php index 96b1e6a0..e76023c3 100644 --- a/tests/PayPal/Test/Api/PrivateLabelCardTest.php +++ b/tests/PayPal/Test/Api/PrivateLabelCardTest.php @@ -59,6 +59,4 @@ public function testGetters($obj) $this->assertEquals($obj->getIssuerName(), "TestSample"); $this->assertEquals($obj->getImageKey(), "TestSample"); } - - } diff --git a/tests/PayPal/Test/Api/ProcessorResponseTest.php b/tests/PayPal/Test/Api/ProcessorResponseTest.php index dc779fc4..c88d2f6e 100644 --- a/tests/PayPal/Test/Api/ProcessorResponseTest.php +++ b/tests/PayPal/Test/Api/ProcessorResponseTest.php @@ -61,6 +61,4 @@ public function testGetters($obj) $this->assertEquals($obj->getEciSubmitted(), "TestSample"); $this->assertEquals($obj->getVpas(), "TestSample"); } - - } diff --git a/tests/PayPal/Test/Api/RecipientBankingInstructionTest.php b/tests/PayPal/Test/Api/RecipientBankingInstructionTest.php index 60176d7f..04823221 100644 --- a/tests/PayPal/Test/Api/RecipientBankingInstructionTest.php +++ b/tests/PayPal/Test/Api/RecipientBankingInstructionTest.php @@ -64,6 +64,4 @@ public function testGetters($obj) $this->assertEquals($obj->getInternationalBankAccountNumber(), "TestSample"); $this->assertEquals($obj->getBankIdentifierCode(), "TestSample"); } - - } diff --git a/tests/PayPal/Test/Api/RedirectUrlsTest.php b/tests/PayPal/Test/Api/RedirectUrlsTest.php index e69660a4..7abf56c0 100644 --- a/tests/PayPal/Test/Api/RedirectUrlsTest.php +++ b/tests/PayPal/Test/Api/RedirectUrlsTest.php @@ -76,5 +76,4 @@ public function testUrlValidationForCancelUrl() $obj = new RedirectUrls(); $obj->setCancelUrl(null); } - } diff --git a/tests/PayPal/Test/Api/RefundDetailTest.php b/tests/PayPal/Test/Api/RefundDetailTest.php index 951ab3cf..d5c47116 100644 --- a/tests/PayPal/Test/Api/RefundDetailTest.php +++ b/tests/PayPal/Test/Api/RefundDetailTest.php @@ -57,6 +57,4 @@ public function testGetters($obj) $this->assertEquals($obj->getNote(), "TestSample"); $this->assertEquals($obj->getAmount(), CurrencyTest::getObject()); } - - } diff --git a/tests/PayPal/Test/Api/RelatedResourcesTest.php b/tests/PayPal/Test/Api/RelatedResourcesTest.php index 077725ed..3b97e7f2 100644 --- a/tests/PayPal/Test/Api/RelatedResourcesTest.php +++ b/tests/PayPal/Test/Api/RelatedResourcesTest.php @@ -62,6 +62,4 @@ public function testGetters($obj) $this->assertEquals($obj->getCapture(), CaptureTest::getObject()); $this->assertEquals($obj->getRefund(), RefundTest::getObject()); } - - } diff --git a/tests/PayPal/Test/Api/SearchTest.php b/tests/PayPal/Test/Api/SearchTest.php index f743a9a8..60bd56cf 100644 --- a/tests/PayPal/Test/Api/SearchTest.php +++ b/tests/PayPal/Test/Api/SearchTest.php @@ -89,5 +89,4 @@ public function testGetters($obj) $this->assertEquals($obj->getTotalCountRequired(), true); $this->assertEquals($obj->getArchived(), true); } - } diff --git a/tests/PayPal/Test/Api/ShippingAddressTest.php b/tests/PayPal/Test/Api/ShippingAddressTest.php index 7f2dabee..0247664c 100644 --- a/tests/PayPal/Test/Api/ShippingAddressTest.php +++ b/tests/PayPal/Test/Api/ShippingAddressTest.php @@ -58,6 +58,4 @@ public function testGetters($obj) $this->assertEquals($obj->getRecipientName(), "TestSample"); $this->assertEquals($obj->getDefaultAddress(), true); } - - } diff --git a/tests/PayPal/Test/Api/ShippingCostTest.php b/tests/PayPal/Test/Api/ShippingCostTest.php index f146cf88..2de4b359 100644 --- a/tests/PayPal/Test/Api/ShippingCostTest.php +++ b/tests/PayPal/Test/Api/ShippingCostTest.php @@ -53,5 +53,4 @@ public function testGetters($obj) $this->assertEquals($obj->getAmount(), CurrencyTest::getObject()); $this->assertEquals($obj->getTax(), TaxTest::getObject()); } - } diff --git a/tests/PayPal/Test/Api/ShippingInfoTest.php b/tests/PayPal/Test/Api/ShippingInfoTest.php index dd92c291..c62ea327 100644 --- a/tests/PayPal/Test/Api/ShippingInfoTest.php +++ b/tests/PayPal/Test/Api/ShippingInfoTest.php @@ -57,5 +57,4 @@ public function testGetters($obj) $this->assertEquals($obj->getBusinessName(), "TestSample"); $this->assertEquals($obj->getAddress(), AddressTest::getObject()); } - } diff --git a/tests/PayPal/Test/Api/TaxTest.php b/tests/PayPal/Test/Api/TaxTest.php index 9029bf41..3a6b7b29 100644 --- a/tests/PayPal/Test/Api/TaxTest.php +++ b/tests/PayPal/Test/Api/TaxTest.php @@ -57,5 +57,4 @@ public function testGetters($obj) $this->assertEquals($obj->getPercent(), "12.34"); $this->assertEquals($obj->getAmount(), CurrencyTest::getObject()); } - } diff --git a/tests/PayPal/Test/Api/TemplateDataTest.php b/tests/PayPal/Test/Api/TemplateDataTest.php index 45a529de..f132b6b0 100644 --- a/tests/PayPal/Test/Api/TemplateDataTest.php +++ b/tests/PayPal/Test/Api/TemplateDataTest.php @@ -98,5 +98,4 @@ public function testUrlValidationForLogoUrl() $obj = new TemplateData(); $obj->setLogoUrl(null); } - } diff --git a/tests/PayPal/Test/Api/TemplateSettingsMetadataTest.php b/tests/PayPal/Test/Api/TemplateSettingsMetadataTest.php index 7376f151..f3354851 100644 --- a/tests/PayPal/Test/Api/TemplateSettingsMetadataTest.php +++ b/tests/PayPal/Test/Api/TemplateSettingsMetadataTest.php @@ -52,6 +52,4 @@ public function testGetters($obj) { $this->assertEquals($obj->getHidden(), true); } - - } diff --git a/tests/PayPal/Test/Api/TemplateSettingsTest.php b/tests/PayPal/Test/Api/TemplateSettingsTest.php index 1a85b20e..d79eca0d 100644 --- a/tests/PayPal/Test/Api/TemplateSettingsTest.php +++ b/tests/PayPal/Test/Api/TemplateSettingsTest.php @@ -54,6 +54,4 @@ public function testGetters($obj) $this->assertEquals($obj->getFieldName(), "TestSample"); $this->assertEquals($obj->getDisplayPreference(), TemplateSettingsMetadataTest::getObject()); } - - } diff --git a/tests/PayPal/Test/Api/TemplateTest.php b/tests/PayPal/Test/Api/TemplateTest.php index 475e66fe..7a25a78e 100644 --- a/tests/PayPal/Test/Api/TemplateTest.php +++ b/tests/PayPal/Test/Api/TemplateTest.php @@ -64,6 +64,4 @@ public function testGetters($obj) $this->assertEquals($obj->getUnitOfMeasure(), "TestSample"); $this->assertEquals($obj->getCustom(), true); } - - } diff --git a/tests/PayPal/Test/Api/TermsTest.php b/tests/PayPal/Test/Api/TermsTest.php index 4df79389..0c925ab4 100644 --- a/tests/PayPal/Test/Api/TermsTest.php +++ b/tests/PayPal/Test/Api/TermsTest.php @@ -61,5 +61,4 @@ public function testGetters($obj) $this->assertEquals($obj->getAmountRange(), CurrencyTest::getObject()); $this->assertEquals($obj->getBuyerEditable(), "TestSample"); } - } diff --git a/tests/PayPal/Test/Api/TransactionTest.php b/tests/PayPal/Test/Api/TransactionTest.php index dd036d23..93c09897 100644 --- a/tests/PayPal/Test/Api/TransactionTest.php +++ b/tests/PayPal/Test/Api/TransactionTest.php @@ -52,6 +52,4 @@ public function testSerializationDeserialization() public function testGetters($obj) { } - - } diff --git a/tests/PayPal/Test/Api/WebhookEventListTest.php b/tests/PayPal/Test/Api/WebhookEventListTest.php index 611a4b2b..99063bd8 100644 --- a/tests/PayPal/Test/Api/WebhookEventListTest.php +++ b/tests/PayPal/Test/Api/WebhookEventListTest.php @@ -55,5 +55,4 @@ public function testGetters($obj) $this->assertEquals($obj->getCount(), 123); $this->assertEquals($obj->getLinks(), LinksTest::getObject()); } - } diff --git a/tests/PayPal/Test/Api/WebhookEventTest.php b/tests/PayPal/Test/Api/WebhookEventTest.php index 7918ad0f..001a6008 100644 --- a/tests/PayPal/Test/Api/WebhookEventTest.php +++ b/tests/PayPal/Test/Api/WebhookEventTest.php @@ -196,7 +196,7 @@ public function testValidateWebhookNull($mockApiContext) */ public function testValidateWebhookEmpty($mockApiContext) { - WebhookEvent::validateAndGetReceivedEvent('', $mockApiContext); + WebhookEvent::validateAndGetReceivedEvent('', $mockApiContext); } /** @@ -219,5 +219,4 @@ public function testValidateWebhookValidJSONWithoutId($obj, $mockApiContext) { WebhookEvent::validateAndGetReceivedEvent('{"summary":"json"}', $mockApiContext); } - } diff --git a/tests/PayPal/Test/Api/WebhookEventTypeListTest.php b/tests/PayPal/Test/Api/WebhookEventTypeListTest.php index baa569d2..e6d7e830 100644 --- a/tests/PayPal/Test/Api/WebhookEventTypeListTest.php +++ b/tests/PayPal/Test/Api/WebhookEventTypeListTest.php @@ -51,5 +51,4 @@ public function testGetters($obj) { $this->assertEquals($obj->getEventTypes(), WebhookEventTypeTest::getObject()); } - } diff --git a/tests/PayPal/Test/Api/WebhookListTest.php b/tests/PayPal/Test/Api/WebhookListTest.php index 7bb30f6b..c638a6fc 100644 --- a/tests/PayPal/Test/Api/WebhookListTest.php +++ b/tests/PayPal/Test/Api/WebhookListTest.php @@ -51,5 +51,4 @@ public function testGetters($obj) { $this->assertEquals($obj->getWebhooks(), WebhookTest::getObject()); } - } diff --git a/tests/PayPal/Test/Auth/OAuthTokenCredentialTest.php b/tests/PayPal/Test/Auth/OAuthTokenCredentialTest.php index 9f367c1c..9317228a 100644 --- a/tests/PayPal/Test/Auth/OAuthTokenCredentialTest.php +++ b/tests/PayPal/Test/Auth/OAuthTokenCredentialTest.php @@ -47,7 +47,7 @@ public function testGetAccessTokenUnit() 'cache.enabled' => true, 'cache.FileName' => AuthorizationCacheTest::CACHE_FILE ); - $cred = new OAuthTokenCredential('clientId', 'clientSecret'); + $cred = new OAuthTokenCredential('clientId', 'clientSecret'); //{"clientId":{"clientId":"clientId","accessToken":"accessToken","tokenCreateTime":1421204091,"tokenExpiresIn":288000000}} AuthorizationCache::push($config, 'clientId', $cred->encrypt('accessToken'), 1421204091, 288000000); @@ -79,7 +79,6 @@ public function testGetAccessTokenUnitMock() $response = $auth->getRefreshToken($config, 'auth_value'); $this->assertNotNull($response); $this->assertEquals('refresh_token_value', $response); - } public function testUpdateAccessTokenUnitMock() @@ -109,7 +108,6 @@ public function testUpdateAccessTokenUnitMock() $response = $auth->updateAccessToken($config, 'refresh_token'); $this->assertNotNull($response); $this->assertEquals('accessToken', $response); - } /** @@ -137,7 +135,5 @@ public function testUpdateAccessTokenNullReturnUnitMock() $response = $auth->updateAccessToken($config); $this->assertNotNull($response); $this->assertEquals('accessToken', $response); - } - } diff --git a/tests/PayPal/Test/Cache/AuthorizationCacheTest.php b/tests/PayPal/Test/Cache/AuthorizationCacheTest.php index 82a5e146..329fff7d 100644 --- a/tests/PayPal/Test/Cache/AuthorizationCacheTest.php +++ b/tests/PayPal/Test/Cache/AuthorizationCacheTest.php @@ -79,7 +79,6 @@ public function testCachePush() $this->assertEquals('accessToken', $tokens['clientId']['accessTokenEncrypted']); $this->assertEquals('tokenCreateTime', $tokens['clientId']['tokenCreateTime']); $this->assertEquals('tokenExpiresIn', $tokens['clientId']['tokenExpiresIn']); - } public function testCachePullNonExisting() @@ -103,5 +102,4 @@ public function testCachePull() unlink(AuthorizationCacheTest::CACHE_FILE); } - } diff --git a/tests/PayPal/Test/Common/ArrayUtilTest.php b/tests/PayPal/Test/Common/ArrayUtilTest.php index 0c353b0d..bdd30fe1 100644 --- a/tests/PayPal/Test/Common/ArrayUtilTest.php +++ b/tests/PayPal/Test/Common/ArrayUtilTest.php @@ -8,7 +8,6 @@ class ArrayUtilTest extends \PHPUnit_Framework_TestCase public function testIsAssocArray() { - $arr = array(1, 2, 3); $this->assertEquals(false, ArrayUtil::isAssocArray($arr)); diff --git a/tests/PayPal/Test/Common/ChildClass.php b/tests/PayPal/Test/Common/ChildClass.php index 55dc955d..32449dfe 100644 --- a/tests/PayPal/Test/Common/ChildClass.php +++ b/tests/PayPal/Test/Common/ChildClass.php @@ -3,5 +3,4 @@ class ChildClass extends SimpleClass { - } diff --git a/tests/PayPal/Test/Common/FormatConverterTest.php b/tests/PayPal/Test/Common/FormatConverterTest.php index cf817963..c6201af2 100644 --- a/tests/PayPal/Test/Common/FormatConverterTest.php +++ b/tests/PayPal/Test/Common/FormatConverterTest.php @@ -72,7 +72,6 @@ public function testFormatToTwoDecimalPlaces($input, $expected) { $result = FormatConverter::formatToNumber($input); $this->assertEquals($expected, $result); - } /** diff --git a/tests/PayPal/Test/Common/ModelTest.php b/tests/PayPal/Test/Common/ModelTest.php index da9063ee..230c80e0 100644 --- a/tests/PayPal/Test/Common/ModelTest.php +++ b/tests/PayPal/Test/Common/ModelTest.php @@ -23,7 +23,6 @@ public function testSimpleClassConversion() $newO = new SimpleClass(); $newO->fromJson($json); $this->assertEquals($o, $newO); - } public function testConstructorJSON() @@ -68,7 +67,6 @@ public function testSimpleClassObjectConversion() $this->assertEquals("test", $obj->getName()); $this->assertEquals("description", $obj->getDescription()); - } public function testSimpleClassObjectInvalidConversion() diff --git a/tests/PayPal/Test/Common/PayPalModelTest.php b/tests/PayPal/Test/Common/PayPalModelTest.php index d59bd5ba..c67b346a 100644 --- a/tests/PayPal/Test/Common/PayPalModelTest.php +++ b/tests/PayPal/Test/Common/PayPalModelTest.php @@ -47,7 +47,6 @@ public function getField2() { return $this->field2; } - } @@ -95,8 +94,6 @@ public function getNested1() { return $this->nested1; } - - } class ListModelTestClass extends PayPalModel @@ -142,8 +139,6 @@ public function getList2() { return $this->list2; } - - } /** @@ -158,7 +153,6 @@ class PayPalModelTest extends PHPUnit_Framework_TestCase */ protected function setUp() { - } /** @@ -183,7 +177,6 @@ public function testSimpleConversion() $oCopy = new SimpleModelTestClass(); $oCopy->fromJson($o->toJSON()); $this->assertEquals($o, $oCopy); - } /** @@ -204,7 +197,6 @@ public function testEmptyObject() $parentCopy = new ContainerModelTestClass(); $parentCopy->fromJson($parent->toJSON()); $this->assertEquals($parent, $parentCopy); - } /** @@ -221,7 +213,6 @@ public function testSpecialChars() $oCopy = new SimpleModelTestClass(); $oCopy->fromJson($o->toJSON()); $this->assertEquals($o, $oCopy); - } @@ -244,7 +235,6 @@ public function testNestedConversion() $parentCopy = new ContainerModelTestClass(); $parentCopy->fromJson($parent->toJSON()); $this->assertEquals($parent, $parentCopy); - } @@ -289,7 +279,7 @@ public function testEmptyNullConversion($field2, $matches) { $c1 = new SimpleModelTestClass(); $c1->setField1("a")->setField2($field2); - $this->assertTrue(strpos($c1->toJSON(),"field2") !== !$matches); + $this->assertTrue(strpos($c1->toJSON(), "field2") !== !$matches); } public function getProvider() diff --git a/tests/PayPal/Test/Core/PayPalHttpConfigTest.php b/tests/PayPal/Test/Core/PayPalHttpConfigTest.php index 44b0eebe..c3318b3e 100644 --- a/tests/PayPal/Test/Core/PayPalHttpConfigTest.php +++ b/tests/PayPal/Test/Core/PayPalHttpConfigTest.php @@ -24,7 +24,6 @@ class PayPalHttpConfigTest extends \PHPUnit_Framework_TestCase */ protected function setUp() { - } /** @@ -135,5 +134,3 @@ public function testProxyOpts() $o->setHttpProxy('invalid string'); } } - -?> diff --git a/tests/PayPal/Test/Core/PayPalLoggingManagerTest.php b/tests/PayPal/Test/Core/PayPalLoggingManagerTest.php index e5a83dbf..f7720e30 100644 --- a/tests/PayPal/Test/Core/PayPalLoggingManagerTest.php +++ b/tests/PayPal/Test/Core/PayPalLoggingManagerTest.php @@ -35,7 +35,6 @@ protected function tearDown() public function testError() { $this->object->error('Test Error Message'); - } /** @@ -62,5 +61,3 @@ public function testFine() $this->object->fine('Test fine Message'); } } - -?> diff --git a/tests/PayPal/Test/Exception/PayPalConfigurationExceptionTest.php b/tests/PayPal/Test/Exception/PayPalConfigurationExceptionTest.php index c6067af5..ed57fc07 100644 --- a/tests/PayPal/Test/Exception/PayPalConfigurationExceptionTest.php +++ b/tests/PayPal/Test/Exception/PayPalConfigurationExceptionTest.php @@ -34,5 +34,3 @@ public function testPPConfigurationException() $this->assertEquals('Test PayPalConfigurationException', $this->object->getMessage()); } } - -?> diff --git a/tests/PayPal/Test/Exception/PayPalConnectionExceptionTest.php b/tests/PayPal/Test/Exception/PayPalConnectionExceptionTest.php index f64470a2..0b063599 100644 --- a/tests/PayPal/Test/Exception/PayPalConnectionExceptionTest.php +++ b/tests/PayPal/Test/Exception/PayPalConnectionExceptionTest.php @@ -46,5 +46,3 @@ public function testGetData() $this->assertEquals('response payload for connection', $this->object->getData()); } } - -?> diff --git a/tests/PayPal/Test/Exception/PayPalInvalidCredentialExceptionTest.php b/tests/PayPal/Test/Exception/PayPalInvalidCredentialExceptionTest.php index 93d51e10..88377607 100644 --- a/tests/PayPal/Test/Exception/PayPalInvalidCredentialExceptionTest.php +++ b/tests/PayPal/Test/Exception/PayPalInvalidCredentialExceptionTest.php @@ -38,5 +38,3 @@ public function testErrorMessage() $this->assertContains('Error on line', $msg); } } - -?> diff --git a/tests/PayPal/Test/Exception/PayPalMissingCredentialExceptionTest.php b/tests/PayPal/Test/Exception/PayPalMissingCredentialExceptionTest.php index 6892f20d..1a2af090 100644 --- a/tests/PayPal/Test/Exception/PayPalMissingCredentialExceptionTest.php +++ b/tests/PayPal/Test/Exception/PayPalMissingCredentialExceptionTest.php @@ -38,5 +38,3 @@ public function testErrorMessage() $this->assertContains('Error on line', $msg); } } - -?> diff --git a/tests/PayPal/Test/Functional/Api/BillingAgreementsFunctionalTest.php b/tests/PayPal/Test/Functional/Api/BillingAgreementsFunctionalTest.php index 8b006db0..c3a2f53e 100644 --- a/tests/PayPal/Test/Functional/Api/BillingAgreementsFunctionalTest.php +++ b/tests/PayPal/Test/Functional/Api/BillingAgreementsFunctionalTest.php @@ -228,5 +228,4 @@ public function testCancel($agreement) $this->assertEquals('Cancelled', $get->getState()); return $get; } - } diff --git a/tests/PayPal/Test/Functional/Api/BillingPlansFunctionalTest.php b/tests/PayPal/Test/Functional/Api/BillingPlansFunctionalTest.php index 5c34167f..3c23486c 100644 --- a/tests/PayPal/Test/Functional/Api/BillingPlansFunctionalTest.php +++ b/tests/PayPal/Test/Functional/Api/BillingPlansFunctionalTest.php @@ -128,12 +128,10 @@ public function testGetList($plan) } if (!$found) { $result = Plan::all(array('page' => --$totalPages, 'page_size' => '20', 'total_required' => 'yes'), $this->apiContext, $this->mockPayPalRestCall); - } } while ($totalPages > 0 && $found == false); $this->assertTrue($found, "The Created Plan was not found in the get list"); $this->assertEquals($plan->getId(), $foundObject->getId()); - } /** diff --git a/tests/PayPal/Test/Functional/Api/InvoiceFunctionalTest.php b/tests/PayPal/Test/Functional/Api/InvoiceFunctionalTest.php index 3a83a6f5..b3dcf9ac 100644 --- a/tests/PayPal/Test/Functional/Api/InvoiceFunctionalTest.php +++ b/tests/PayPal/Test/Functional/Api/InvoiceFunctionalTest.php @@ -1,6 +1,7 @@ --$totalPages, 'page_size' => '20', 'total_required' => 'yes'), $this->apiContext, $this->mockPayPalRestCall); - } } while ($totalPages > 0 && $found == false); $this->assertTrue($found, "The Created Invoice was not found in the get list"); @@ -235,6 +235,4 @@ public function testDelete($invoice) $result = $invoice->delete($this->apiContext, $this->mockPayPalRestCall); $this->assertNotNull($result); } - - } diff --git a/tests/PayPal/Test/Functional/Api/PayoutsFunctionalTest.php b/tests/PayPal/Test/Functional/Api/PayoutsFunctionalTest.php index 1c0d6409..4372c1cb 100644 --- a/tests/PayPal/Test/Functional/Api/PayoutsFunctionalTest.php +++ b/tests/PayPal/Test/Functional/Api/PayoutsFunctionalTest.php @@ -120,5 +120,4 @@ public function testCancel($payoutBatch) $this->assertEquals($item->getPayoutItemFee(), $result->getPayoutItemFee()); $this->assertEquals('RETURNED', $result->getTransactionStatus()); } - } diff --git a/tests/PayPal/Test/Functional/Api/WebProfileFunctionalTest.php b/tests/PayPal/Test/Functional/Api/WebProfileFunctionalTest.php index a99cb6f8..f0db4b84 100644 --- a/tests/PayPal/Test/Functional/Api/WebProfileFunctionalTest.php +++ b/tests/PayPal/Test/Functional/Api/WebProfileFunctionalTest.php @@ -96,7 +96,6 @@ public function testGetList($webProfile) $this->assertEquals($this->operation['response']['body'][0]['presentation']['logo_image'], $foundObject->getPresentation()->getLogoImage()); $this->assertEquals($this->operation['response']['body'][0]['input_fields']['no_shipping'], $foundObject->getInputFields()->getNoShipping()); $this->assertEquals($this->operation['response']['body'][0]['input_fields']['address_override'], $foundObject->getInputFields()->getAddressOverride()); - } /** @@ -145,5 +144,4 @@ public function testDelete($createProfileResponse) $result = $webProfile->delete($this->apiContext, $this->mockPayPalRestCall); $this->assertTrue($result); } - } diff --git a/tests/PayPal/Test/Functional/Api/WebhookFunctionalTest.php b/tests/PayPal/Test/Functional/Api/WebhookFunctionalTest.php index 6d916d20..cf64ed01 100644 --- a/tests/PayPal/Test/Functional/Api/WebhookFunctionalTest.php +++ b/tests/PayPal/Test/Functional/Api/WebhookFunctionalTest.php @@ -61,7 +61,7 @@ public function testCreate() $result = $obj->create($this->apiContext, $this->mockPayPalRestCall); } catch (PayPalConnectionException $ex) { $data = $ex->getData(); - if (strpos($data,'WEBHOOK_NUMBER_LIMIT_EXCEEDED') !== false) { + if (strpos($data, 'WEBHOOK_NUMBER_LIMIT_EXCEEDED') !== false) { $this->deleteAll(); $result = $obj->create($this->apiContext, $this->mockPayPalRestCall); } else { @@ -176,7 +176,7 @@ public function testDelete($webhook) public function testEventSearch() { - $result = WebhookEvent::all(array(),$this->apiContext, $this->mockPayPalRestCall); + $result = WebhookEvent::all(array(), $this->apiContext, $this->mockPayPalRestCall); $this->assertNotNull($result); return $result; } diff --git a/tests/PayPal/Test/Handler/OauthHandlerTest.php b/tests/PayPal/Test/Handler/OauthHandlerTest.php index b36d6253..d4afc2f2 100644 --- a/tests/PayPal/Test/Handler/OauthHandlerTest.php +++ b/tests/PayPal/Test/Handler/OauthHandlerTest.php @@ -38,7 +38,6 @@ public function setUp() 'clientSecret' ) ); - } public function modeProvider() @@ -67,6 +66,4 @@ public function testGetEndpoint($configs) $this->handler = new OauthHandler($this->apiContext); $this->handler->handle($this->httpConfig, null, $this->config); } - - } diff --git a/tests/PayPal/Test/Rest/ApiContextTest.php b/tests/PayPal/Test/Rest/ApiContextTest.php index 20b4547e..32c711ce 100644 --- a/tests/PayPal/Test/Rest/ApiContextTest.php +++ b/tests/PayPal/Test/Rest/ApiContextTest.php @@ -33,5 +33,4 @@ public function testResetRequestId() $this->assertNotNull($newRequestId); $this->assertNotEquals($newRequestId, $requestId); } - } diff --git a/tests/PayPal/Test/Validation/ArgumentValidatorTest.php b/tests/PayPal/Test/Validation/ArgumentValidatorTest.php index 02d373f7..99214ab1 100644 --- a/tests/PayPal/Test/Validation/ArgumentValidatorTest.php +++ b/tests/PayPal/Test/Validation/ArgumentValidatorTest.php @@ -47,5 +47,4 @@ public function testInvalidDataValidate($input) { $this->assertTrue(ArgumentValidator::validate($input, "Name")); } - } diff --git a/tests/PayPal/Test/Validation/NumericValidatorTest.php b/tests/PayPal/Test/Validation/NumericValidatorTest.php index 360ea044..b9aa2497 100644 --- a/tests/PayPal/Test/Validation/NumericValidatorTest.php +++ b/tests/PayPal/Test/Validation/NumericValidatorTest.php @@ -56,7 +56,6 @@ public function testValidate($input) */ public function testValidateException($input) { - NumericValidator::validate($input, "Test Value"); + NumericValidator::validate($input, "Test Value"); } - } diff --git a/tests/PayPal/Test/Validation/UrlValidatorTest.php b/tests/PayPal/Test/Validation/UrlValidatorTest.php index d1268fda..194b9dc7 100644 --- a/tests/PayPal/Test/Validation/UrlValidatorTest.php +++ b/tests/PayPal/Test/Validation/UrlValidatorTest.php @@ -49,7 +49,6 @@ public function testValidate($input) */ public function testValidateException($input) { - UrlValidator::validate($input, "Test Value"); + UrlValidator::validate($input, "Test Value"); } - }