From cefecede817036c7761870a17fb2fe92ad2d1b5b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C4=B0rfan=20Evrens?= Date: Thu, 25 Jun 2015 23:08:11 +0300 Subject: [PATCH 1/4] Tiny improvements. --- lib/PayPal/Api/Address.php | 2 -- lib/PayPal/Api/Agreement.php | 3 +-- lib/PayPal/Api/Authorization.php | 3 +-- lib/PayPal/Api/Capture.php | 3 +-- lib/PayPal/Api/CreditCardHistory.php | 6 ++---- lib/PayPal/Api/FuturePayment.php | 1 - lib/PayPal/Api/InvoiceAddress.php | 2 -- lib/PayPal/Api/OpenIdAddress.php | 11 ++++++++++- lib/PayPal/Api/OpenIdError.php | 6 ++++++ lib/PayPal/Api/OpenIdSession.php | 10 ++++++---- lib/PayPal/Api/OpenIdTokeninfo.php | 10 +++++++++- lib/PayPal/Api/OpenIdUserinfo.php | 24 +++++++++++++++++++++++ lib/PayPal/Api/Order.php | 4 +--- lib/PayPal/Api/Payee.php | 1 - lib/PayPal/Api/Payment.php | 4 +--- lib/PayPal/Api/Plan.php | 3 +-- lib/PayPal/Api/Sale.php | 3 ++- lib/PayPal/Api/ShippingAddress.php | 2 -- lib/PayPal/Api/TransactionBase.php | 3 --- lib/PayPal/Api/Transactions.php | 1 - lib/PayPal/Api/WebProfile.php | 3 +-- lib/PayPal/Api/Webhook.php | 3 +-- lib/PayPal/Api/WebhookEventType.php | 3 +-- lib/PayPal/Auth/OAuthTokenCredential.php | 3 +++ lib/PayPal/Common/PayPalResourceModel.php | 3 +-- lib/PayPal/Core/PayPalHttpConnection.php | 1 + 26 files changed, 73 insertions(+), 45 deletions(-) diff --git a/lib/PayPal/Api/Address.php b/lib/PayPal/Api/Address.php index 175db20..a8f72fd 100644 --- a/lib/PayPal/Api/Address.php +++ b/lib/PayPal/Api/Address.php @@ -2,8 +2,6 @@ namespace PayPal\Api; -use PayPal\Common\PayPalModel; - /** * Class Address * diff --git a/lib/PayPal/Api/Agreement.php b/lib/PayPal/Api/Agreement.php index b0899b8..810dde2 100644 --- a/lib/PayPal/Api/Agreement.php +++ b/lib/PayPal/Api/Agreement.php @@ -4,10 +4,9 @@ namespace PayPal\Api; use PayPal\Common\PayPalResourceModel; use PayPal\Core\PayPalConstants; -use PayPal\Validation\ArgumentValidator; -use PayPal\Api\AgreementTransactions; use PayPal\Rest\ApiContext; use PayPal\Transport\PayPalRestCall; +use PayPal\Validation\ArgumentValidator; /** * Class Agreement diff --git a/lib/PayPal/Api/Authorization.php b/lib/PayPal/Api/Authorization.php index f424790..68a72fe 100644 --- a/lib/PayPal/Api/Authorization.php +++ b/lib/PayPal/Api/Authorization.php @@ -3,10 +3,9 @@ namespace PayPal\Api; use PayPal\Common\PayPalResourceModel; -use PayPal\Validation\ArgumentValidator; -use PayPal\Api\Capture; use PayPal\Rest\ApiContext; use PayPal\Transport\PayPalRestCall; +use PayPal\Validation\ArgumentValidator; /** * Class Authorization diff --git a/lib/PayPal/Api/Capture.php b/lib/PayPal/Api/Capture.php index 288d67f..7a573c1 100644 --- a/lib/PayPal/Api/Capture.php +++ b/lib/PayPal/Api/Capture.php @@ -3,10 +3,9 @@ namespace PayPal\Api; use PayPal\Common\PayPalResourceModel; -use PayPal\Validation\ArgumentValidator; -use PayPal\Api\Refund; use PayPal\Rest\ApiContext; use PayPal\Transport\PayPalRestCall; +use PayPal\Validation\ArgumentValidator; /** * Class Capture diff --git a/lib/PayPal/Api/CreditCardHistory.php b/lib/PayPal/Api/CreditCardHistory.php index 636429c..2c0874e 100644 --- a/lib/PayPal/Api/CreditCardHistory.php +++ b/lib/PayPal/Api/CreditCardHistory.php @@ -3,7 +3,6 @@ namespace PayPal\Api; use PayPal\Common\PayPalModel; -use PayPal\Rest\ApiContext; /** * Class CreditCardHistory @@ -20,10 +19,9 @@ class CreditCardHistory extends PayPalModel { /** * A list of credit card resources - * * - * @param \PayPal\Api\CreditCard $credit-cards - * + * + * @param $credit_cards * @return $this */ public function setCreditCards($credit_cards) diff --git a/lib/PayPal/Api/FuturePayment.php b/lib/PayPal/Api/FuturePayment.php index 2bdc991..7e49a37 100644 --- a/lib/PayPal/Api/FuturePayment.php +++ b/lib/PayPal/Api/FuturePayment.php @@ -2,7 +2,6 @@ namespace PayPal\Api; -use PayPal\Common\PayPalModel; use PayPal\Rest\ApiContext; use PayPal\Transport\PayPalRestCall; diff --git a/lib/PayPal/Api/InvoiceAddress.php b/lib/PayPal/Api/InvoiceAddress.php index b8cd850..7e8786a 100644 --- a/lib/PayPal/Api/InvoiceAddress.php +++ b/lib/PayPal/Api/InvoiceAddress.php @@ -2,8 +2,6 @@ namespace PayPal\Api; -use PayPal\Common\PayPalModel; - /** * Class InvoiceAddress * diff --git a/lib/PayPal/Api/OpenIdAddress.php b/lib/PayPal/Api/OpenIdAddress.php index 4bfe2dd..306abf6 100644 --- a/lib/PayPal/Api/OpenIdAddress.php +++ b/lib/PayPal/Api/OpenIdAddress.php @@ -5,11 +5,20 @@ namespace PayPal\Api; use PayPal\Common\PayPalModel; /** + * Class OpenIdAddress + * * End-User's preferred address. + * + * @package PayPal\Api + * + * @property string street_address + * @property string locality + * @property string region + * @property string postal_code + * @property string country */ class OpenIdAddress extends PayPalModel { - /** * Full street address component, which may include house number, street name. * diff --git a/lib/PayPal/Api/OpenIdError.php b/lib/PayPal/Api/OpenIdError.php index 18b488b..4b9b956 100644 --- a/lib/PayPal/Api/OpenIdError.php +++ b/lib/PayPal/Api/OpenIdError.php @@ -4,7 +4,13 @@ namespace PayPal\Api; use PayPal\Common\PayPalModel; /** + * Class OpenIdError + * * Error resource + * + * @property string error + * @property string error_description + * @property string error_uri */ class OpenIdError extends PayPalModel { diff --git a/lib/PayPal/Api/OpenIdSession.php b/lib/PayPal/Api/OpenIdSession.php index cd6c397..088026d 100644 --- a/lib/PayPal/Api/OpenIdSession.php +++ b/lib/PayPal/Api/OpenIdSession.php @@ -12,13 +12,15 @@ class OpenIdSession * Returns the PayPal URL to which the user must be redirected to * start the authentication / authorization process. * - * @param string $redirectUri Uri on merchant website to where + * @param string $redirectUri Uri on merchant website to where * the user must be redirected to post paypal login - * @param array $scope The access privilges that you are requesting for + * @param array $scope The access privilges that you are requesting for * from the user. Pass empty array for all scopes. - * @param string $clientId client id from developer portal + * @param string $clientId client id from developer portal * See https://developer.paypal.com/webapps/developer/docs/integration/direct/log-in-with-paypal/detailed/#attributes for more - * @param ApiContext $apiContext Optional API Context + * @param null $nonce + * @param null $state + * @param ApiContext $apiContext Optional API Context * @return string Authorization URL */ public static function getAuthorizationUrl($redirectUri, $scope, $clientId, $nonce = null, $state = null, $apiContext = null) diff --git a/lib/PayPal/Api/OpenIdTokeninfo.php b/lib/PayPal/Api/OpenIdTokeninfo.php index 39a660a..7d9cc97 100644 --- a/lib/PayPal/Api/OpenIdTokeninfo.php +++ b/lib/PayPal/Api/OpenIdTokeninfo.php @@ -1,13 +1,21 @@ httpConfig->getMethod()) { case 'POST': curl_setopt($ch, CURLOPT_POST, true); + break; case 'PUT': case 'PATCH': case 'DELETE': From def426fd2329786ba89dc5856e5c2c5fbcef3d44 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C4=B0rfan=20Evrens?= Date: Fri, 26 Jun 2015 00:02:26 +0300 Subject: [PATCH 2/4] Fixed some lines. --- lib/PayPal/Api/CreditCardHistory.php | 4 ++-- lib/PayPal/Core/PayPalHttpConnection.php | 1 - 2 files changed, 2 insertions(+), 3 deletions(-) diff --git a/lib/PayPal/Api/CreditCardHistory.php b/lib/PayPal/Api/CreditCardHistory.php index 2c0874e..f8d0a94 100644 --- a/lib/PayPal/Api/CreditCardHistory.php +++ b/lib/PayPal/Api/CreditCardHistory.php @@ -11,7 +11,7 @@ use PayPal\Common\PayPalModel; * * @package PayPal\Api * - * @property \PayPal\Api\CreditCard credit_cards + * @property \PayPal\Api\CreditCard[] credit_cards * @property int count * @property string next_id */ @@ -21,7 +21,7 @@ class CreditCardHistory extends PayPalModel * A list of credit card resources * * - * @param $credit_cards + * @param \PayPal\Api\CreditCard[] $credit_cards * @return $this */ public function setCreditCards($credit_cards) diff --git a/lib/PayPal/Core/PayPalHttpConnection.php b/lib/PayPal/Core/PayPalHttpConnection.php index 251908a..ffc05d2 100644 --- a/lib/PayPal/Core/PayPalHttpConnection.php +++ b/lib/PayPal/Core/PayPalHttpConnection.php @@ -93,7 +93,6 @@ class PayPalHttpConnection switch ($this->httpConfig->getMethod()) { case 'POST': curl_setopt($ch, CURLOPT_POST, true); - break; case 'PUT': case 'PATCH': case 'DELETE': From 70fe1941ad168c0611d96ccefbd0539e7e5f0381 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C4=B0rfan=20Evrens?= Date: Fri, 26 Jun 2015 09:47:54 +0300 Subject: [PATCH 3/4] Fixed switch case logical problem. --- lib/PayPal/Core/PayPalHttpConnection.php | 2 ++ 1 file changed, 2 insertions(+) diff --git a/lib/PayPal/Core/PayPalHttpConnection.php b/lib/PayPal/Core/PayPalHttpConnection.php index ffc05d2..0cbe5aa 100644 --- a/lib/PayPal/Core/PayPalHttpConnection.php +++ b/lib/PayPal/Core/PayPalHttpConnection.php @@ -93,6 +93,8 @@ class PayPalHttpConnection switch ($this->httpConfig->getMethod()) { case 'POST': curl_setopt($ch, CURLOPT_POST, true); + curl_setopt($ch, CURLOPT_POSTFIELDS, $data); + break; case 'PUT': case 'PATCH': case 'DELETE': From aabcf9c2aacbbc8fc7d63320f19e5de9c639d596 Mon Sep 17 00:00:00 2001 From: Jay Patel Date: Tue, 30 Jun 2015 12:08:56 -0500 Subject: [PATCH 4/4] Formatting Fixes - Fixed Imports - Fixed Formatting - Added Missing Documentation --- lib/PayPal/Api/BankAccount.php | 2 +- lib/PayPal/Api/Cost.php | 2 +- lib/PayPal/Api/CreditCard.php | 2 +- lib/PayPal/Api/Invoice.php | 2 +- lib/PayPal/Api/PaymentInstruction.php | 2 +- lib/PayPal/Api/Payout.php | 2 +- lib/PayPal/Api/PayoutItem.php | 2 +- lib/PayPal/Api/Refund.php | 2 +- lib/PayPal/Api/WebhookEvent.php | 2 +- lib/PayPal/Auth/OAuthTokenCredential.php | 2 +- lib/PayPal/Transport/PayPalRestCall.php | 2 +- .../CreateBillingAgreementWithCreditCard.php | 8 ++++---- .../billing/CreateBillingAgreementWithPayPal.php | 2 +- sample/billing/CreatePlan.php | 8 ++++---- sample/billing/UpdateBillingAgreement.php | 2 +- sample/billing/UpdatePlan.php | 5 +++-- sample/billing/UpdatePlanPaymentDefinitions.php | 4 ++-- sample/bootstrap.php | 2 +- sample/common.php | 8 -------- sample/invoice/CancelInvoice.php | 2 +- sample/invoice/CreateInvoice.php | 16 ++++++++-------- sample/invoice/DeleteInvoice.php | 1 - sample/invoice/RetrieveQRCode.php | 1 - sample/lipp/GetUserInfo.php | 2 +- sample/notifications/SearchWebhookEvents.php | 1 - sample/payments/AuthorizationCapture.php | 2 +- sample/payments/AuthorizePayment.php | 4 ++-- sample/payments/CreateFuturePayment.php | 3 ++- sample/payments/CreatePayment.php | 4 ++-- sample/payments/CreatePaymentUsingSavedCard.php | 6 +++--- sample/payments/GetAuthorization.php | 1 - sample/payments/GetCapture.php | 2 -- sample/payments/OrderAuthorize.php | 1 - sample/payments/OrderCapture.php | 2 +- sample/payments/OrderDoVoid.php | 3 --- sample/payments/Reauthorization.php | 2 +- sample/payments/RefundCapture.php | 2 -- sample/sale/GetSale.php | 2 +- tests/PayPal/Test/Api/AddressTest.php | 1 - .../Test/Api/AgreementStateDescriptorTest.php | 1 - tests/PayPal/Test/Api/AgreementTest.php | 5 ----- .../PayPal/Test/Api/AgreementTransactionTest.php | 1 - .../Test/Api/AgreementTransactionsTest.php | 1 - tests/PayPal/Test/Api/AmountTest.php | 3 --- tests/PayPal/Test/Api/AuthorizationTest.php | 6 +----- tests/PayPal/Test/Api/BankAccountTest.php | 4 ---- tests/PayPal/Test/Api/BankAccountsListTest.php | 1 - tests/PayPal/Test/Api/BankTokenTest.php | 1 - tests/PayPal/Test/Api/BillingInfoTest.php | 1 - tests/PayPal/Test/Api/CancelNotificationTest.php | 1 - tests/PayPal/Test/Api/CaptureTest.php | 6 +----- .../PayPal/Test/Api/CarrierAccountTokenTest.php | 1 - tests/PayPal/Test/Api/CartBaseTest.php | 1 - tests/PayPal/Test/Api/ChargeModelTest.php | 1 - tests/PayPal/Test/Api/CostTest.php | 3 --- .../Test/Api/CreateProfileResponseTest.php | 1 - tests/PayPal/Test/Api/CreditCardHistoryTest.php | 5 +---- tests/PayPal/Test/Api/CreditCardListTest.php | 1 - tests/PayPal/Test/Api/CreditCardTest.php | 6 +----- tests/PayPal/Test/Api/CreditCardTokenTest.php | 1 - tests/PayPal/Test/Api/CreditTest.php | 1 - tests/PayPal/Test/Api/CurrencyConversionTest.php | 1 - tests/PayPal/Test/Api/CurrencyTest.php | 3 --- tests/PayPal/Test/Api/CustomAmountTest.php | 1 - tests/PayPal/Test/Api/DetailsTest.php | 3 --- tests/PayPal/Test/Api/ErrorDetailsTest.php | 1 - tests/PayPal/Test/Api/ErrorTest.php | 1 - .../PayPal/Test/Api/ExtendedBankAccountTest.php | 1 - tests/PayPal/Test/Api/FlowConfigTest.php | 1 - tests/PayPal/Test/Api/FmfDetailsTest.php | 1 - tests/PayPal/Test/Api/FundingDetailTest.php | 1 - tests/PayPal/Test/Api/FundingInstrumentTest.php | 1 - tests/PayPal/Test/Api/FundingOptionTest.php | 1 - tests/PayPal/Test/Api/FundingSourceTest.php | 1 - 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 | 1 - tests/PayPal/Test/Api/InstallmentOptionTest.php | 1 - tests/PayPal/Test/Api/InvoiceAddressTest.php | 1 - tests/PayPal/Test/Api/InvoiceItemTest.php | 1 - .../Test/Api/InvoiceSearchResponseTest.php | 1 - tests/PayPal/Test/Api/InvoiceTest.php | 5 ----- tests/PayPal/Test/Api/ItemListTest.php | 1 - tests/PayPal/Test/Api/ItemTest.php | 3 --- tests/PayPal/Test/Api/LinksTest.php | 1 - tests/PayPal/Test/Api/MeasurementTest.php | 1 - tests/PayPal/Test/Api/MerchantInfoTest.php | 1 - .../PayPal/Test/Api/MerchantPreferencesTest.php | 1 - tests/PayPal/Test/Api/MetadataTest.php | 1 - tests/PayPal/Test/Api/NameValuePairTest.php | 1 - tests/PayPal/Test/Api/NotificationTest.php | 1 - tests/PayPal/Test/Api/OrderTest.php | 6 +----- .../PayPal/Test/Api/OverrideChargeModelTest.php | 1 - tests/PayPal/Test/Api/PatchRequestTest.php | 1 - tests/PayPal/Test/Api/PatchTest.php | 1 - tests/PayPal/Test/Api/PayeeTest.php | 1 - tests/PayPal/Test/Api/PayerInfoTest.php | 1 - tests/PayPal/Test/Api/PayerTest.php | 1 - tests/PayPal/Test/Api/PaymentCardTest.php | 1 - 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 | 1 - tests/PayPal/Test/Api/PaymentHistoryTest.php | 1 - tests/PayPal/Test/Api/PaymentInstructionTest.php | 5 +---- tests/PayPal/Test/Api/PaymentOptionsTest.php | 1 - tests/PayPal/Test/Api/PaymentTermTest.php | 1 - tests/PayPal/Test/Api/PaymentTest.php | 6 +----- tests/PayPal/Test/Api/PayoutBatchHeaderTest.php | 1 - tests/PayPal/Test/Api/PayoutBatchTest.php | 1 - tests/PayPal/Test/Api/PayoutItemDetailsTest.php | 1 - tests/PayPal/Test/Api/PayoutItemTest.php | 5 +---- .../Test/Api/PayoutSenderBatchHeaderTest.php | 1 - tests/PayPal/Test/Api/PhoneTest.php | 1 - tests/PayPal/Test/Api/PlanListTest.php | 1 - tests/PayPal/Test/Api/PlanTest.php | 5 ----- tests/PayPal/Test/Api/PresentationTest.php | 1 - .../Test/Api/RecipientBankingInstructionTest.php | 1 - tests/PayPal/Test/Api/RedirectUrlsTest.php | 1 - tests/PayPal/Test/Api/RefundDetailTest.php | 1 - tests/PayPal/Test/Api/RefundTest.php | 5 +---- tests/PayPal/Test/Api/RelatedResourcesTest.php | 1 - tests/PayPal/Test/Api/SaleTest.php | 6 +----- tests/PayPal/Test/Api/SearchTest.php | 1 - tests/PayPal/Test/Api/ShippingAddressTest.php | 1 - 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/TermsTest.php | 1 - tests/PayPal/Test/Api/TransactionTest.php | 1 - tests/PayPal/Test/Api/WebProfileTest.php | 5 ----- tests/PayPal/Test/Api/WebhookEventListTest.php | 1 - tests/PayPal/Test/Api/WebhookEventTest.php | 8 ++------ .../PayPal/Test/Api/WebhookEventTypeListTest.php | 1 - tests/PayPal/Test/Api/WebhookEventTypeTest.php | 5 ----- tests/PayPal/Test/Api/WebhookListTest.php | 1 - tests/PayPal/Test/Api/WebhookTest.php | 5 ----- .../Test/Auth/OAuthTokenCredentialTest.php | 3 +-- tests/PayPal/Test/Common/ChildClass.php | 2 -- tests/PayPal/Test/Common/FormatConverterTest.php | 2 +- .../Api/BillingPlansFunctionalTest.php | 8 -------- .../Functional/Api/PaymentsFunctionalTest.php | 10 ---------- .../Functional/Api/PayoutsFunctionalTest.php | 7 ------- .../Functional/Api/WebProfileFunctionalTest.php | 8 ++------ .../Functional/Api/WebhookFunctionalTest.php | 12 ------------ tests/PayPal/Test/Functional/Setup.php | 1 - tests/PayPal/Test/Handler/OauthHandlerTest.php | 5 ++--- .../Test/Validation/NumericValidatorTest.php | 1 - 150 files changed, 68 insertions(+), 300 deletions(-) diff --git a/lib/PayPal/Api/BankAccount.php b/lib/PayPal/Api/BankAccount.php index 99750f1..34c0de0 100644 --- a/lib/PayPal/Api/BankAccount.php +++ b/lib/PayPal/Api/BankAccount.php @@ -3,9 +3,9 @@ namespace PayPal\Api; use PayPal\Common\PayPalResourceModel; -use PayPal\Validation\ArgumentValidator; use PayPal\Rest\ApiContext; use PayPal\Transport\PayPalRestCall; +use PayPal\Validation\ArgumentValidator; /** * Class BankAccount diff --git a/lib/PayPal/Api/Cost.php b/lib/PayPal/Api/Cost.php index b1e11a1..b8fa4ec 100644 --- a/lib/PayPal/Api/Cost.php +++ b/lib/PayPal/Api/Cost.php @@ -3,8 +3,8 @@ namespace PayPal\Api; use PayPal\Common\PayPalModel; -use PayPal\Validation\NumericValidator; use PayPal\Converter\FormatConverter; +use PayPal\Validation\NumericValidator; /** * Class Cost diff --git a/lib/PayPal/Api/CreditCard.php b/lib/PayPal/Api/CreditCard.php index e528272..082d785 100644 --- a/lib/PayPal/Api/CreditCard.php +++ b/lib/PayPal/Api/CreditCard.php @@ -3,9 +3,9 @@ namespace PayPal\Api; use PayPal\Common\PayPalResourceModel; +use PayPal\Rest\ApiContext; use PayPal\Transport\PayPalRestCall; use PayPal\Validation\ArgumentValidator; -use PayPal\Rest\ApiContext; /** * Class CreditCard diff --git a/lib/PayPal/Api/Invoice.php b/lib/PayPal/Api/Invoice.php index 85da974..df82c6e 100644 --- a/lib/PayPal/Api/Invoice.php +++ b/lib/PayPal/Api/Invoice.php @@ -3,9 +3,9 @@ namespace PayPal\Api; use PayPal\Common\PayPalResourceModel; -use PayPal\Validation\ArgumentValidator; use PayPal\Rest\ApiContext; use PayPal\Transport\PayPalRestCall; +use PayPal\Validation\ArgumentValidator; use PayPal\Validation\UrlValidator; /** diff --git a/lib/PayPal/Api/PaymentInstruction.php b/lib/PayPal/Api/PaymentInstruction.php index 582487e..1222c31 100644 --- a/lib/PayPal/Api/PaymentInstruction.php +++ b/lib/PayPal/Api/PaymentInstruction.php @@ -3,9 +3,9 @@ namespace PayPal\Api; use PayPal\Common\PayPalResourceModel; -use PayPal\Validation\ArgumentValidator; use PayPal\Rest\ApiContext; use PayPal\Transport\PayPalRestCall; +use PayPal\Validation\ArgumentValidator; /** * Class PaymentInstruction diff --git a/lib/PayPal/Api/Payout.php b/lib/PayPal/Api/Payout.php index 44715da..b97b515 100644 --- a/lib/PayPal/Api/Payout.php +++ b/lib/PayPal/Api/Payout.php @@ -3,9 +3,9 @@ namespace PayPal\Api; use PayPal\Common\PayPalResourceModel; +use PayPal\Rest\ApiContext; use PayPal\Transport\PayPalRestCall; use PayPal\Validation\ArgumentValidator; -use PayPal\Rest\ApiContext; /** * Class Payout diff --git a/lib/PayPal/Api/PayoutItem.php b/lib/PayPal/Api/PayoutItem.php index 96723b8..76f2d23 100644 --- a/lib/PayPal/Api/PayoutItem.php +++ b/lib/PayPal/Api/PayoutItem.php @@ -3,9 +3,9 @@ namespace PayPal\Api; use PayPal\Common\PayPalResourceModel; -use PayPal\Validation\ArgumentValidator; use PayPal\Rest\ApiContext; use PayPal\Transport\PayPalRestCall; +use PayPal\Validation\ArgumentValidator; /** * Class PayoutItem diff --git a/lib/PayPal/Api/Refund.php b/lib/PayPal/Api/Refund.php index 9e62076..ee26a15 100644 --- a/lib/PayPal/Api/Refund.php +++ b/lib/PayPal/Api/Refund.php @@ -3,9 +3,9 @@ namespace PayPal\Api; use PayPal\Common\PayPalResourceModel; -use PayPal\Validation\ArgumentValidator; use PayPal\Rest\ApiContext; use PayPal\Transport\PayPalRestCall; +use PayPal\Validation\ArgumentValidator; /** * Class Refund diff --git a/lib/PayPal/Api/WebhookEvent.php b/lib/PayPal/Api/WebhookEvent.php index 5c786f9..bc9426f 100644 --- a/lib/PayPal/Api/WebhookEvent.php +++ b/lib/PayPal/Api/WebhookEvent.php @@ -4,9 +4,9 @@ namespace PayPal\Api; use PayPal\Common\PayPalResourceModel; use PayPal\Exception\PayPalConnectionException; -use PayPal\Validation\ArgumentValidator; use PayPal\Rest\ApiContext; use PayPal\Transport\PayPalRestCall; +use PayPal\Validation\ArgumentValidator; use PayPal\Validation\JsonValidator; /** diff --git a/lib/PayPal/Auth/OAuthTokenCredential.php b/lib/PayPal/Auth/OAuthTokenCredential.php index 750ab7d..f1d9e60 100644 --- a/lib/PayPal/Auth/OAuthTokenCredential.php +++ b/lib/PayPal/Auth/OAuthTokenCredential.php @@ -205,7 +205,7 @@ class OAuthTokenCredential extends PayPalResourceModel /** * Updates Access Token based on given input * - * @param $config + * @param array $config * @param string|null $refreshToken * @return string */ diff --git a/lib/PayPal/Transport/PayPalRestCall.php b/lib/PayPal/Transport/PayPalRestCall.php index bf69f39..e80f5ec 100644 --- a/lib/PayPal/Transport/PayPalRestCall.php +++ b/lib/PayPal/Transport/PayPalRestCall.php @@ -1,9 +1,9 @@ '2014-12-06T11:00:00Z', diff --git a/sample/payments/AuthorizationCapture.php b/sample/payments/AuthorizationCapture.php index 606755a..493e4c5 100644 --- a/sample/payments/AuthorizationCapture.php +++ b/sample/payments/AuthorizationCapture.php @@ -8,8 +8,8 @@ /** @var Authorization $authorization */ $authorization = require 'GetAuthorization.php'; use PayPal\Api\Amount; -use PayPal\Api\Capture; use PayPal\Api\Authorization; +use PayPal\Api\Capture; // ### Capture Payment diff --git a/sample/payments/AuthorizePayment.php b/sample/payments/AuthorizePayment.php index 5183624..c32b581 100644 --- a/sample/payments/AuthorizePayment.php +++ b/sample/payments/AuthorizePayment.php @@ -7,12 +7,12 @@ require __DIR__ . '/../bootstrap.php'; use PayPal\Api\Address; +use PayPal\Api\Amount; use PayPal\Api\CreditCard; use PayPal\Api\FundingInstrument; use PayPal\Api\Payer; -use PayPal\Api\Amount; -use PayPal\Api\Transaction; use PayPal\Api\Payment; +use PayPal\Api\Transaction; // The biggest difference between creating a payment, and authorizing a payment is to set the intent of payment // to correct setting. In this case, it would be 'authorize' diff --git a/sample/payments/CreateFuturePayment.php b/sample/payments/CreateFuturePayment.php index 9a6e579..0c1d31c 100644 --- a/sample/payments/CreateFuturePayment.php +++ b/sample/payments/CreateFuturePayment.php @@ -7,10 +7,11 @@ require __DIR__ . '/../bootstrap.php'; use PayPal\Api\Amount; -use PayPal\Api\Payer; use PayPal\Api\FuturePayment; +use PayPal\Api\Payer; use PayPal\Api\RedirectUrls; use PayPal\Api\Transaction; + session_start(); // ### Payer diff --git a/sample/payments/CreatePayment.php b/sample/payments/CreatePayment.php index d983834..c0317c7 100644 --- a/sample/payments/CreatePayment.php +++ b/sample/payments/CreatePayment.php @@ -10,13 +10,13 @@ require __DIR__ . '/../bootstrap.php'; use PayPal\Api\Amount; +use PayPal\Api\CreditCard; use PayPal\Api\Details; +use PayPal\Api\FundingInstrument; use PayPal\Api\Item; use PayPal\Api\ItemList; -use PayPal\Api\CreditCard; use PayPal\Api\Payer; use PayPal\Api\Payment; -use PayPal\Api\FundingInstrument; use PayPal\Api\Transaction; // ### CreditCard diff --git a/sample/payments/CreatePaymentUsingSavedCard.php b/sample/payments/CreatePaymentUsingSavedCard.php index e92d385..96f8512 100644 --- a/sample/payments/CreatePaymentUsingSavedCard.php +++ b/sample/payments/CreatePaymentUsingSavedCard.php @@ -8,15 +8,15 @@ /** @var CreditCard $card */ $card = require __DIR__ . '/../vault/CreateCreditCard.php'; use PayPal\Api\Amount; +use PayPal\Api\CreditCard; +use PayPal\Api\CreditCardToken; use PayPal\Api\Details; +use PayPal\Api\FundingInstrument; use PayPal\Api\Item; use PayPal\Api\ItemList; -use PayPal\Api\CreditCardToken; use PayPal\Api\Payer; use PayPal\Api\Payment; -use PayPal\Api\FundingInstrument; use PayPal\Api\Transaction; -use PayPal\Api\CreditCard; // ### Credit card token // Saved credit card id from a previous call to diff --git a/sample/payments/GetAuthorization.php b/sample/payments/GetAuthorization.php index 426d906..6e423af 100644 --- a/sample/payments/GetAuthorization.php +++ b/sample/payments/GetAuthorization.php @@ -8,7 +8,6 @@ $authorization = require 'AuthorizePayment.php'; $authorizationId = $authorization->getId(); use PayPal\Api\Authorization; -use PayPal\Api\Payment; // ### GetAuthorization // You can retrieve info about an Authorization diff --git a/sample/payments/GetCapture.php b/sample/payments/GetCapture.php index fc64b4b..19cea3a 100644 --- a/sample/payments/GetCapture.php +++ b/sample/payments/GetCapture.php @@ -8,8 +8,6 @@ $request = require 'AuthorizationCapture.php'; use PayPal\Api\Capture; -use PayPal\Api\Amount; -use PayPal\Api\Authorization; // ### Retrieve Capture details // You can look up a capture by invoking the Capture::get method diff --git a/sample/payments/OrderAuthorize.php b/sample/payments/OrderAuthorize.php index 05deb2e..441dfa9 100644 --- a/sample/payments/OrderAuthorize.php +++ b/sample/payments/OrderAuthorize.php @@ -6,7 +6,6 @@ /** @var \PayPal\Api\Payment $payment */ $payment = require __DIR__ . '/ExecutePayment.php'; -use PayPal\Api\Order; use PayPal\Api\Amount; use PayPal\Api\Authorization; diff --git a/sample/payments/OrderCapture.php b/sample/payments/OrderCapture.php index d4a3218..d704081 100644 --- a/sample/payments/OrderCapture.php +++ b/sample/payments/OrderCapture.php @@ -6,8 +6,8 @@ /** @var \PayPal\Api\Payment $payment */ $payment = require __DIR__ . '/ExecutePayment.php'; -use PayPal\Api\Capture; use PayPal\Api\Amount; +use PayPal\Api\Capture; // ### Approval Status // Determine if the user approved the payment or not diff --git a/sample/payments/OrderDoVoid.php b/sample/payments/OrderDoVoid.php index f619418..7c0e287 100644 --- a/sample/payments/OrderDoVoid.php +++ b/sample/payments/OrderDoVoid.php @@ -7,9 +7,6 @@ /** @var \PayPal\Api\Payment $payment */ $payment = require __DIR__ . '/ExecutePayment.php'; -use PayPal\Api\Capture; -use PayPal\Api\Amount; - // ### Approval Status // Determine if the user approved the payment or not if (isset($_GET['success']) && $_GET['success'] == 'true') { diff --git a/sample/payments/Reauthorization.php b/sample/payments/Reauthorization.php index ab7c55c..dbebdfa 100644 --- a/sample/payments/Reauthorization.php +++ b/sample/payments/Reauthorization.php @@ -5,8 +5,8 @@ // API used: v1/payments/authorization/{authorization_id}/reauthorize /** @var Authorization $authorization */ $authorization = require 'AuthorizePayment.php'; -use PayPal\Api\Authorization; use PayPal\Api\Amount; +use PayPal\Api\Authorization; // ### Reauthorization // Reauthorization is available only for PayPal account payments diff --git a/sample/payments/RefundCapture.php b/sample/payments/RefundCapture.php index d368c97..1ebbdaf 100644 --- a/sample/payments/RefundCapture.php +++ b/sample/payments/RefundCapture.php @@ -6,10 +6,8 @@ /** @var Capture $capture */ $capture = require 'AuthorizationCapture.php'; -use PayPal\Api\Authorization; use PayPal\Api\Capture; use PayPal\Api\Refund; -use PayPal\Api\Amount; // ### Refund // Create a refund object indicating diff --git a/sample/sale/GetSale.php b/sample/sale/GetSale.php index 8efb72f..8b91501 100644 --- a/sample/sale/GetSale.php +++ b/sample/sale/GetSale.php @@ -8,8 +8,8 @@ /** @var Payment $payment */ $payment = require __DIR__ . '/../payments/CreatePayment.php'; -use PayPal\Api\Sale; use PayPal\Api\Payment; +use PayPal\Api\Sale; // ### Get Sale From Created Payment // You can retrieve the sale Id from Related Resources for each transactions. diff --git a/tests/PayPal/Test/Api/AddressTest.php b/tests/PayPal/Test/Api/AddressTest.php index 4f675a9..c4ae25d 100644 --- a/tests/PayPal/Test/Api/AddressTest.php +++ b/tests/PayPal/Test/Api/AddressTest.php @@ -2,7 +2,6 @@ namespace PayPal\Test\Api; -use PayPal\Common\PayPalModel; use PayPal\Api\Address; /** diff --git a/tests/PayPal/Test/Api/AgreementStateDescriptorTest.php b/tests/PayPal/Test/Api/AgreementStateDescriptorTest.php index 68508cb..3099606 100644 --- a/tests/PayPal/Test/Api/AgreementStateDescriptorTest.php +++ b/tests/PayPal/Test/Api/AgreementStateDescriptorTest.php @@ -2,7 +2,6 @@ namespace PayPal\Test\Api; -use PayPal\Common\PayPalModel; use PayPal\Api\AgreementStateDescriptor; /** diff --git a/tests/PayPal/Test/Api/AgreementTest.php b/tests/PayPal/Test/Api/AgreementTest.php index 0b5facb..2da2e72 100644 --- a/tests/PayPal/Test/Api/AgreementTest.php +++ b/tests/PayPal/Test/Api/AgreementTest.php @@ -2,11 +2,6 @@ namespace PayPal\Test\Api; -use PayPal\Common\PayPalResourceModel; -use PayPal\Validation\ArgumentValidator; -use PayPal\Api\AgreementTransactions; -use PayPal\Rest\ApiContext; -use PayPal\Transport\PayPalRestCall; use PayPal\Api\Agreement; /** diff --git a/tests/PayPal/Test/Api/AgreementTransactionTest.php b/tests/PayPal/Test/Api/AgreementTransactionTest.php index 64eeba7..47f02ca 100644 --- a/tests/PayPal/Test/Api/AgreementTransactionTest.php +++ b/tests/PayPal/Test/Api/AgreementTransactionTest.php @@ -2,7 +2,6 @@ namespace PayPal\Test\Api; -use PayPal\Common\PayPalModel; use PayPal\Api\AgreementTransaction; /** diff --git a/tests/PayPal/Test/Api/AgreementTransactionsTest.php b/tests/PayPal/Test/Api/AgreementTransactionsTest.php index df96665..5d513d2 100644 --- a/tests/PayPal/Test/Api/AgreementTransactionsTest.php +++ b/tests/PayPal/Test/Api/AgreementTransactionsTest.php @@ -2,7 +2,6 @@ namespace PayPal\Test\Api; -use PayPal\Common\PayPalModel; use PayPal\Api\AgreementTransactions; /** diff --git a/tests/PayPal/Test/Api/AmountTest.php b/tests/PayPal/Test/Api/AmountTest.php index c8015a7..5efd7d5 100644 --- a/tests/PayPal/Test/Api/AmountTest.php +++ b/tests/PayPal/Test/Api/AmountTest.php @@ -2,9 +2,6 @@ namespace PayPal\Test\Api; -use PayPal\Common\PayPalModel; -use PayPal\Converter\FormatConverter; -use PayPal\Validation\NumericValidator; use PayPal\Api\Amount; /** diff --git a/tests/PayPal/Test/Api/AuthorizationTest.php b/tests/PayPal/Test/Api/AuthorizationTest.php index cee2e8e..ef95265 100644 --- a/tests/PayPal/Test/Api/AuthorizationTest.php +++ b/tests/PayPal/Test/Api/AuthorizationTest.php @@ -2,12 +2,8 @@ namespace PayPal\Test\Api; -use PayPal\Common\PayPalResourceModel; -use PayPal\Validation\ArgumentValidator; -use PayPal\Api\Capture; -use PayPal\Rest\ApiContext; -use PayPal\Transport\PPRestCall; use PayPal\Api\Authorization; +use PayPal\Transport\PPRestCall; /** * Class Authorization diff --git a/tests/PayPal/Test/Api/BankAccountTest.php b/tests/PayPal/Test/Api/BankAccountTest.php index 1607d99..0ca75a1 100644 --- a/tests/PayPal/Test/Api/BankAccountTest.php +++ b/tests/PayPal/Test/Api/BankAccountTest.php @@ -2,10 +2,6 @@ namespace PayPal\Test\Api; -use PayPal\Common\PayPalResourceModel; -use PayPal\Validation\ArgumentValidator; -use PayPal\Rest\ApiContext; -use PayPal\Transport\PayPalRestCall; use PayPal\Api\BankAccount; /** diff --git a/tests/PayPal/Test/Api/BankAccountsListTest.php b/tests/PayPal/Test/Api/BankAccountsListTest.php index 51d80ea..d834f3f 100644 --- a/tests/PayPal/Test/Api/BankAccountsListTest.php +++ b/tests/PayPal/Test/Api/BankAccountsListTest.php @@ -2,7 +2,6 @@ namespace PayPal\Test\Api; -use PayPal\Common\PayPalModel; use PayPal\Api\BankAccountsList; /** diff --git a/tests/PayPal/Test/Api/BankTokenTest.php b/tests/PayPal/Test/Api/BankTokenTest.php index aa3de98..ff1dcb4 100644 --- a/tests/PayPal/Test/Api/BankTokenTest.php +++ b/tests/PayPal/Test/Api/BankTokenTest.php @@ -2,7 +2,6 @@ namespace PayPal\Test\Api; -use PayPal\Common\PayPalModel; use PayPal\Api\BankToken; /** diff --git a/tests/PayPal/Test/Api/BillingInfoTest.php b/tests/PayPal/Test/Api/BillingInfoTest.php index 2d7de85..540b937 100644 --- a/tests/PayPal/Test/Api/BillingInfoTest.php +++ b/tests/PayPal/Test/Api/BillingInfoTest.php @@ -2,7 +2,6 @@ namespace PayPal\Test\Api; -use PayPal\Common\PayPalModel; use PayPal\Api\BillingInfo; /** diff --git a/tests/PayPal/Test/Api/CancelNotificationTest.php b/tests/PayPal/Test/Api/CancelNotificationTest.php index d3c0376..6454cc2 100644 --- a/tests/PayPal/Test/Api/CancelNotificationTest.php +++ b/tests/PayPal/Test/Api/CancelNotificationTest.php @@ -2,7 +2,6 @@ namespace PayPal\Test\Api; -use PayPal\Common\PayPalModel; use PayPal\Api\CancelNotification; /** diff --git a/tests/PayPal/Test/Api/CaptureTest.php b/tests/PayPal/Test/Api/CaptureTest.php index 2b2c74d..97aee4f 100644 --- a/tests/PayPal/Test/Api/CaptureTest.php +++ b/tests/PayPal/Test/Api/CaptureTest.php @@ -2,12 +2,8 @@ namespace PayPal\Test\Api; -use PayPal\Common\PayPalResourceModel; -use PayPal\Validation\ArgumentValidator; -use PayPal\Api\Refund; -use PayPal\Rest\ApiContext; -use PayPal\Transport\PPRestCall; use PayPal\Api\Capture; +use PayPal\Transport\PPRestCall; /** * Class Capture diff --git a/tests/PayPal/Test/Api/CarrierAccountTokenTest.php b/tests/PayPal/Test/Api/CarrierAccountTokenTest.php index ec5298b..efc966d 100644 --- a/tests/PayPal/Test/Api/CarrierAccountTokenTest.php +++ b/tests/PayPal/Test/Api/CarrierAccountTokenTest.php @@ -2,7 +2,6 @@ namespace PayPal\Test\Api; -use PayPal\Common\PayPalModel; use PayPal\Api\CarrierAccountToken; /** diff --git a/tests/PayPal/Test/Api/CartBaseTest.php b/tests/PayPal/Test/Api/CartBaseTest.php index 2105ea6..5d8161c 100644 --- a/tests/PayPal/Test/Api/CartBaseTest.php +++ b/tests/PayPal/Test/Api/CartBaseTest.php @@ -2,7 +2,6 @@ namespace PayPal\Test\Api; -use PayPal\Common\PayPalModel; use PayPal\Api\CartBase; /** diff --git a/tests/PayPal/Test/Api/ChargeModelTest.php b/tests/PayPal/Test/Api/ChargeModelTest.php index ed78c22..46f4d2a 100644 --- a/tests/PayPal/Test/Api/ChargeModelTest.php +++ b/tests/PayPal/Test/Api/ChargeModelTest.php @@ -2,7 +2,6 @@ namespace PayPal\Test\Api; -use PayPal\Common\PayPalModel; use PayPal\Api\ChargeModel; /** diff --git a/tests/PayPal/Test/Api/CostTest.php b/tests/PayPal/Test/Api/CostTest.php index 89f38df..61e3861 100644 --- a/tests/PayPal/Test/Api/CostTest.php +++ b/tests/PayPal/Test/Api/CostTest.php @@ -2,9 +2,6 @@ namespace PayPal\Test\Api; -use PayPal\Common\PayPalModel; -use PayPal\Converter\FormatConverter; -use PayPal\Validation\NumericValidator; use PayPal\Api\Cost; /** diff --git a/tests/PayPal/Test/Api/CreateProfileResponseTest.php b/tests/PayPal/Test/Api/CreateProfileResponseTest.php index 05f3f5e..ec2da48 100644 --- a/tests/PayPal/Test/Api/CreateProfileResponseTest.php +++ b/tests/PayPal/Test/Api/CreateProfileResponseTest.php @@ -2,7 +2,6 @@ namespace PayPal\Test\Api; -use PayPal\Common\PayPalModel; use PayPal\Api\CreateProfileResponse; /** diff --git a/tests/PayPal/Test/Api/CreditCardHistoryTest.php b/tests/PayPal/Test/Api/CreditCardHistoryTest.php index d6b8409..14dd6a9 100644 --- a/tests/PayPal/Test/Api/CreditCardHistoryTest.php +++ b/tests/PayPal/Test/Api/CreditCardHistoryTest.php @@ -1,11 +1,8 @@