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 46e86fd..83910d3 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 @@ abstract class AuthorizationCache 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 @@ abstract class AuthorizationCache 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 @@ abstract class AuthorizationCache '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 @@ abstract class AuthorizationCache $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 fdfaba8..78734ef 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 @@ class PayPalModel // 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 18ddb38..927a379 100644 --- a/lib/PayPal/Common/PayPalResourceModel.php +++ b/lib/PayPal/Common/PayPalResourceModel.php @@ -115,4 +115,4 @@ class PayPalResourceModel extends PayPalModel implements IResource $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 d072b2f..c3131ed 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 0b92a5c..f7b397a 100644 --- a/lib/PayPal/Common/ReflectionUtil.php +++ b/lib/PayPal/Common/ReflectionUtil.php @@ -1,6 +1,7 @@ getDocComment(), $annots, @@ -120,7 +121,7 @@ class ReflectionUtil 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 e564742..a237766 100644 --- a/lib/PayPal/Converter/FormatConverter.php +++ b/lib/PayPal/Converter/FormatConverter.php @@ -53,7 +53,7 @@ class FormatConverter 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 f884df4..a7ee1ca 100644 --- a/lib/PayPal/Core/PayPalConfigManager.php +++ b/lib/PayPal/Core/PayPalConfigManager.php @@ -95,7 +95,6 @@ class PayPalConfigManager */ public function get($searchKey) { - if (array_key_exists($searchKey, $this->configs)) { return $this->configs[$searchKey]; } else { @@ -108,7 +107,6 @@ class PayPalConfigManager return $arr; } - } /** @@ -123,7 +121,6 @@ class PayPalConfigManager */ public function getIniPrefix($userId = null) { - if ($userId == null) { $arr = array(); foreach ($this->configs as $key => $value) { @@ -157,7 +154,4 @@ class PayPalConfigManager { trigger_error('Clone is not allowed.', E_USER_ERROR); } - } - - diff --git a/lib/PayPal/Core/PayPalCredentialManager.php b/lib/PayPal/Core/PayPalCredentialManager.php index 77a884e..8f1edd6 100644 --- a/lib/PayPal/Core/PayPalCredentialManager.php +++ b/lib/PayPal/Core/PayPalCredentialManager.php @@ -113,7 +113,6 @@ class PayPalCredentialManager $suffix++; $key = $prefix . $suffix; } - } /** @@ -146,7 +145,7 @@ class PayPalCredentialManager { 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 @@ class PayPalCredentialManager { trigger_error('Clone is not allowed.', E_USER_ERROR); } - } diff --git a/lib/PayPal/Core/PayPalHttpConfig.php b/lib/PayPal/Core/PayPalHttpConfig.php index 6bd4454..8a2b2a3 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 ea0dffd..7e809ec 100644 --- a/lib/PayPal/Core/PayPalHttpConnection.php +++ b/lib/PayPal/Core/PayPalHttpConnection.php @@ -55,7 +55,6 @@ class PayPalHttpConnection */ private function getHttpHeaders() { - $ret = array(); foreach ($this->httpConfig->getHeaders() as $k => $v) { $ret[] = "$k: $v"; @@ -78,8 +77,8 @@ class PayPalHttpConnection //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 @@ class PayPalHttpConnection } //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 @@ class PayPalHttpConnection "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 @@ class PayPalHttpConnection //Return result object return $result; } - } diff --git a/lib/PayPal/Core/PayPalLoggingManager.php b/lib/PayPal/Core/PayPalLoggingManager.php index b9e5892..90521a8 100644 --- a/lib/PayPal/Core/PayPalLoggingManager.php +++ b/lib/PayPal/Core/PayPalLoggingManager.php @@ -116,5 +116,4 @@ class PayPalLoggingManager $this->logger->debug($message); } } - } diff --git a/lib/PayPal/Exception/PayPalInvalidCredentialException.php b/lib/PayPal/Exception/PayPalInvalidCredentialException.php index 2531f5b..09ad27a 100644 --- a/lib/PayPal/Exception/PayPalInvalidCredentialException.php +++ b/lib/PayPal/Exception/PayPalInvalidCredentialException.php @@ -32,5 +32,4 @@ class PayPalInvalidCredentialException extends \Exception . ': ' . $this->getMessage() . ''; return $errorMsg; } - } diff --git a/lib/PayPal/Exception/PayPalMissingCredentialException.php b/lib/PayPal/Exception/PayPalMissingCredentialException.php index 9fac996..6ace3b4 100644 --- a/lib/PayPal/Exception/PayPalMissingCredentialException.php +++ b/lib/PayPal/Exception/PayPalMissingCredentialException.php @@ -33,5 +33,4 @@ class PayPalMissingCredentialException extends \Exception return $errorMsg; } - } diff --git a/lib/PayPal/Handler/OauthHandler.php b/lib/PayPal/Handler/OauthHandler.php index f281eb0..5411508 100644 --- a/lib/PayPal/Handler/OauthHandler.php +++ b/lib/PayPal/Handler/OauthHandler.php @@ -78,9 +78,9 @@ class OauthHandler implements IPayPalHandler { 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 ad581d7..ec5298d 100644 --- a/lib/PayPal/Handler/RestHandler.php +++ b/lib/PayPal/Handler/RestHandler.php @@ -47,7 +47,6 @@ class RestHandler implements IPayPalHandler */ public function handle($httpConfig, $request, $options) { - $credential = $this->apiContext->getCredential(); $config = $this->apiContext->getConfig(); @@ -105,7 +104,7 @@ class RestHandler implements IPayPalHandler { 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 1ac894f..3066810 100644 --- a/lib/PayPal/Log/PayPalDefaultLogFactory.php +++ b/lib/PayPal/Log/PayPalDefaultLogFactory.php @@ -23,4 +23,4 @@ class PayPalDefaultLogFactory implements PayPalLogFactory { 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 ef77318..986adf2 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 17cd229..ed7a80c 100644 --- a/lib/PayPal/Log/PayPalLogger.php +++ b/lib/PayPal/Log/PayPalLogger.php @@ -6,7 +6,6 @@ use PayPal\Core\PayPalConfigManager; use Psr\Log\AbstractLogger; use Psr\Log\LogLevel; - class PayPalLogger extends AbstractLogger { @@ -75,11 +74,11 @@ class PayPalLogger extends AbstractLogger 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 3b7b5a8..f95f21b 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 @@ class Cipher * @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 @@ class Cipher * @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 e80f5ec..f9edf03 100644 --- a/lib/PayPal/Transport/PayPalRestCall.php +++ b/lib/PayPal/Transport/PayPalRestCall.php @@ -52,7 +52,6 @@ class PayPalRestCall */ 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 @@ class PayPalRestCall return $response; } - } diff --git a/lib/PayPal/Validation/ArgumentValidator.php b/lib/PayPal/Validation/ArgumentValidator.php index 5f2d3bf..29e7fa3 100644 --- a/lib/PayPal/Validation/ArgumentValidator.php +++ b/lib/PayPal/Validation/ArgumentValidator.php @@ -23,7 +23,7 @@ class ArgumentValidator 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 1159237..5522ff2 100644 --- a/lib/PayPal/Validation/JsonValidator.php +++ b/lib/PayPal/Validation/JsonValidator.php @@ -32,4 +32,4 @@ class JsonValidator } return true; } -} +} diff --git a/lib/PayPal/Validation/NumericValidator.php b/lib/PayPal/Validation/NumericValidator.php index 6744528..62fa560 100644 --- a/lib/PayPal/Validation/NumericValidator.php +++ b/lib/PayPal/Validation/NumericValidator.php @@ -21,7 +21,6 @@ class NumericValidator { 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 ffd195c..1b423f2 100644 --- a/lib/PayPal/Validation/UrlValidator.php +++ b/lib/PayPal/Validation/UrlValidator.php @@ -23,4 +23,4 @@ class UrlValidator 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 f0866b9..ae4f25c 100644 --- a/sample/billing/CreateBillingAgreementWithCreditCard.php +++ b/sample/billing/CreateBillingAgreementWithCreditCard.php @@ -99,7 +99,6 @@ $request = clone $agreement; 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 f781267..51cee3c 100644 --- a/sample/billing/CreateBillingAgreementWithPayPal.php +++ b/sample/billing/CreateBillingAgreementWithPayPal.php @@ -74,7 +74,6 @@ try { // 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 1050efa..b71a90b 100644 --- a/sample/billing/CreatePlan.php +++ b/sample/billing/CreatePlan.php @@ -66,7 +66,7 @@ try { $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 c86e3b3..9556b95 100644 --- a/sample/billing/DeletePlan.php +++ b/sample/billing/DeletePlan.php @@ -16,7 +16,7 @@ try { $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 35e17ea..b8656da 100644 --- a/sample/billing/ExecuteAgreement.php +++ b/sample/billing/ExecuteAgreement.php @@ -8,7 +8,6 @@ require __DIR__ . '/../bootstrap.php'; // ## 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 @@ if (isset($_GET['success']) && $_GET['success'] == 'true') { $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 @@ if (isset($_GET['success']) && $_GET['success'] == 'true') { $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 c1d347d..97d5f82 100644 --- a/sample/billing/GetBillingAgreement.php +++ b/sample/billing/GetBillingAgreement.php @@ -16,7 +16,7 @@ try { $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 054e48e..5d259c6 100644 --- a/sample/billing/GetPlan.php +++ b/sample/billing/GetPlan.php @@ -16,7 +16,7 @@ try { $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 f56746d..6636904 100644 --- a/sample/billing/ListPlans.php +++ b/sample/billing/ListPlans.php @@ -21,7 +21,7 @@ try { $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 b82e1ef..ed6f189 100644 --- a/sample/billing/ReactivateBillingAgreement.php +++ b/sample/billing/ReactivateBillingAgreement.php @@ -18,12 +18,10 @@ $agreementStateDescriptor = new AgreementStateDescriptor(); $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 5713b52..7b9ca0d 100644 --- a/sample/billing/SearchBillingTransactions.php +++ b/sample/billing/SearchBillingTransactions.php @@ -22,7 +22,7 @@ try { $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 fb12581..67e4c3d 100644 --- a/sample/billing/SuspendBillingAgreement.php +++ b/sample/billing/SuspendBillingAgreement.php @@ -18,15 +18,13 @@ $agreementStateDescriptor = new AgreementStateDescriptor(); $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 ba8fb81..0f6edcd 100644 --- a/sample/billing/UpdateBillingAgreement.php +++ b/sample/billing/UpdateBillingAgreement.php @@ -35,10 +35,9 @@ try { // 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 cfe2039..c01433d 100644 --- a/sample/billing/UpdatePlan.php +++ b/sample/billing/UpdatePlan.php @@ -34,10 +34,9 @@ try { $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 8132d6f..7be025b 100644 --- a/sample/billing/UpdatePlanPaymentDefinitions.php +++ b/sample/billing/UpdatePlanPaymentDefinitions.php @@ -40,10 +40,9 @@ try { $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 8dd22ff..1ca7db6 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 7e244fb..82a20a8 100644 --- a/sample/invoice/CreateInvoice.php +++ b/sample/invoice/CreateInvoice.php @@ -155,7 +155,7 @@ try { $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 81867c2..59a6aac 100644 --- a/sample/invoice/CreateThirdPartyInvoice.php +++ b/sample/invoice/CreateThirdPartyInvoice.php @@ -98,7 +98,7 @@ try { $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 7657b9d..207d377 100644 --- a/sample/invoice/DeleteInvoice.php +++ b/sample/invoice/DeleteInvoice.php @@ -20,7 +20,7 @@ try { $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 d256048..29b5b64 100644 --- a/sample/invoice/GetInvoice.php +++ b/sample/invoice/GetInvoice.php @@ -20,7 +20,7 @@ try { $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 948484a..52711ad 100644 --- a/sample/invoice/GetNextInvoiceNumber.php +++ b/sample/invoice/GetNextInvoiceNumber.php @@ -14,7 +14,7 @@ try { $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 99a3cc0..291dd34 100644 --- a/sample/invoice/ListInvoice.php +++ b/sample/invoice/ListInvoice.php @@ -17,7 +17,7 @@ try { $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 b413b37..4852018 100644 --- a/sample/invoice/RecordPayment.php +++ b/sample/invoice/RecordPayment.php @@ -31,7 +31,7 @@ try { $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 @@ try { $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 12144fe..d3faabb 100644 --- a/sample/invoice/RecordRefund.php +++ b/sample/invoice/RecordRefund.php @@ -30,7 +30,7 @@ try { $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 @@ try { $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 dc8ab16..7e04717 100644 --- a/sample/invoice/RemindInvoice.php +++ b/sample/invoice/RemindInvoice.php @@ -31,7 +31,7 @@ try { $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 @@ try { $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 e9cbd1d..4db3f59 100644 --- a/sample/invoice/RetrieveQRCode.php +++ b/sample/invoice/RetrieveQRCode.php @@ -23,11 +23,9 @@ try { // '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 @@ try { // 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 b94a3a8..793baa3 100644 --- a/sample/invoice/SearchInvoices.php +++ b/sample/invoice/SearchInvoices.php @@ -31,7 +31,7 @@ try { $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 01ca388..9c8c59d 100644 --- a/sample/invoice/SendInvoice.php +++ b/sample/invoice/SendInvoice.php @@ -34,7 +34,7 @@ try { $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 57ca622..020e1ea 100644 --- a/sample/invoice/UpdateInvoice.php +++ b/sample/invoice/UpdateInvoice.php @@ -30,7 +30,7 @@ try { $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 @@ try { $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 ff90540..31c21aa 100644 --- a/sample/lipp/GenerateAccessTokenFromRefreshToken.php +++ b/sample/lipp/GenerateAccessTokenFromRefreshToken.php @@ -9,13 +9,11 @@ use PayPal\Api\OpenIdTokeninfo; $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 52b8be7..0ec4525 100644 --- a/sample/lipp/GetUserInfo.php +++ b/sample/lipp/GetUserInfo.php @@ -21,16 +21,14 @@ use PayPal\Api\OpenIdUserinfo; $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 ee97021..914e4cb 100644 --- a/sample/lipp/ObtainUserConsent.php +++ b/sample/lipp/ObtainUserConsent.php @@ -13,7 +13,7 @@ $baseUrl = getBaseUrl() . '/UserConsentRedirect.php?success=true'; $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 6ac77e7..2911afb 100644 --- a/sample/lipp/UserConsentRedirect.php +++ b/sample/lipp/UserConsentRedirect.php @@ -11,7 +11,6 @@ session_start(); // 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 @@ if (isset($_GET['success']) && $_GET['success'] == 'true') { $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 7606b52..c82796e 100644 --- a/sample/notifications/CreateWebhook.php +++ b/sample/notifications/CreateWebhook.php @@ -58,7 +58,7 @@ try { $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 @@ try { } } 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 746a7b0..27b1fc0 100644 --- a/sample/notifications/DeleteAllWebhooks.php +++ b/sample/notifications/DeleteAllWebhooks.php @@ -16,7 +16,7 @@ try { } } 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 c1c70bc..09bb898 100644 --- a/sample/notifications/DeleteWebhook.php +++ b/sample/notifications/DeleteWebhook.php @@ -17,7 +17,7 @@ try { $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 3ec7a7f..ce88368 100644 --- a/sample/notifications/GetWebhook.php +++ b/sample/notifications/GetWebhook.php @@ -18,7 +18,7 @@ try { $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 186d23b..bfb37e9 100644 --- a/sample/notifications/ListSubscribedWebhookEventTypes.php +++ b/sample/notifications/ListSubscribedWebhookEventTypes.php @@ -18,11 +18,11 @@ try { $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 05c1dbf..f3b3b18 100644 --- a/sample/notifications/ListWebhooks.php +++ b/sample/notifications/ListWebhooks.php @@ -19,11 +19,11 @@ try { $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 cabbc6a..45a7d93 100644 --- a/sample/notifications/SearchWebhookEvents.php +++ b/sample/notifications/SearchWebhookEvents.php @@ -23,7 +23,7 @@ try { $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 043733b..c216cf0 100644 --- a/sample/notifications/UpdateWebhook.php +++ b/sample/notifications/UpdateWebhook.php @@ -47,7 +47,7 @@ try { $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 e8c5372..3e24a17 100644 --- a/sample/notifications/ValidateWebhookEvent.php +++ b/sample/notifications/ValidateWebhookEvent.php @@ -32,5 +32,3 @@ try { // 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 f19d591..c8589b5 100644 --- a/sample/notifications/WebhookEventTypesList.php +++ b/sample/notifications/WebhookEventTypesList.php @@ -13,7 +13,7 @@ try { $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 cac85c8..43007b0 100644 --- a/sample/payment-experience/CreateWebProfile.php +++ b/sample/payment-experience/CreateWebProfile.php @@ -53,7 +53,7 @@ try { $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 9cf0c1f..dc66b9a 100644 --- a/sample/payment-experience/DeleteWebProfile.php +++ b/sample/payment-experience/DeleteWebProfile.php @@ -20,7 +20,7 @@ try { $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 09bcc93..6b06f82 100644 --- a/sample/payment-experience/GetWebProfile.php +++ b/sample/payment-experience/GetWebProfile.php @@ -16,7 +16,7 @@ try { $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 57762c7..6b838e1 100644 --- a/sample/payment-experience/ListWebProfiles.php +++ b/sample/payment-experience/ListWebProfiles.php @@ -12,7 +12,7 @@ try { $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 79b25f8..5ab53b5 100644 --- a/sample/payment-experience/PartiallyUpdateWebProfile.php +++ b/sample/payment-experience/PartiallyUpdateWebProfile.php @@ -38,7 +38,7 @@ try { } } 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 4cf4770..697a92b 100644 --- a/sample/payment-experience/UpdateWebProfile.php +++ b/sample/payment-experience/UpdateWebProfile.php @@ -22,7 +22,7 @@ try { } } 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 493e4c5..0cbe9c0 100644 --- a/sample/payments/AuthorizationCapture.php +++ b/sample/payments/AuthorizationCapture.php @@ -11,7 +11,6 @@ use PayPal\Api\Amount; 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 @@ try { $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 c32b581..f7959fe 100644 --- a/sample/payments/AuthorizePayment.php +++ b/sample/payments/AuthorizePayment.php @@ -69,7 +69,7 @@ try { $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 10900ed..bb4eb65 100644 --- a/sample/payments/AuthorizePaymentUsingPayPal.php +++ b/sample/payments/AuthorizePaymentUsingPayPal.php @@ -101,7 +101,7 @@ try { $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 c3e3f59..10aa458 100644 --- a/sample/payments/CreateFuturePayment.php +++ b/sample/payments/CreateFuturePayment.php @@ -84,10 +84,9 @@ try { // 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 54da48b..bbebc1f 100644 --- a/sample/payments/CreatePayment.php +++ b/sample/payments/CreatePayment.php @@ -114,7 +114,7 @@ try { $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 88d5aa5..47a7925 100644 --- a/sample/payments/CreatePaymentUsingPayPal.php +++ b/sample/payments/CreatePaymentUsingPayPal.php @@ -101,7 +101,7 @@ try { $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 96f8512..115bc65 100644 --- a/sample/payments/CreatePaymentUsingSavedCard.php +++ b/sample/payments/CreatePaymentUsingSavedCard.php @@ -105,7 +105,7 @@ try { $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 c1fb9e5..21fc4ef 100644 --- a/sample/payments/ExecutePayment.php +++ b/sample/payments/ExecutePayment.php @@ -69,12 +69,12 @@ if (isset($_GET['success']) && $_GET['success'] == 'true') { $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 @@ if (isset($_GET['success']) && $_GET['success'] == 'true') { 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 6e423af..674bdf4 100644 --- a/sample/payments/GetAuthorization.php +++ b/sample/payments/GetAuthorization.php @@ -20,7 +20,7 @@ try { $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 19cea3a..01333f4 100644 --- a/sample/payments/GetCapture.php +++ b/sample/payments/GetCapture.php @@ -16,7 +16,7 @@ try { $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 9df9b66..c77335f 100644 --- a/sample/payments/GetPayment.php +++ b/sample/payments/GetPayment.php @@ -24,7 +24,7 @@ try { $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 5811072..b2c0baf 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 @@ use PayPal\Api\Payment; // 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 441dfa9..77bb34e 100644 --- a/sample/payments/OrderAuthorize.php +++ b/sample/payments/OrderAuthorize.php @@ -40,12 +40,11 @@ if (isset($_GET['success']) && $_GET['success'] == 'true') { 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 d704081..7a62817 100644 --- a/sample/payments/OrderCapture.php +++ b/sample/payments/OrderCapture.php @@ -41,12 +41,11 @@ if (isset($_GET['success']) && $_GET['success'] == 'true') { 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 704e39a..cbda732 100644 --- a/sample/payments/OrderCreateForAuthorization.php +++ b/sample/payments/OrderCreateForAuthorization.php @@ -98,7 +98,7 @@ try { $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 d0882c4..43ed522 100644 --- a/sample/payments/OrderCreateForCapture.php +++ b/sample/payments/OrderCreateForCapture.php @@ -98,7 +98,7 @@ try { $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 eea420d..20c67c5 100644 --- a/sample/payments/OrderCreateForVoid.php +++ b/sample/payments/OrderCreateForVoid.php @@ -98,7 +98,7 @@ try { $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 f194394..8750c21 100644 --- a/sample/payments/OrderCreateUsingPayPal.php +++ b/sample/payments/OrderCreateUsingPayPal.php @@ -98,7 +98,7 @@ try { $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 7c0e287..062d709 100644 --- a/sample/payments/OrderDoVoid.php +++ b/sample/payments/OrderDoVoid.php @@ -27,12 +27,11 @@ if (isset($_GET['success']) && $_GET['success'] == 'true') { 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 05da1e2..d1d9386 100644 --- a/sample/payments/OrderGet.php +++ b/sample/payments/OrderGet.php @@ -9,7 +9,6 @@ $payment = require __DIR__ . '/ExecutePayment.php'; // ### 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 @@ if (isset($_GET['success']) && $_GET['success'] == 'true') { 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 dbebdfa..3dfd462 100644 --- a/sample/payments/Reauthorization.php +++ b/sample/payments/Reauthorization.php @@ -17,7 +17,6 @@ use PayPal\Api\Authorization; // has expired. try { - $amount = new Amount(); $amount->setCurrency("USD"); $amount->setTotal(1); @@ -28,7 +27,7 @@ try { $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 1ebbdaf..9fbc5eb 100644 --- a/sample/payments/RefundCapture.php +++ b/sample/payments/RefundCapture.php @@ -24,7 +24,7 @@ try { $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 1f4170b..f6cad80 100644 --- a/sample/payments/UpdatePayment.php +++ b/sample/payments/UpdatePayment.php @@ -81,10 +81,9 @@ $patchRequest->setPatches(array($patchReplace, $patchAdd)); // (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 2eb5996..e943a3f 100644 --- a/sample/payments/VoidAuthorization.php +++ b/sample/payments/VoidAuthorization.php @@ -10,7 +10,6 @@ $authorization = require 'AuthorizePayment.php'; $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 @@ try { $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 0e8aac6..c1ad421 100644 --- a/sample/payouts/CancelPayoutItem.php +++ b/sample/payouts/CancelPayoutItem.php @@ -26,11 +26,11 @@ try { } 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 5003c93..a5e9ba1 100644 --- a/sample/payouts/CreateBatchPayout.php +++ b/sample/payouts/CreateBatchPayout.php @@ -116,7 +116,7 @@ try { $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 dd487d9..56708ee 100644 --- a/sample/payouts/CreateSinglePayout.php +++ b/sample/payouts/CreateSinglePayout.php @@ -65,7 +65,7 @@ try { $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 6423abd..68194df 100644 --- a/sample/payouts/GetPayoutBatchStatus.php +++ b/sample/payouts/GetPayoutBatchStatus.php @@ -17,7 +17,7 @@ try { $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 6bc577f..d0eb287 100644 --- a/sample/payouts/GetPayoutItemStatus.php +++ b/sample/payouts/GetPayoutItemStatus.php @@ -19,7 +19,7 @@ try { $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 8b91501..2792b39 100644 --- a/sample/sale/GetSale.php +++ b/sample/sale/GetSale.php @@ -25,7 +25,7 @@ try { $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 ef51d1e..ccf3b27 100644 --- a/sample/sale/RefundSale.php +++ b/sample/sale/RefundSale.php @@ -42,7 +42,7 @@ try { $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 aeda49b..d8952aa 100644 --- a/sample/vault/CreateBankAccount.php +++ b/sample/vault/CreateBankAccount.php @@ -73,7 +73,7 @@ try { $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 e025b9a..d1b98d7 100644 --- a/sample/vault/CreateCreditCard.php +++ b/sample/vault/CreateCreditCard.php @@ -46,7 +46,7 @@ try { $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 48b3835..b4d7914 100644 --- a/sample/vault/DeleteBankAccount.php +++ b/sample/vault/DeleteBankAccount.php @@ -15,7 +15,7 @@ try { $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 3676f58..b5e24f5 100644 --- a/sample/vault/DeleteCreditCard.php +++ b/sample/vault/DeleteCreditCard.php @@ -16,7 +16,7 @@ try { $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 721f287..a76f51b 100644 --- a/sample/vault/GetBankAccount.php +++ b/sample/vault/GetBankAccount.php @@ -17,7 +17,7 @@ try { $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 e106d97..f183c02 100644 --- a/sample/vault/GetCreditCard.php +++ b/sample/vault/GetCreditCard.php @@ -18,7 +18,7 @@ try { $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 8cd5d81..a198b19 100644 --- a/sample/vault/ListCreditCards.php +++ b/sample/vault/ListCreditCards.php @@ -26,7 +26,7 @@ try { $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 9e65944..880cdc8 100644 --- a/sample/vault/UpdateCreditCard.php +++ b/sample/vault/UpdateCreditCard.php @@ -43,7 +43,7 @@ try { $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 b3ebcf9..bfac065 100644 --- a/tests/PayPal/Test/Api/AddressTest.php +++ b/tests/PayPal/Test/Api/AddressTest.php @@ -70,6 +70,4 @@ class AddressTest extends \PHPUnit_Framework_TestCase $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 3099606..f6737e5 100644 --- a/tests/PayPal/Test/Api/AgreementStateDescriptorTest.php +++ b/tests/PayPal/Test/Api/AgreementStateDescriptorTest.php @@ -53,5 +53,4 @@ class AgreementStateDescriptorTest extends \PHPUnit_Framework_TestCase $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 47f02ca..2cea200 100644 --- a/tests/PayPal/Test/Api/AgreementTransactionTest.php +++ b/tests/PayPal/Test/Api/AgreementTransactionTest.php @@ -69,5 +69,4 @@ class AgreementTransactionTest extends \PHPUnit_Framework_TestCase $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 5d513d2..7abf98b 100644 --- a/tests/PayPal/Test/Api/AgreementTransactionsTest.php +++ b/tests/PayPal/Test/Api/AgreementTransactionsTest.php @@ -51,5 +51,4 @@ class AgreementTransactionsTest extends \PHPUnit_Framework_TestCase { $this->assertEquals($obj->getAgreementTransactionList(), AgreementTransactionTest::getObject()); } - } diff --git a/tests/PayPal/Test/Api/AlternatePaymentTest.php b/tests/PayPal/Test/Api/AlternatePaymentTest.php index 13d9eee..73c218a 100644 --- a/tests/PayPal/Test/Api/AlternatePaymentTest.php +++ b/tests/PayPal/Test/Api/AlternatePaymentTest.php @@ -55,6 +55,4 @@ class AlternatePaymentTest extends \PHPUnit_Framework_TestCase $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 ecd4061..ba51178 100644 --- a/tests/PayPal/Test/Api/AmountTest.php +++ b/tests/PayPal/Test/Api/AmountTest.php @@ -58,6 +58,4 @@ class AmountTest extends \PHPUnit_Framework_TestCase $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 d97cc5f..8e21719 100644 --- a/tests/PayPal/Test/Api/BankAccountTest.php +++ b/tests/PayPal/Test/Api/BankAccountTest.php @@ -100,6 +100,4 @@ class BankAccountTest extends \PHPUnit_Framework_TestCase $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 d834f3f..1736e28 100644 --- a/tests/PayPal/Test/Api/BankAccountsListTest.php +++ b/tests/PayPal/Test/Api/BankAccountsListTest.php @@ -55,5 +55,4 @@ class BankAccountsListTest extends \PHPUnit_Framework_TestCase $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 659ff15..f0a3206 100644 --- a/tests/PayPal/Test/Api/BankTokenTest.php +++ b/tests/PayPal/Test/Api/BankTokenTest.php @@ -58,6 +58,4 @@ class BankTokenTest extends \PHPUnit_Framework_TestCase $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 540b937..b5b2188 100644 --- a/tests/PayPal/Test/Api/BillingInfoTest.php +++ b/tests/PayPal/Test/Api/BillingInfoTest.php @@ -67,5 +67,4 @@ class BillingInfoTest extends \PHPUnit_Framework_TestCase $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 b30210b..332c488 100644 --- a/tests/PayPal/Test/Api/BillingTest.php +++ b/tests/PayPal/Test/Api/BillingTest.php @@ -51,6 +51,4 @@ class BillingTest extends \PHPUnit_Framework_TestCase { $this->assertEquals($obj->getBillingAgreementId(), "TestSample"); } - - } diff --git a/tests/PayPal/Test/Api/CancelNotificationTest.php b/tests/PayPal/Test/Api/CancelNotificationTest.php index 6454cc2..685a450 100644 --- a/tests/PayPal/Test/Api/CancelNotificationTest.php +++ b/tests/PayPal/Test/Api/CancelNotificationTest.php @@ -57,5 +57,4 @@ class CancelNotificationTest extends \PHPUnit_Framework_TestCase $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 c4cef65..1efd2c6 100644 --- a/tests/PayPal/Test/Api/CarrierAccountTest.php +++ b/tests/PayPal/Test/Api/CarrierAccountTest.php @@ -59,6 +59,4 @@ class CarrierAccountTest extends \PHPUnit_Framework_TestCase $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 dfb909a..c4986c3 100644 --- a/tests/PayPal/Test/Api/CarrierAccountTokenTest.php +++ b/tests/PayPal/Test/Api/CarrierAccountTokenTest.php @@ -56,6 +56,4 @@ class CarrierAccountTokenTest extends \PHPUnit_Framework_TestCase $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 73ec0b3..e2e2037 100644 --- a/tests/PayPal/Test/Api/CartBaseTest.php +++ b/tests/PayPal/Test/Api/CartBaseTest.php @@ -100,5 +100,4 @@ class CartBaseTest extends \PHPUnit_Framework_TestCase $obj = new CartBase(); $obj->setOrderUrl(null); } - } diff --git a/tests/PayPal/Test/Api/ChargeModelTest.php b/tests/PayPal/Test/Api/ChargeModelTest.php index 46f4d2a..d375008 100644 --- a/tests/PayPal/Test/Api/ChargeModelTest.php +++ b/tests/PayPal/Test/Api/ChargeModelTest.php @@ -55,5 +55,4 @@ class ChargeModelTest extends \PHPUnit_Framework_TestCase $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 61e3861..970c632 100644 --- a/tests/PayPal/Test/Api/CostTest.php +++ b/tests/PayPal/Test/Api/CostTest.php @@ -53,5 +53,4 @@ class CostTest extends \PHPUnit_Framework_TestCase $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 f5cbded..6ddda75 100644 --- a/tests/PayPal/Test/Api/CountryCodeTest.php +++ b/tests/PayPal/Test/Api/CountryCodeTest.php @@ -51,6 +51,4 @@ class CountryCodeTest extends \PHPUnit_Framework_TestCase { $this->assertEquals($obj->getCountryCode(), "TestSample"); } - - } diff --git a/tests/PayPal/Test/Api/CreateProfileResponseTest.php b/tests/PayPal/Test/Api/CreateProfileResponseTest.php index ec2da48..88138cd 100644 --- a/tests/PayPal/Test/Api/CreateProfileResponseTest.php +++ b/tests/PayPal/Test/Api/CreateProfileResponseTest.php @@ -51,5 +51,4 @@ class CreateProfileResponseTest extends \PHPUnit_Framework_TestCase { $this->assertEquals($obj->getId(), "TestSample"); } - } diff --git a/tests/PayPal/Test/Api/CreditCardHistoryTest.php b/tests/PayPal/Test/Api/CreditCardHistoryTest.php index 14dd6a9..9308bb2 100644 --- a/tests/PayPal/Test/Api/CreditCardHistoryTest.php +++ b/tests/PayPal/Test/Api/CreditCardHistoryTest.php @@ -39,7 +39,6 @@ class CreditCardHistoryTest extends \PHPUnit_Framework_TestCase 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 3a266c9..fb1f81d 100644 --- a/tests/PayPal/Test/Api/CreditCardListTest.php +++ b/tests/PayPal/Test/Api/CreditCardListTest.php @@ -57,5 +57,4 @@ class CreditCardListTest extends \PHPUnit_Framework_TestCase $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 0eb4f7c..681ed1d 100644 --- a/tests/PayPal/Test/Api/CreditCardTest.php +++ b/tests/PayPal/Test/Api/CreditCardTest.php @@ -78,6 +78,4 @@ class CreditCardTest extends \PHPUnit_Framework_TestCase $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 21aa209..2d6bab1 100644 --- a/tests/PayPal/Test/Api/CreditCardTokenTest.php +++ b/tests/PayPal/Test/Api/CreditCardTokenTest.php @@ -64,6 +64,4 @@ class CreditCardTokenTest extends \PHPUnit_Framework_TestCase $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 878371a..c8d8208 100644 --- a/tests/PayPal/Test/Api/CreditFinancingOfferedTest.php +++ b/tests/PayPal/Test/Api/CreditFinancingOfferedTest.php @@ -61,6 +61,4 @@ class CreditFinancingOfferedTest extends \PHPUnit_Framework_TestCase $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 56cca3f..51f9137 100644 --- a/tests/PayPal/Test/Api/CreditTest.php +++ b/tests/PayPal/Test/Api/CreditTest.php @@ -56,6 +56,4 @@ class CreditTest extends \PHPUnit_Framework_TestCase $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 9027f3b..1b1c213 100644 --- a/tests/PayPal/Test/Api/CurrencyConversionTest.php +++ b/tests/PayPal/Test/Api/CurrencyConversionTest.php @@ -87,5 +87,4 @@ class CurrencyConversionTest extends \PHPUnit_Framework_TestCase $obj->setWebUrl(null); $this->assertNull($obj->getWebUrl()); } - } diff --git a/tests/PayPal/Test/Api/CurrencyTest.php b/tests/PayPal/Test/Api/CurrencyTest.php index 19cc0cf..38dfeea 100644 --- a/tests/PayPal/Test/Api/CurrencyTest.php +++ b/tests/PayPal/Test/Api/CurrencyTest.php @@ -56,6 +56,4 @@ class CurrencyTest extends \PHPUnit_Framework_TestCase $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 1b8d1a4..7c02682 100644 --- a/tests/PayPal/Test/Api/CustomAmountTest.php +++ b/tests/PayPal/Test/Api/CustomAmountTest.php @@ -53,5 +53,4 @@ class CustomAmountTest extends \PHPUnit_Framework_TestCase $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 a1e708f..78e0327 100644 --- a/tests/PayPal/Test/Api/DetailsTest.php +++ b/tests/PayPal/Test/Api/DetailsTest.php @@ -68,6 +68,4 @@ class DetailsTest extends \PHPUnit_Framework_TestCase $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 60b9e77..292c6fd 100644 --- a/tests/PayPal/Test/Api/ErrorDetailsTest.php +++ b/tests/PayPal/Test/Api/ErrorDetailsTest.php @@ -60,6 +60,4 @@ class ErrorDetailsTest extends \PHPUnit_Framework_TestCase $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 4d12f3f..c20a584 100644 --- a/tests/PayPal/Test/Api/ErrorTest.php +++ b/tests/PayPal/Test/Api/ErrorTest.php @@ -72,6 +72,4 @@ class ErrorTest extends \PHPUnit_Framework_TestCase $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 fc9533f..edb427d 100644 --- a/tests/PayPal/Test/Api/ExtendedBankAccountTest.php +++ b/tests/PayPal/Test/Api/ExtendedBankAccountTest.php @@ -54,6 +54,4 @@ class ExtendedBankAccountTest extends \PHPUnit_Framework_TestCase { $this->assertEquals($obj->getMandateReferenceNumber(), "TestSample"); } - - } diff --git a/tests/PayPal/Test/Api/ExternalFundingTest.php b/tests/PayPal/Test/Api/ExternalFundingTest.php index f3fadd5..2e85b44 100644 --- a/tests/PayPal/Test/Api/ExternalFundingTest.php +++ b/tests/PayPal/Test/Api/ExternalFundingTest.php @@ -59,6 +59,4 @@ class ExternalFundingTest extends \PHPUnit_Framework_TestCase $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 b091164..15bc029 100644 --- a/tests/PayPal/Test/Api/FileAttachmentTest.php +++ b/tests/PayPal/Test/Api/FileAttachmentTest.php @@ -64,5 +64,4 @@ class FileAttachmentTest extends \PHPUnit_Framework_TestCase $obj = new FileAttachment(); $obj->setUrl(null); } - } diff --git a/tests/PayPal/Test/Api/FlowConfigTest.php b/tests/PayPal/Test/Api/FlowConfigTest.php index 7644839..3c24457 100644 --- a/tests/PayPal/Test/Api/FlowConfigTest.php +++ b/tests/PayPal/Test/Api/FlowConfigTest.php @@ -63,5 +63,4 @@ class FlowConfigTest extends \PHPUnit_Framework_TestCase $obj = new FlowConfig(); $obj->setBankTxnPendingUrl(null); } - } diff --git a/tests/PayPal/Test/Api/FmfDetailsTest.php b/tests/PayPal/Test/Api/FmfDetailsTest.php index 96eb7ad..1a06b7b 100644 --- a/tests/PayPal/Test/Api/FmfDetailsTest.php +++ b/tests/PayPal/Test/Api/FmfDetailsTest.php @@ -60,6 +60,4 @@ class FmfDetailsTest extends \PHPUnit_Framework_TestCase $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 9f1f947..0960073 100644 --- a/tests/PayPal/Test/Api/FundingDetailTest.php +++ b/tests/PayPal/Test/Api/FundingDetailTest.php @@ -60,6 +60,4 @@ class FundingDetailTest extends \PHPUnit_Framework_TestCase $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 a329171..401113a 100644 --- a/tests/PayPal/Test/Api/FundingInstrumentTest.php +++ b/tests/PayPal/Test/Api/FundingInstrumentTest.php @@ -78,6 +78,4 @@ class FundingInstrumentTest extends \PHPUnit_Framework_TestCase $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 ed44ef1..3918250 100644 --- a/tests/PayPal/Test/Api/FundingOptionTest.php +++ b/tests/PayPal/Test/Api/FundingOptionTest.php @@ -64,6 +64,4 @@ class FundingOptionTest extends \PHPUnit_Framework_TestCase $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 d6160d4..9f0756d 100644 --- a/tests/PayPal/Test/Api/FundingSourceTest.php +++ b/tests/PayPal/Test/Api/FundingSourceTest.php @@ -70,6 +70,4 @@ class FundingSourceTest extends \PHPUnit_Framework_TestCase $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 c53772e..68d7e75 100644 --- a/tests/PayPal/Test/Api/HyperSchemaTest.php +++ b/tests/PayPal/Test/Api/HyperSchemaTest.php @@ -61,5 +61,4 @@ class HyperSchemaTest extends \PHPUnit_Framework_TestCase $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 6af355c..107540d 100644 --- a/tests/PayPal/Test/Api/ImageTest.php +++ b/tests/PayPal/Test/Api/ImageTest.php @@ -51,5 +51,4 @@ class ImageTest extends \PHPUnit_Framework_TestCase { $this->assertEquals($obj->getImage(), "TestSample"); } - } diff --git a/tests/PayPal/Test/Api/IncentiveTest.php b/tests/PayPal/Test/Api/IncentiveTest.php index 7f9aff8..cfe3cba 100644 --- a/tests/PayPal/Test/Api/IncentiveTest.php +++ b/tests/PayPal/Test/Api/IncentiveTest.php @@ -80,5 +80,4 @@ class IncentiveTest extends \PHPUnit_Framework_TestCase $obj = new Incentive(); $obj->setLogoImageUrl(null); } - } diff --git a/tests/PayPal/Test/Api/InputFieldsTest.php b/tests/PayPal/Test/Api/InputFieldsTest.php index 588f89c..3b86bf1 100644 --- a/tests/PayPal/Test/Api/InputFieldsTest.php +++ b/tests/PayPal/Test/Api/InputFieldsTest.php @@ -55,5 +55,4 @@ class InputFieldsTest extends \PHPUnit_Framework_TestCase $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 8867823..c819229 100644 --- a/tests/PayPal/Test/Api/InstallmentInfoTest.php +++ b/tests/PayPal/Test/Api/InstallmentInfoTest.php @@ -60,6 +60,4 @@ class InstallmentInfoTest extends \PHPUnit_Framework_TestCase $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 9c66ffc..9c0a413 100644 --- a/tests/PayPal/Test/Api/InstallmentOptionTest.php +++ b/tests/PayPal/Test/Api/InstallmentOptionTest.php @@ -60,6 +60,4 @@ class InstallmentOptionTest extends \PHPUnit_Framework_TestCase $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 257f3de..e0f7050 100644 --- a/tests/PayPal/Test/Api/InvoiceAddressTest.php +++ b/tests/PayPal/Test/Api/InvoiceAddressTest.php @@ -63,5 +63,4 @@ class InvoiceAddressTest extends \PHPUnit_Framework_TestCase $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 fbb6c2c..0ff8a44 100644 --- a/tests/PayPal/Test/Api/InvoiceItemTest.php +++ b/tests/PayPal/Test/Api/InvoiceItemTest.php @@ -77,5 +77,4 @@ class InvoiceItemTest extends \PHPUnit_Framework_TestCase $obj = new InvoiceItem(); $obj->setImageUrl(null); } - } diff --git a/tests/PayPal/Test/Api/InvoiceNumberTest.php b/tests/PayPal/Test/Api/InvoiceNumberTest.php index 7c5985e..4c6c028 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 cbba180..fbf6ee3 100644 --- a/tests/PayPal/Test/Api/InvoiceSearchResponseTest.php +++ b/tests/PayPal/Test/Api/InvoiceSearchResponseTest.php @@ -53,5 +53,4 @@ class InvoiceSearchResponseTest extends \PHPUnit_Framework_TestCase $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 2f9a805..0099d94 100644 --- a/tests/PayPal/Test/Api/ItemListTest.php +++ b/tests/PayPal/Test/Api/ItemListTest.php @@ -60,6 +60,4 @@ class ItemListTest extends \PHPUnit_Framework_TestCase $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 311d108..ae46b9d 100644 --- a/tests/PayPal/Test/Api/ItemTest.php +++ b/tests/PayPal/Test/Api/ItemTest.php @@ -92,5 +92,4 @@ class ItemTest extends \PHPUnit_Framework_TestCase $obj = new Item(); $obj->setUrl(null); } - } diff --git a/tests/PayPal/Test/Api/LinksTest.php b/tests/PayPal/Test/Api/LinksTest.php index f8d008a..5168144 100644 --- a/tests/PayPal/Test/Api/LinksTest.php +++ b/tests/PayPal/Test/Api/LinksTest.php @@ -61,5 +61,4 @@ class LinksTest extends \PHPUnit_Framework_TestCase $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 889f7ef..dd23b68 100644 --- a/tests/PayPal/Test/Api/MeasurementTest.php +++ b/tests/PayPal/Test/Api/MeasurementTest.php @@ -56,6 +56,4 @@ class MeasurementTest extends \PHPUnit_Framework_TestCase $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 f68a8e9..38466b4 100644 --- a/tests/PayPal/Test/Api/MerchantInfoTest.php +++ b/tests/PayPal/Test/Api/MerchantInfoTest.php @@ -71,5 +71,4 @@ class MerchantInfoTest extends \PHPUnit_Framework_TestCase $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 513925d..3f78c9a 100644 --- a/tests/PayPal/Test/Api/MerchantPreferencesTest.php +++ b/tests/PayPal/Test/Api/MerchantPreferencesTest.php @@ -116,5 +116,4 @@ class MerchantPreferencesTest extends \PHPUnit_Framework_TestCase $obj->setNotifyUrl(null); $this->assertNull($obj->getNotifyUrl()); } - } diff --git a/tests/PayPal/Test/Api/MetadataTest.php b/tests/PayPal/Test/Api/MetadataTest.php index 1e85fee..a62a807 100644 --- a/tests/PayPal/Test/Api/MetadataTest.php +++ b/tests/PayPal/Test/Api/MetadataTest.php @@ -86,5 +86,4 @@ class MetadataTest extends \PHPUnit_Framework_TestCase $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 c709df7..8fd0d50 100644 --- a/tests/PayPal/Test/Api/NameValuePairTest.php +++ b/tests/PayPal/Test/Api/NameValuePairTest.php @@ -56,6 +56,4 @@ class NameValuePairTest extends \PHPUnit_Framework_TestCase $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 eb0b91d..38af754 100644 --- a/tests/PayPal/Test/Api/NotificationTest.php +++ b/tests/PayPal/Test/Api/NotificationTest.php @@ -55,6 +55,4 @@ class NotificationTest extends \PHPUnit_Framework_TestCase $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 ee209f9..8ddb135 100644 --- a/tests/PayPal/Test/Api/OpenIdSessionTest.php +++ b/tests/PayPal/Test/Api/OpenIdSessionTest.php @@ -44,7 +44,6 @@ class OpenIdSessionTest extends \PHPUnit_Framework_TestCase */ public function testLoginUrlForMultipleScopes() { - $clientId = "AQkquBDf1zctJOWGKWUEtKXm6qVhueUEMvXO_-MCI4DQQ4-LWvkDLIN2fGsd"; $redirectUri = 'https://devtools-paypal.com/'; $scope = array('this', 'that', 'and more'); @@ -69,7 +68,6 @@ class OpenIdSessionTest extends \PHPUnit_Framework_TestCase */ public function testLoginWithCustomConfig() { - $redirectUri = 'http://mywebsite.com'; $scope = array('this', 'that', 'and more'); @@ -84,7 +82,6 @@ class OpenIdSessionTest extends \PHPUnit_Framework_TestCase */ 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 e22f431..34cfa8c 100644 --- a/tests/PayPal/Test/Api/OpenIdTokeninfoTest.php +++ b/tests/PayPal/Test/Api/OpenIdTokeninfoTest.php @@ -53,7 +53,6 @@ class OpenIdTokeninfoTest extends \PHPUnit_Framework_TestCase */ public function t1estOperations() { - $clientId = 'AQkquBDf1zctJOWGKWUEtKXm6qVhueUEMvXO_-MCI4DQQ4-LWvkDLIN2fGsd'; $clientSecret = 'ELtVxAjhT7cJimnz5-Nsx9k2reTKSVfErNQF-CmrwJgxRtylkGTKlU4RvrX'; @@ -74,5 +73,4 @@ class OpenIdTokeninfoTest extends \PHPUnit_Framework_TestCase $accessToken = $accessToken->createFromRefreshToken($params); $this->assertNotNull($accessToken); } - } diff --git a/tests/PayPal/Test/Api/OverrideChargeModelTest.php b/tests/PayPal/Test/Api/OverrideChargeModelTest.php index 4492418..3633748 100644 --- a/tests/PayPal/Test/Api/OverrideChargeModelTest.php +++ b/tests/PayPal/Test/Api/OverrideChargeModelTest.php @@ -53,5 +53,4 @@ class OverrideChargeModelTest extends \PHPUnit_Framework_TestCase $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 f5b69db..be8d522 100644 --- a/tests/PayPal/Test/Api/ParticipantTest.php +++ b/tests/PayPal/Test/Api/ParticipantTest.php @@ -68,6 +68,4 @@ class ParticipantTest extends \PHPUnit_Framework_TestCase $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 12629d2..33cd25a 100644 --- a/tests/PayPal/Test/Api/PatchRequestTest.php +++ b/tests/PayPal/Test/Api/PatchRequestTest.php @@ -50,5 +50,4 @@ class PatchRequestTest extends \PHPUnit_Framework_TestCase { $this->assertEquals($obj->getPatches(), PatchTest::getObject()); } - } diff --git a/tests/PayPal/Test/Api/PatchTest.php b/tests/PayPal/Test/Api/PatchTest.php index 8ed800b..7f8e946 100644 --- a/tests/PayPal/Test/Api/PatchTest.php +++ b/tests/PayPal/Test/Api/PatchTest.php @@ -60,6 +60,4 @@ class PatchTest extends \PHPUnit_Framework_TestCase $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 853e56b..f951a9c 100644 --- a/tests/PayPal/Test/Api/PayeeTest.php +++ b/tests/PayPal/Test/Api/PayeeTest.php @@ -64,6 +64,4 @@ class PayeeTest extends \PHPUnit_Framework_TestCase $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 7a1546a..f8b17ed 100644 --- a/tests/PayPal/Test/Api/PayerInfoTest.php +++ b/tests/PayPal/Test/Api/PayerInfoTest.php @@ -86,6 +86,4 @@ class PayerInfoTest extends \PHPUnit_Framework_TestCase $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 e5cab69..de7e272 100644 --- a/tests/PayPal/Test/Api/PayerTest.php +++ b/tests/PayPal/Test/Api/PayerTest.php @@ -70,6 +70,4 @@ class PayerTest extends \PHPUnit_Framework_TestCase $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 44aa163..fae01ab 100644 --- a/tests/PayPal/Test/Api/PaymentCardTest.php +++ b/tests/PayPal/Test/Api/PaymentCardTest.php @@ -86,6 +86,4 @@ class PaymentCardTest extends \PHPUnit_Framework_TestCase $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 43f6a5c..be8b3eb 100644 --- a/tests/PayPal/Test/Api/PaymentCardTokenTest.php +++ b/tests/PayPal/Test/Api/PaymentCardTokenTest.php @@ -61,5 +61,4 @@ class PaymentCardTokenTest extends \PHPUnit_Framework_TestCase $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 2043b8e..05fad64 100644 --- a/tests/PayPal/Test/Api/PaymentDefinitionTest.php +++ b/tests/PayPal/Test/Api/PaymentDefinitionTest.php @@ -65,5 +65,4 @@ class PaymentDefinitionTest extends \PHPUnit_Framework_TestCase $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 42ec711..09a79e4 100644 --- a/tests/PayPal/Test/Api/PaymentDetailTest.php +++ b/tests/PayPal/Test/Api/PaymentDetailTest.php @@ -63,5 +63,4 @@ class PaymentDetailTest extends \PHPUnit_Framework_TestCase $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 fe25bd6..b182344 100644 --- a/tests/PayPal/Test/Api/PaymentExecutionTest.php +++ b/tests/PayPal/Test/Api/PaymentExecutionTest.php @@ -58,6 +58,4 @@ class PaymentExecutionTest extends \PHPUnit_Framework_TestCase $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 dade26c..ff2be38 100644 --- a/tests/PayPal/Test/Api/PaymentHistoryTest.php +++ b/tests/PayPal/Test/Api/PaymentHistoryTest.php @@ -58,6 +58,4 @@ class PaymentHistoryTest extends \PHPUnit_Framework_TestCase $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 e2bbda2..60e852a 100644 --- a/tests/PayPal/Test/Api/PaymentOptionsTest.php +++ b/tests/PayPal/Test/Api/PaymentOptionsTest.php @@ -58,6 +58,4 @@ class PaymentOptionsTest extends \PHPUnit_Framework_TestCase $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 ebc9ef5..b745900 100644 --- a/tests/PayPal/Test/Api/PaymentSummaryTest.php +++ b/tests/PayPal/Test/Api/PaymentSummaryTest.php @@ -54,6 +54,4 @@ class PaymentSummaryTest extends \PHPUnit_Framework_TestCase $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 24e9102..f5593e7 100644 --- a/tests/PayPal/Test/Api/PaymentTermTest.php +++ b/tests/PayPal/Test/Api/PaymentTermTest.php @@ -53,5 +53,4 @@ class PaymentTermTest extends \PHPUnit_Framework_TestCase $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 1f96f67..6b44c25 100644 --- a/tests/PayPal/Test/Api/PayoutBatchHeaderTest.php +++ b/tests/PayPal/Test/Api/PayoutBatchHeaderTest.php @@ -67,5 +67,4 @@ class PayoutBatchHeaderTest extends \PHPUnit_Framework_TestCase $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 5b22a8a..f8c8b2b 100644 --- a/tests/PayPal/Test/Api/PayoutBatchTest.php +++ b/tests/PayPal/Test/Api/PayoutBatchTest.php @@ -53,5 +53,4 @@ class PayoutBatchTest extends \PHPUnit_Framework_TestCase $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 46adfef..822358a 100644 --- a/tests/PayPal/Test/Api/PayoutItemDetailsTest.php +++ b/tests/PayPal/Test/Api/PayoutItemDetailsTest.php @@ -69,5 +69,4 @@ class PayoutItemDetailsTest extends \PHPUnit_Framework_TestCase $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 64617ef..2f2fe34 100644 --- a/tests/PayPal/Test/Api/PayoutSenderBatchHeaderTest.php +++ b/tests/PayPal/Test/Api/PayoutSenderBatchHeaderTest.php @@ -55,5 +55,4 @@ class PayoutSenderBatchHeaderTest extends \PHPUnit_Framework_TestCase $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 bae5453..185f8ad 100644 --- a/tests/PayPal/Test/Api/PhoneTest.php +++ b/tests/PayPal/Test/Api/PhoneTest.php @@ -58,6 +58,4 @@ class PhoneTest extends \PHPUnit_Framework_TestCase $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 aa4954c..3015ffd 100644 --- a/tests/PayPal/Test/Api/PlanListTest.php +++ b/tests/PayPal/Test/Api/PlanListTest.php @@ -57,5 +57,4 @@ class PlanListTest extends \PHPUnit_Framework_TestCase $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 50cd24d..97b7904 100644 --- a/tests/PayPal/Test/Api/PotentialPayerInfoTest.php +++ b/tests/PayPal/Test/Api/PotentialPayerInfoTest.php @@ -57,6 +57,4 @@ class PotentialPayerInfoTest extends \PHPUnit_Framework_TestCase $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 2807f49..49eb021 100644 --- a/tests/PayPal/Test/Api/PresentationTest.php +++ b/tests/PayPal/Test/Api/PresentationTest.php @@ -55,5 +55,4 @@ class PresentationTest extends \PHPUnit_Framework_TestCase $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 96b1e6a..e76023c 100644 --- a/tests/PayPal/Test/Api/PrivateLabelCardTest.php +++ b/tests/PayPal/Test/Api/PrivateLabelCardTest.php @@ -59,6 +59,4 @@ class PrivateLabelCardTest extends \PHPUnit_Framework_TestCase $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 dc779fc..c88d2f6 100644 --- a/tests/PayPal/Test/Api/ProcessorResponseTest.php +++ b/tests/PayPal/Test/Api/ProcessorResponseTest.php @@ -61,6 +61,4 @@ class ProcessorResponseTest extends \PHPUnit_Framework_TestCase $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 60176d7..0482322 100644 --- a/tests/PayPal/Test/Api/RecipientBankingInstructionTest.php +++ b/tests/PayPal/Test/Api/RecipientBankingInstructionTest.php @@ -64,6 +64,4 @@ class RecipientBankingInstructionTest extends \PHPUnit_Framework_TestCase $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 e69660a..7abf56c 100644 --- a/tests/PayPal/Test/Api/RedirectUrlsTest.php +++ b/tests/PayPal/Test/Api/RedirectUrlsTest.php @@ -76,5 +76,4 @@ class RedirectUrlsTest extends \PHPUnit_Framework_TestCase $obj = new RedirectUrls(); $obj->setCancelUrl(null); } - } diff --git a/tests/PayPal/Test/Api/RefundDetailTest.php b/tests/PayPal/Test/Api/RefundDetailTest.php index 951ab3c..d5c4711 100644 --- a/tests/PayPal/Test/Api/RefundDetailTest.php +++ b/tests/PayPal/Test/Api/RefundDetailTest.php @@ -57,6 +57,4 @@ class RefundDetailTest extends \PHPUnit_Framework_TestCase $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 077725e..3b97e7f 100644 --- a/tests/PayPal/Test/Api/RelatedResourcesTest.php +++ b/tests/PayPal/Test/Api/RelatedResourcesTest.php @@ -62,6 +62,4 @@ class RelatedResourcesTest extends \PHPUnit_Framework_TestCase $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 f743a9a..60bd56c 100644 --- a/tests/PayPal/Test/Api/SearchTest.php +++ b/tests/PayPal/Test/Api/SearchTest.php @@ -89,5 +89,4 @@ class SearchTest extends \PHPUnit_Framework_TestCase $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 7f2dabe..0247664 100644 --- a/tests/PayPal/Test/Api/ShippingAddressTest.php +++ b/tests/PayPal/Test/Api/ShippingAddressTest.php @@ -58,6 +58,4 @@ class ShippingAddressTest extends \PHPUnit_Framework_TestCase $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 f146cf8..2de4b35 100644 --- a/tests/PayPal/Test/Api/ShippingCostTest.php +++ b/tests/PayPal/Test/Api/ShippingCostTest.php @@ -53,5 +53,4 @@ class ShippingCostTest extends \PHPUnit_Framework_TestCase $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 dd92c29..c62ea32 100644 --- a/tests/PayPal/Test/Api/ShippingInfoTest.php +++ b/tests/PayPal/Test/Api/ShippingInfoTest.php @@ -57,5 +57,4 @@ class ShippingInfoTest extends \PHPUnit_Framework_TestCase $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 9029bf4..3a6b7b2 100644 --- a/tests/PayPal/Test/Api/TaxTest.php +++ b/tests/PayPal/Test/Api/TaxTest.php @@ -57,5 +57,4 @@ class TaxTest extends \PHPUnit_Framework_TestCase $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 45a529d..f132b6b 100644 --- a/tests/PayPal/Test/Api/TemplateDataTest.php +++ b/tests/PayPal/Test/Api/TemplateDataTest.php @@ -98,5 +98,4 @@ class TemplateDataTest extends \PHPUnit_Framework_TestCase $obj = new TemplateData(); $obj->setLogoUrl(null); } - } diff --git a/tests/PayPal/Test/Api/TemplateSettingsMetadataTest.php b/tests/PayPal/Test/Api/TemplateSettingsMetadataTest.php index 7376f15..f335485 100644 --- a/tests/PayPal/Test/Api/TemplateSettingsMetadataTest.php +++ b/tests/PayPal/Test/Api/TemplateSettingsMetadataTest.php @@ -52,6 +52,4 @@ class TemplateSettingsMetadataTest extends \PHPUnit_Framework_TestCase { $this->assertEquals($obj->getHidden(), true); } - - } diff --git a/tests/PayPal/Test/Api/TemplateSettingsTest.php b/tests/PayPal/Test/Api/TemplateSettingsTest.php index 1a85b20..d79eca0 100644 --- a/tests/PayPal/Test/Api/TemplateSettingsTest.php +++ b/tests/PayPal/Test/Api/TemplateSettingsTest.php @@ -54,6 +54,4 @@ class TemplateSettingsTest extends \PHPUnit_Framework_TestCase $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 475e66f..7a25a78 100644 --- a/tests/PayPal/Test/Api/TemplateTest.php +++ b/tests/PayPal/Test/Api/TemplateTest.php @@ -64,6 +64,4 @@ class TemplateTest extends \PHPUnit_Framework_TestCase $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 4df7938..0c925ab 100644 --- a/tests/PayPal/Test/Api/TermsTest.php +++ b/tests/PayPal/Test/Api/TermsTest.php @@ -61,5 +61,4 @@ class TermsTest extends \PHPUnit_Framework_TestCase $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 dd036d2..93c0989 100644 --- a/tests/PayPal/Test/Api/TransactionTest.php +++ b/tests/PayPal/Test/Api/TransactionTest.php @@ -52,6 +52,4 @@ class TransactionTest extends \PHPUnit_Framework_TestCase public function testGetters($obj) { } - - } diff --git a/tests/PayPal/Test/Api/WebhookEventListTest.php b/tests/PayPal/Test/Api/WebhookEventListTest.php index 611a4b2..99063bd 100644 --- a/tests/PayPal/Test/Api/WebhookEventListTest.php +++ b/tests/PayPal/Test/Api/WebhookEventListTest.php @@ -55,5 +55,4 @@ class WebhookEventListTest extends \PHPUnit_Framework_TestCase $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 7918ad0..001a600 100644 --- a/tests/PayPal/Test/Api/WebhookEventTest.php +++ b/tests/PayPal/Test/Api/WebhookEventTest.php @@ -196,7 +196,7 @@ class WebhookEventTest extends \PHPUnit_Framework_TestCase */ public function testValidateWebhookEmpty($mockApiContext) { - WebhookEvent::validateAndGetReceivedEvent('', $mockApiContext); + WebhookEvent::validateAndGetReceivedEvent('', $mockApiContext); } /** @@ -219,5 +219,4 @@ class WebhookEventTest extends \PHPUnit_Framework_TestCase { WebhookEvent::validateAndGetReceivedEvent('{"summary":"json"}', $mockApiContext); } - } diff --git a/tests/PayPal/Test/Api/WebhookEventTypeListTest.php b/tests/PayPal/Test/Api/WebhookEventTypeListTest.php index baa569d..e6d7e83 100644 --- a/tests/PayPal/Test/Api/WebhookEventTypeListTest.php +++ b/tests/PayPal/Test/Api/WebhookEventTypeListTest.php @@ -51,5 +51,4 @@ class WebhookEventTypeListTest extends \PHPUnit_Framework_TestCase { $this->assertEquals($obj->getEventTypes(), WebhookEventTypeTest::getObject()); } - } diff --git a/tests/PayPal/Test/Api/WebhookListTest.php b/tests/PayPal/Test/Api/WebhookListTest.php index 7bb30f6..c638a6f 100644 --- a/tests/PayPal/Test/Api/WebhookListTest.php +++ b/tests/PayPal/Test/Api/WebhookListTest.php @@ -51,5 +51,4 @@ class WebhookListTest extends \PHPUnit_Framework_TestCase { $this->assertEquals($obj->getWebhooks(), WebhookTest::getObject()); } - } diff --git a/tests/PayPal/Test/Auth/OAuthTokenCredentialTest.php b/tests/PayPal/Test/Auth/OAuthTokenCredentialTest.php index 9f367c1..9317228 100644 --- a/tests/PayPal/Test/Auth/OAuthTokenCredentialTest.php +++ b/tests/PayPal/Test/Auth/OAuthTokenCredentialTest.php @@ -47,7 +47,7 @@ class OAuthTokenCredentialTest extends \PHPUnit_Framework_TestCase '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 @@ class OAuthTokenCredentialTest extends \PHPUnit_Framework_TestCase $response = $auth->getRefreshToken($config, 'auth_value'); $this->assertNotNull($response); $this->assertEquals('refresh_token_value', $response); - } public function testUpdateAccessTokenUnitMock() @@ -109,7 +108,6 @@ class OAuthTokenCredentialTest extends \PHPUnit_Framework_TestCase $response = $auth->updateAccessToken($config, 'refresh_token'); $this->assertNotNull($response); $this->assertEquals('accessToken', $response); - } /** @@ -137,7 +135,5 @@ class OAuthTokenCredentialTest extends \PHPUnit_Framework_TestCase $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 82a5e14..329fff7 100644 --- a/tests/PayPal/Test/Cache/AuthorizationCacheTest.php +++ b/tests/PayPal/Test/Cache/AuthorizationCacheTest.php @@ -79,7 +79,6 @@ class AuthorizationCacheTest extends \PHPUnit_Framework_TestCase $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 @@ class AuthorizationCacheTest extends \PHPUnit_Framework_TestCase unlink(AuthorizationCacheTest::CACHE_FILE); } - } diff --git a/tests/PayPal/Test/Common/ArrayUtilTest.php b/tests/PayPal/Test/Common/ArrayUtilTest.php index 0c353b0..bdd30fe 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 55dc955..32449df 100644 --- a/tests/PayPal/Test/Common/ChildClass.php +++ b/tests/PayPal/Test/Common/ChildClass.php @@ -3,5 +3,4 @@ namespace PayPal\Test\Common; class ChildClass extends SimpleClass { - } diff --git a/tests/PayPal/Test/Common/FormatConverterTest.php b/tests/PayPal/Test/Common/FormatConverterTest.php index cf81796..c6201af 100644 --- a/tests/PayPal/Test/Common/FormatConverterTest.php +++ b/tests/PayPal/Test/Common/FormatConverterTest.php @@ -72,7 +72,6 @@ class FormatConverterTest extends \PHPUnit_Framework_TestCase { $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 da9063e..230c80e 100644 --- a/tests/PayPal/Test/Common/ModelTest.php +++ b/tests/PayPal/Test/Common/ModelTest.php @@ -23,7 +23,6 @@ class ModelTest extends \PHPUnit_Framework_TestCase $newO = new SimpleClass(); $newO->fromJson($json); $this->assertEquals($o, $newO); - } public function testConstructorJSON() @@ -68,7 +67,6 @@ class ModelTest extends \PHPUnit_Framework_TestCase $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 d59bd5b..c67b346 100644 --- a/tests/PayPal/Test/Common/PayPalModelTest.php +++ b/tests/PayPal/Test/Common/PayPalModelTest.php @@ -47,7 +47,6 @@ class SimpleModelTestClass extends PayPalModel { return $this->field2; } - } @@ -95,8 +94,6 @@ class ContainerModelTestClass extends PayPalModel { return $this->nested1; } - - } class ListModelTestClass extends PayPalModel @@ -142,8 +139,6 @@ class ListModelTestClass extends PayPalModel { return $this->list2; } - - } /** @@ -158,7 +153,6 @@ class PayPalModelTest extends PHPUnit_Framework_TestCase */ protected function setUp() { - } /** @@ -183,7 +177,6 @@ class PayPalModelTest extends PHPUnit_Framework_TestCase $oCopy = new SimpleModelTestClass(); $oCopy->fromJson($o->toJSON()); $this->assertEquals($o, $oCopy); - } /** @@ -204,7 +197,6 @@ class PayPalModelTest extends PHPUnit_Framework_TestCase $parentCopy = new ContainerModelTestClass(); $parentCopy->fromJson($parent->toJSON()); $this->assertEquals($parent, $parentCopy); - } /** @@ -221,7 +213,6 @@ class PayPalModelTest extends PHPUnit_Framework_TestCase $oCopy = new SimpleModelTestClass(); $oCopy->fromJson($o->toJSON()); $this->assertEquals($o, $oCopy); - } @@ -244,7 +235,6 @@ class PayPalModelTest extends PHPUnit_Framework_TestCase $parentCopy = new ContainerModelTestClass(); $parentCopy->fromJson($parent->toJSON()); $this->assertEquals($parent, $parentCopy); - } @@ -289,7 +279,7 @@ class PayPalModelTest extends PHPUnit_Framework_TestCase { $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 44b0eeb..c3318b3 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 @@ class PayPalHttpConfigTest extends \PHPUnit_Framework_TestCase $o->setHttpProxy('invalid string'); } } - -?> diff --git a/tests/PayPal/Test/Core/PayPalLoggingManagerTest.php b/tests/PayPal/Test/Core/PayPalLoggingManagerTest.php index e5a83db..f7720e3 100644 --- a/tests/PayPal/Test/Core/PayPalLoggingManagerTest.php +++ b/tests/PayPal/Test/Core/PayPalLoggingManagerTest.php @@ -35,7 +35,6 @@ class PayPalLoggingManagerTest extends \PHPUnit_Framework_TestCase public function testError() { $this->object->error('Test Error Message'); - } /** @@ -62,5 +61,3 @@ class PayPalLoggingManagerTest extends \PHPUnit_Framework_TestCase $this->object->fine('Test fine Message'); } } - -?> diff --git a/tests/PayPal/Test/Exception/PayPalConfigurationExceptionTest.php b/tests/PayPal/Test/Exception/PayPalConfigurationExceptionTest.php index c6067af..ed57fc0 100644 --- a/tests/PayPal/Test/Exception/PayPalConfigurationExceptionTest.php +++ b/tests/PayPal/Test/Exception/PayPalConfigurationExceptionTest.php @@ -34,5 +34,3 @@ class PayPalConfigurationExceptionTest extends \PHPUnit_Framework_TestCase $this->assertEquals('Test PayPalConfigurationException', $this->object->getMessage()); } } - -?> diff --git a/tests/PayPal/Test/Exception/PayPalConnectionExceptionTest.php b/tests/PayPal/Test/Exception/PayPalConnectionExceptionTest.php index f64470a..0b06359 100644 --- a/tests/PayPal/Test/Exception/PayPalConnectionExceptionTest.php +++ b/tests/PayPal/Test/Exception/PayPalConnectionExceptionTest.php @@ -46,5 +46,3 @@ class PayPalConnectionExceptionTest extends \PHPUnit_Framework_TestCase $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 93d51e1..8837760 100644 --- a/tests/PayPal/Test/Exception/PayPalInvalidCredentialExceptionTest.php +++ b/tests/PayPal/Test/Exception/PayPalInvalidCredentialExceptionTest.php @@ -38,5 +38,3 @@ class PayPalInvalidCredentialExceptionTest extends \PHPUnit_Framework_TestCase $this->assertContains('Error on line', $msg); } } - -?> diff --git a/tests/PayPal/Test/Exception/PayPalMissingCredentialExceptionTest.php b/tests/PayPal/Test/Exception/PayPalMissingCredentialExceptionTest.php index 6892f20..1a2af09 100644 --- a/tests/PayPal/Test/Exception/PayPalMissingCredentialExceptionTest.php +++ b/tests/PayPal/Test/Exception/PayPalMissingCredentialExceptionTest.php @@ -38,5 +38,3 @@ class PayPalMissingCredentialExceptionTest extends \PHPUnit_Framework_TestCase $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 8b006db..c3a2f53 100644 --- a/tests/PayPal/Test/Functional/Api/BillingAgreementsFunctionalTest.php +++ b/tests/PayPal/Test/Functional/Api/BillingAgreementsFunctionalTest.php @@ -228,5 +228,4 @@ class BillingAgreementsFunctionalTest extends \PHPUnit_Framework_TestCase $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 5c34167..3c23486 100644 --- a/tests/PayPal/Test/Functional/Api/BillingPlansFunctionalTest.php +++ b/tests/PayPal/Test/Functional/Api/BillingPlansFunctionalTest.php @@ -128,12 +128,10 @@ class BillingPlansFunctionalTest extends \PHPUnit_Framework_TestCase } 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 3a83a6f..b3dcf9a 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 @@ class InvoiceFunctionalTest extends \PHPUnit_Framework_TestCase $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 1c0d640..4372c1c 100644 --- a/tests/PayPal/Test/Functional/Api/PayoutsFunctionalTest.php +++ b/tests/PayPal/Test/Functional/Api/PayoutsFunctionalTest.php @@ -120,5 +120,4 @@ class PayoutsFunctionalTest extends \PHPUnit_Framework_TestCase $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 a99cb6f..f0db4b8 100644 --- a/tests/PayPal/Test/Functional/Api/WebProfileFunctionalTest.php +++ b/tests/PayPal/Test/Functional/Api/WebProfileFunctionalTest.php @@ -96,7 +96,6 @@ class WebProfileFunctionalTest extends \PHPUnit_Framework_TestCase $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 @@ class WebProfileFunctionalTest extends \PHPUnit_Framework_TestCase $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 6d916d2..cf64ed0 100644 --- a/tests/PayPal/Test/Functional/Api/WebhookFunctionalTest.php +++ b/tests/PayPal/Test/Functional/Api/WebhookFunctionalTest.php @@ -61,7 +61,7 @@ class WebhookFunctionalTest extends \PHPUnit_Framework_TestCase $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 @@ class WebhookFunctionalTest extends \PHPUnit_Framework_TestCase 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 b36d625..d4afc2f 100644 --- a/tests/PayPal/Test/Handler/OauthHandlerTest.php +++ b/tests/PayPal/Test/Handler/OauthHandlerTest.php @@ -38,7 +38,6 @@ class OauthHandlerTest extends \PHPUnit_Framework_TestCase 'clientSecret' ) ); - } public function modeProvider() @@ -67,6 +66,4 @@ class OauthHandlerTest extends \PHPUnit_Framework_TestCase $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 20b4547..32c711c 100644 --- a/tests/PayPal/Test/Rest/ApiContextTest.php +++ b/tests/PayPal/Test/Rest/ApiContextTest.php @@ -33,5 +33,4 @@ class ApiContextTest extends PHPUnit_Framework_TestCase $this->assertNotNull($newRequestId); $this->assertNotEquals($newRequestId, $requestId); } - } diff --git a/tests/PayPal/Test/Validation/ArgumentValidatorTest.php b/tests/PayPal/Test/Validation/ArgumentValidatorTest.php index 02d373f..99214ab 100644 --- a/tests/PayPal/Test/Validation/ArgumentValidatorTest.php +++ b/tests/PayPal/Test/Validation/ArgumentValidatorTest.php @@ -47,5 +47,4 @@ class ArgumentValidatorTest extends \PHPUnit_Framework_TestCase { $this->assertTrue(ArgumentValidator::validate($input, "Name")); } - } diff --git a/tests/PayPal/Test/Validation/NumericValidatorTest.php b/tests/PayPal/Test/Validation/NumericValidatorTest.php index 360ea04..b9aa249 100644 --- a/tests/PayPal/Test/Validation/NumericValidatorTest.php +++ b/tests/PayPal/Test/Validation/NumericValidatorTest.php @@ -56,7 +56,6 @@ class NumericValidatorTest extends \PHPUnit_Framework_TestCase */ 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 d1268fd..194b9dc 100644 --- a/tests/PayPal/Test/Validation/UrlValidatorTest.php +++ b/tests/PayPal/Test/Validation/UrlValidatorTest.php @@ -49,7 +49,6 @@ class UrlValidatorTest extends \PHPUnit_Framework_TestCase */ public function testValidateException($input) { - UrlValidator::validate($input, "Test Value"); + UrlValidator::validate($input, "Test Value"); } - }