From cffa2463b1ca2833fa78475ecf82440928e30934 Mon Sep 17 00:00:00 2001 From: Jay Patel Date: Thu, 14 Jul 2016 13:08:18 -0500 Subject: [PATCH] [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); }