From ab334918b0cf2baf3a866464773a145bb9983e18 Mon Sep 17 00:00:00 2001 From: Jay Patel Date: Thu, 23 Apr 2015 23:34:24 -0500 Subject: [PATCH] Sample ResultPrinter Not to be Used - Comment everywhere the ResultPrinter is used to not use outside sample --- .../CreateBillingAgreementWithCreditCard.php | 4 +- .../CreateBillingAgreementWithPayPal.php | 4 +- sample/billing/CreatePlan.php | 6 +- sample/billing/DeletePlan.php | 6 +- sample/billing/ExecuteAgreement.php | 9 +- sample/billing/GetBillingAgreement.php | 4 +- sample/billing/GetPlan.php | 6 +- sample/billing/ListPlans.php | 6 +- sample/billing/ReactivateBillingAgreement.php | 2 + sample/billing/SearchBillingTransactions.php | 6 +- sample/billing/SuspendBillingAgreement.php | 6 +- sample/billing/UpdateBillingAgreement.php | 6 +- sample/billing/UpdatePlan.php | 6 +- .../billing/UpdatePlanPaymentDefinitions.php | 6 +- sample/doc/assets/behavior.js | 150 +----------------- .../CreateBillingAgreementWithCreditCard.html | 7 +- .../CreateBillingAgreementWithPayPal.html | 7 +- sample/doc/billing/CreatePlan.html | 7 +- sample/doc/billing/DeletePlan.html | 8 +- sample/doc/billing/ExecuteAgreement.html | 17 +- sample/doc/billing/GetBillingAgreement.html | 7 +- sample/doc/billing/GetPlan.html | 8 +- sample/doc/billing/ListPlans.html | 7 +- .../billing/ReactivateBillingAgreement.html | 7 +- .../billing/SearchBillingTransactions.html | 7 +- .../doc/billing/SuspendBillingAgreement.html | 7 +- .../doc/billing/UpdateBillingAgreement.html | 7 +- sample/doc/billing/UpdatePlan.html | 7 +- .../billing/UpdatePlanPaymentDefinitions.html | 7 +- sample/doc/invoice/CancelInvoice.html | 7 +- sample/doc/invoice/CreateInvoice.html | 7 +- sample/doc/invoice/DeleteInvoice.html | 7 +- sample/doc/invoice/GetInvoice.html | 7 +- sample/doc/invoice/ListInvoice.html | 6 +- sample/doc/invoice/RecordPayment.html | 14 +- sample/doc/invoice/RecordRefund.html | 14 +- sample/doc/invoice/RemindInvoice.html | 14 +- sample/doc/invoice/RetrieveQRCode.html | 7 +- sample/doc/invoice/SearchInvoices.html | 6 +- sample/doc/invoice/SendInvoice.html | 14 +- sample/doc/invoice/UpdateInvoice.html | 14 +- .../GenerateAccessTokenFromRefreshToken.html | 6 +- sample/doc/lipp/GetUserInfo.html | 6 +- sample/doc/lipp/ObtainUserConsent.html | 3 +- sample/doc/lipp/UserConsentRedirect.html | 7 +- sample/doc/notifications/CreateWebhook.html | 16 +- .../doc/notifications/DeleteAllWebhooks.html | 7 +- sample/doc/notifications/DeleteWebhook.html | 7 +- sample/doc/notifications/GetWebhook.html | 7 +- .../ListSubscribedWebhookEventTypes.html | 7 +- sample/doc/notifications/ListWebhooks.html | 7 +- .../notifications/SearchWebhookEvents.html | 7 +- sample/doc/notifications/UpdateWebhook.html | 7 +- .../notifications/WebhookEventTypesList.html | 7 +- .../payment-experience/CreateWebProfile.html | 7 +- .../payment-experience/DeleteWebProfile.html | 7 +- .../doc/payment-experience/GetWebProfile.html | 8 +- .../payment-experience/ListWebProfiles.html | 7 +- .../PartiallyUpdateWebProfile.html | 7 +- .../payment-experience/UpdateWebProfile.html | 7 +- sample/doc/payments/AuthorizationCapture.html | 7 +- sample/doc/payments/AuthorizePayment.html | 7 +- .../payments/AuthorizePaymentUsingPayPal.html | 8 +- sample/doc/payments/CreateFuturePayment.html | 7 +- sample/doc/payments/CreatePayment.html | 7 +- .../payments/CreatePaymentUsingPayPal.html | 7 +- .../payments/CreatePaymentUsingSavedCard.html | 8 +- sample/doc/payments/ExecutePayment.html | 17 +- sample/doc/payments/GetAuthorization.html | 7 +- sample/doc/payments/GetCapture.html | 7 +- sample/doc/payments/GetPayment.html | 8 +- sample/doc/payments/ListPayments.html | 7 +- sample/doc/payments/OrderAuthorize.html | 9 +- sample/doc/payments/OrderCapture.html | 9 +- .../payments/OrderCreateForAuthorization.html | 8 +- .../doc/payments/OrderCreateForCapture.html | 8 +- sample/doc/payments/OrderCreateForVoid.html | 7 +- .../doc/payments/OrderCreateUsingPayPal.html | 8 +- sample/doc/payments/OrderDoVoid.html | 9 +- sample/doc/payments/OrderGet.html | 9 +- sample/doc/payments/Reauthorization.html | 7 +- sample/doc/payments/RefundCapture.html | 7 +- sample/doc/payments/UpdatePayment.html | 14 +- sample/doc/payments/VoidAuthorization.html | 7 +- sample/doc/payouts/CancelPayoutItem.html | 9 +- sample/doc/payouts/CreateBatchPayout.html | 7 +- sample/doc/payouts/CreateSinglePayout.html | 7 +- sample/doc/payouts/GetPayoutBatchStatus.html | 7 +- sample/doc/payouts/GetPayoutItemStatus.html | 7 +- sample/doc/sale/GetSale.html | 8 +- sample/doc/sale/RefundSale.html | 7 +- sample/doc/vault/CreateBankAccount.html | 7 +- sample/doc/vault/CreateCreditCard.html | 7 +- sample/doc/vault/DeleteBankAccount.html | 7 +- sample/doc/vault/DeleteCreditCard.html | 7 +- sample/doc/vault/GetBankAccount.html | 7 +- sample/doc/vault/GetCreditCard.html | 7 +- sample/doc/vault/UpdateCreditCard.html | 7 +- sample/invoice/CancelInvoice.php | 6 +- sample/invoice/CreateInvoice.php | 6 +- sample/invoice/DeleteInvoice.php | 6 +- sample/invoice/GetInvoice.php | 6 +- sample/invoice/ListInvoice.php | 6 +- sample/invoice/RecordPayment.php | 12 +- sample/invoice/RecordRefund.php | 12 +- sample/invoice/RemindInvoice.php | 12 +- sample/invoice/RetrieveQRCode.php | 6 +- sample/invoice/SearchInvoices.php | 6 +- sample/invoice/SendInvoice.php | 12 +- sample/invoice/UpdateInvoice.php | 12 +- .../GenerateAccessTokenFromRefreshToken.php | 6 +- sample/lipp/GetUserInfo.php | 6 +- sample/lipp/ObtainUserConsent.php | 3 +- sample/lipp/UserConsentRedirect.php | 6 +- sample/notifications/CreateWebhook.php | 9 +- sample/notifications/DeleteAllWebhooks.php | 6 +- sample/notifications/DeleteWebhook.php | 6 +- sample/notifications/GetWebhook.php | 6 +- .../ListSubscribedWebhookEventTypes.php | 6 +- sample/notifications/ListWebhooks.php | 6 +- sample/notifications/SearchWebhookEvents.php | 6 +- sample/notifications/UpdateWebhook.php | 6 +- .../notifications/WebhookEventTypesList.php | 6 +- .../payment-experience/CreateWebProfile.php | 6 +- .../payment-experience/DeleteWebProfile.php | 6 +- sample/payment-experience/GetWebProfile.php | 6 +- sample/payment-experience/ListWebProfiles.php | 6 +- .../PartiallyUpdateWebProfile.php | 6 +- .../payment-experience/UpdateWebProfile.php | 6 +- sample/payments/AuthorizationCapture.php | 6 +- sample/payments/AuthorizePayment.php | 6 +- .../payments/AuthorizePaymentUsingPayPal.php | 6 +- sample/payments/CreateFuturePayment.php | 6 +- sample/payments/CreatePayment.php | 6 +- sample/payments/CreatePaymentUsingPayPal.php | 6 +- .../payments/CreatePaymentUsingSavedCard.php | 6 +- sample/payments/ExecutePayment.php | 9 +- sample/payments/GetAuthorization.php | 6 +- sample/payments/GetCapture.php | 6 +- sample/payments/GetPayment.php | 6 +- sample/payments/ListPayments.php | 6 +- sample/payments/OrderAuthorize.php | 5 +- sample/payments/OrderCapture.php | 5 +- .../payments/OrderCreateForAuthorization.php | 6 +- sample/payments/OrderCreateForCapture.php | 6 +- sample/payments/OrderCreateForVoid.php | 6 +- sample/payments/OrderCreateUsingPayPal.php | 6 +- sample/payments/OrderDoVoid.php | 7 +- sample/payments/OrderGet.php | 5 +- sample/payments/Reauthorization.php | 4 +- sample/payments/RefundCapture.php | 6 +- sample/payments/UpdatePayment.php | 12 +- sample/payments/VoidAuthorization.php | 6 +- sample/payouts/CancelPayoutItem.php | 7 +- sample/payouts/CreateBatchPayout.php | 6 +- sample/payouts/CreateSinglePayout.php | 6 +- sample/payouts/GetPayoutBatchStatus.php | 6 +- sample/payouts/GetPayoutItemStatus.php | 6 +- sample/sale/GetSale.php | 6 +- sample/sale/RefundSale.php | 6 +- sample/vault/CreateBankAccount.php | 6 +- sample/vault/CreateCreditCard.php | 6 +- sample/vault/DeleteBankAccount.php | 6 +- sample/vault/DeleteCreditCard.php | 6 +- sample/vault/GetBankAccount.php | 6 +- sample/vault/GetCreditCard.php | 6 +- sample/vault/UpdateCreditCard.php | 6 +- 167 files changed, 592 insertions(+), 749 deletions(-) diff --git a/sample/billing/CreateBillingAgreementWithCreditCard.php b/sample/billing/CreateBillingAgreementWithCreditCard.php index b4146cd..022a50b 100644 --- a/sample/billing/CreateBillingAgreementWithCreditCard.php +++ b/sample/billing/CreateBillingAgreementWithCreditCard.php @@ -101,10 +101,12 @@ try { $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); exit(1); } -ResultPrinter::printResult("Created Billing Agreement.", "Agreement", $agreement->getId(), $request, $agreement); + // NOTE: PLEASE DO NOT USE RESULTPRINTER CLASS IN YOUR ORIGINAL CODE. FOR SAMPLE ONLY + ResultPrinter::printResult("Created Billing Agreement.", "Agreement", $agreement->getId(), $request, $agreement); return $agreement; diff --git a/sample/billing/CreateBillingAgreementWithPayPal.php b/sample/billing/CreateBillingAgreementWithPayPal.php index 3770f55..046f302 100644 --- a/sample/billing/CreateBillingAgreementWithPayPal.php +++ b/sample/billing/CreateBillingAgreementWithPayPal.php @@ -76,10 +76,12 @@ try { $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); exit(1); } -ResultPrinter::printResult("Created Billing Agreement. Please visit the URL to Approve.", "Agreement", "$approvalUrl", $request, $agreement); +// NOTE: PLEASE DO NOT USE RESULTPRINTER CLASS IN YOUR ORIGINAL CODE. FOR SAMPLE ONLY + ResultPrinter::printResult("Created Billing Agreement. Please visit the URL to Approve.", "Agreement", "$approvalUrl", $request, $agreement); return $agreement; diff --git a/sample/billing/CreatePlan.php b/sample/billing/CreatePlan.php index 60f4fbb..03e9105 100644 --- a/sample/billing/CreatePlan.php +++ b/sample/billing/CreatePlan.php @@ -65,10 +65,12 @@ $request = clone $plan; try { $output = $plan->create($apiContext); } catch (Exception $ex) { - ResultPrinter::printError("Created Plan", "Plan", null, $request, $ex); + // NOTE: PLEASE DO NOT USE RESULTPRINTER CLASS IN YOUR ORIGINAL CODE. FOR SAMPLE ONLY + ResultPrinter::printError("Created Plan", "Plan", null, $request, $ex); exit(1); } -ResultPrinter::printResult("Created Plan", "Plan", $output->getId(), $request, $output); +// NOTE: PLEASE DO NOT USE RESULTPRINTER CLASS IN YOUR ORIGINAL CODE. FOR SAMPLE ONLY + ResultPrinter::printResult("Created Plan", "Plan", $output->getId(), $request, $output); return $output; diff --git a/sample/billing/DeletePlan.php b/sample/billing/DeletePlan.php index 9a150f5..c86e3b3 100644 --- a/sample/billing/DeletePlan.php +++ b/sample/billing/DeletePlan.php @@ -15,10 +15,12 @@ use PayPal\Api\Plan; try { $result = $createdPlan->delete($apiContext); } catch (Exception $ex) { - ResultPrinter::printError("Deleted a Plan", "Plan", $createdPlan->getId(), null, $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); exit(1); } -ResultPrinter::printResult("Deleted a Plan", "Plan", $createdPlan->getId(), null, null); +// NOTE: PLEASE DO NOT USE RESULTPRINTER CLASS IN YOUR ORIGINAL CODE. FOR SAMPLE ONLY + ResultPrinter::printResult("Deleted a Plan", "Plan", $createdPlan->getId(), null, null); return $createdPlan; diff --git a/sample/billing/ExecuteAgreement.php b/sample/billing/ExecuteAgreement.php index e02a688..35e17ea 100644 --- a/sample/billing/ExecuteAgreement.php +++ b/sample/billing/ExecuteAgreement.php @@ -16,10 +16,12 @@ if (isset($_GET['success']) && $_GET['success'] == 'true') { // Execute the agreement by passing in the token $agreement->execute($token, $apiContext); } catch (Exception $ex) { - ResultPrinter::printError("Executed an Agreement", "Agreement", $agreement->getId(), $_GET['token'], $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); exit(1); } + // NOTE: PLEASE DO NOT USE RESULTPRINTER CLASS IN YOUR ORIGINAL CODE. FOR SAMPLE ONLY ResultPrinter::printResult("Executed an Agreement", "Agreement", $agreement->getId(), $_GET['token'], $agreement); // ## Get Agreement @@ -27,12 +29,15 @@ if (isset($_GET['success']) && $_GET['success'] == 'true') { try { $agreement = \PayPal\Api\Agreement::get($agreement->getId(), $apiContext); } catch (Exception $ex) { - ResultPrinter::printError("Get Agreement", "Agreement", null, null, $ex); + // NOTE: PLEASE DO NOT USE RESULTPRINTER CLASS IN YOUR ORIGINAL CODE. FOR SAMPLE ONLY + 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 f62ef15..c1d347d 100644 --- a/sample/billing/GetBillingAgreement.php +++ b/sample/billing/GetBillingAgreement.php @@ -15,10 +15,12 @@ use PayPal\Api\Agreement; try { $agreement = Agreement::get($createdAgreement->getId(), $apiContext); } catch (Exception $ex) { - ResultPrinter::printError("Retrieved an Agreement", "Agreement", $agreement->getId(), $createdAgreement->getId(), $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); exit(1); } +// NOTE: PLEASE DO NOT USE RESULTPRINTER CLASS IN YOUR ORIGINAL CODE. FOR SAMPLE ONLY ResultPrinter::printResult("Retrieved an Agreement", "Agreement", $agreement->getId(), $createdAgreement->getId(), $agreement); return $agreement; diff --git a/sample/billing/GetPlan.php b/sample/billing/GetPlan.php index 3395461..054e48e 100644 --- a/sample/billing/GetPlan.php +++ b/sample/billing/GetPlan.php @@ -15,10 +15,12 @@ use PayPal\Api\Plan; try { $plan = Plan::get($createdPlan->getId(), $apiContext); } catch (Exception $ex) { - ResultPrinter::printError("Retrieved a Plan", "Plan", $plan->getId(), null, $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); exit(1); } -ResultPrinter::printResult("Retrieved a Plan", "Plan", $plan->getId(), null, $plan); +// NOTE: PLEASE DO NOT USE RESULTPRINTER CLASS IN YOUR ORIGINAL CODE. FOR SAMPLE ONLY + ResultPrinter::printResult("Retrieved a Plan", "Plan", $plan->getId(), null, $plan); return $plan; diff --git a/sample/billing/ListPlans.php b/sample/billing/ListPlans.php index 83d8c75..f56746d 100644 --- a/sample/billing/ListPlans.php +++ b/sample/billing/ListPlans.php @@ -20,10 +20,12 @@ try { $params = array('page_size' => '2'); $planList = Plan::all($params, $apiContext); } catch (Exception $ex) { - ResultPrinter::printError("List of Plans", "Plan", null, $params, $ex); + // NOTE: PLEASE DO NOT USE RESULTPRINTER CLASS IN YOUR ORIGINAL CODE. FOR SAMPLE ONLY + ResultPrinter::printError("List of Plans", "Plan", null, $params, $ex); exit(1); } -ResultPrinter::printResult("List of Plans", "Plan", null, $params, $planList); +// NOTE: PLEASE DO NOT USE RESULTPRINTER CLASS IN YOUR ORIGINAL CODE. FOR SAMPLE ONLY + ResultPrinter::printResult("List of Plans", "Plan", null, $params, $planList); return $planList; diff --git a/sample/billing/ReactivateBillingAgreement.php b/sample/billing/ReactivateBillingAgreement.php index a5c511d..b82e1ef 100644 --- a/sample/billing/ReactivateBillingAgreement.php +++ b/sample/billing/ReactivateBillingAgreement.php @@ -25,10 +25,12 @@ try { $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); exit(1); } +// NOTE: PLEASE DO NOT USE RESULTPRINTER CLASS IN YOUR ORIGINAL CODE. FOR SAMPLE ONLY ResultPrinter::printResult("Reactivate the Agreement", "Agreement", $agreement->getId(), $suspendedAgreement, $agreement); return $agreement; diff --git a/sample/billing/SearchBillingTransactions.php b/sample/billing/SearchBillingTransactions.php index 85c7d19..5713b52 100644 --- a/sample/billing/SearchBillingTransactions.php +++ b/sample/billing/SearchBillingTransactions.php @@ -21,10 +21,12 @@ $params = array('start_date' => date('Y-m-d', strtotime('-15 years')), 'end_date try { $result = Agreement::searchTransactions($agreementId, $params, $apiContext); } catch (Exception $ex) { - ResultPrinter::printError("Search for Transactions", "AgreementTransaction", $agreementId, null, $ex); + // NOTE: PLEASE DO NOT USE RESULTPRINTER CLASS IN YOUR ORIGINAL CODE. FOR SAMPLE ONLY + ResultPrinter::printError("Search for Transactions", "AgreementTransaction", $agreementId, null, $ex); exit(1); } -ResultPrinter::printResult("Search for Transactions", "AgreementTransaction", $agreementId, $params, $result); +// NOTE: PLEASE DO NOT USE RESULTPRINTER CLASS IN YOUR ORIGINAL CODE. FOR SAMPLE ONLY + ResultPrinter::printResult("Search for Transactions", "AgreementTransaction", $agreementId, $params, $result); return $agreement; diff --git a/sample/billing/SuspendBillingAgreement.php b/sample/billing/SuspendBillingAgreement.php index 3d5cef0..fb12581 100644 --- a/sample/billing/SuspendBillingAgreement.php +++ b/sample/billing/SuspendBillingAgreement.php @@ -25,10 +25,12 @@ try { $agreement = Agreement::get($createdAgreement->getId(), $apiContext); } catch (Exception $ex) { - ResultPrinter::printError("Suspended the Agreement", "Agreement", null, $agreementStateDescriptor, $ex); + // NOTE: PLEASE DO NOT USE RESULTPRINTER CLASS IN YOUR ORIGINAL CODE. FOR SAMPLE ONLY + ResultPrinter::printError("Suspended the Agreement", "Agreement", null, $agreementStateDescriptor, $ex); exit(1); } -ResultPrinter::printResult("Suspended the Agreement", "Agreement", $agreement->getId(), $agreementStateDescriptor, $agreement); +// NOTE: PLEASE DO NOT USE RESULTPRINTER CLASS IN YOUR ORIGINAL CODE. FOR SAMPLE ONLY + ResultPrinter::printResult("Suspended the Agreement", "Agreement", $agreement->getId(), $agreementStateDescriptor, $agreement); return $agreement; diff --git a/sample/billing/UpdateBillingAgreement.php b/sample/billing/UpdateBillingAgreement.php index bc8144d..e79c026 100644 --- a/sample/billing/UpdateBillingAgreement.php +++ b/sample/billing/UpdateBillingAgreement.php @@ -37,10 +37,12 @@ try { $agreement = Agreement::get($createdAgreement->getId(), $apiContext); } catch (Exception $ex) { - ResultPrinter::printError("Updated the Agreement with new Description and Updated Shipping Address", "Agreement", null, $patchRequest, $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); exit(1); } -ResultPrinter::printResult("Updated the Agreement with new Description and Updated Shipping Address", "Agreement", $agreement->getId(), $patchRequest, $agreement); +// NOTE: PLEASE DO NOT USE RESULTPRINTER CLASS IN YOUR ORIGINAL CODE. FOR SAMPLE ONLY + ResultPrinter::printResult("Updated the Agreement with new Description and Updated Shipping Address", "Agreement", $agreement->getId(), $patchRequest, $agreement); return $agreement; diff --git a/sample/billing/UpdatePlan.php b/sample/billing/UpdatePlan.php index 96e2692..bbdfae2 100644 --- a/sample/billing/UpdatePlan.php +++ b/sample/billing/UpdatePlan.php @@ -35,10 +35,12 @@ try { $plan = Plan::get($createdPlan->getId(), $apiContext); } catch (Exception $ex) { - ResultPrinter::printError("Updated the Plan to Active State", "Plan", null, $patchRequest, $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); exit(1); } -ResultPrinter::printResult("Updated the Plan to Active State", "Plan", $plan->getId(), $patchRequest, $plan); +// NOTE: PLEASE DO NOT USE RESULTPRINTER CLASS IN YOUR ORIGINAL CODE. FOR SAMPLE ONLY + ResultPrinter::printResult("Updated the Plan to Active State", "Plan", $plan->getId(), $patchRequest, $plan); return $plan; diff --git a/sample/billing/UpdatePlanPaymentDefinitions.php b/sample/billing/UpdatePlanPaymentDefinitions.php index 912b95e..e58a0f0 100644 --- a/sample/billing/UpdatePlanPaymentDefinitions.php +++ b/sample/billing/UpdatePlanPaymentDefinitions.php @@ -42,10 +42,12 @@ try { $plan = Plan::get($createdPlan->getId(), $apiContext); } catch (Exception $ex) { - ResultPrinter::printError("Updated the Plan Payment Definition", "Plan", null, $patchRequest, $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); exit(1); } -ResultPrinter::printResult("Updated the Plan Payment Definition", "Plan", $plan->getId(), $patchRequest, $plan); +// NOTE: PLEASE DO NOT USE RESULTPRINTER CLASS IN YOUR ORIGINAL CODE. FOR SAMPLE ONLY + ResultPrinter::printResult("Updated the Plan Payment Definition", "Plan", $plan->getId(), $patchRequest, $plan); return $plan; diff --git a/sample/doc/assets/behavior.js b/sample/doc/assets/behavior.js index 816a63f..a8c411d 100644 --- a/sample/doc/assets/behavior.js +++ b/sample/doc/assets/behavior.js @@ -310,104 +310,7 @@ f.event={add:function(a,c,d,e,g){var h,i,j,k,l,m,n,o,p,q,r,s;if(!(a.nodeType===3 "pageTitle": "invoice/CreateInvoice", "title": "CreateInvoice" }, - "depth": 2, - "outline": [ - { - "type": "heading", - "data": { - "level": 1, - "title": "Create Invoice Sample", - "slug": "create-invoice-sample" - }, - "depth": 1, - "children": [ - { - "type": "heading", - "data": { - "level": 3, - "title": "Invoice Info", - "slug": "invoice-info" - }, - "depth": 3 - }, { - "type": "heading", - "data": { - "level": 3, - "title": "Merchant Info", - "slug": "merchant-info" - }, - "depth": 3 - }, { - "type": "heading", - "data": { - "level": 3, - "title": "Address Information", - "slug": "address-information" - }, - "depth": 3 - }, { - "type": "heading", - "data": { - "level": 3, - "title": "Billing Information", - "slug": "billing-information" - }, - "depth": 3 - }, { - "type": "heading", - "data": { - "level": 3, - "title": "Items List", - "slug": "items-list" - }, - "depth": 3, - "children": [ - { - "type": "heading", - "data": { - "level": 4, - "title": "Tax Item", - "slug": "tax-item" - }, - "depth": 4 - }, { - "type": "heading", - "data": { - "level": 4, - "title": "Tax Item", - "slug": "tax-item" - }, - "depth": 4 - } - ] - }, { - "type": "heading", - "data": { - "level": 3, - "title": "Shipping Information", - "slug": "shipping-information" - }, - "depth": 3 - }, { - "type": "heading", - "data": { - "level": 3, - "title": "Logo", - "slug": "logo" - }, - "depth": 3 - }, { - "type": "heading", - "data": { - "level": 3, - "title": "Create Invoice", - "slug": "create-invoice" - }, - "depth": 3 - } - ] - } - ] + "depth": 2 }, { "type": "file", "data": { @@ -697,56 +600,7 @@ f.event={add:function(a,c,d,e,g){var h,i,j,k,l,m,n,o,p,q,r,s;if(!(a.nodeType===3 "pageTitle": "notifications/CreateWebhook", "title": "CreateWebhook" }, - "depth": 2, - "outline": [ - { - "type": "heading", - "data": { - "level": 1, - "title": "Create Webhook Sample", - "slug": "create-webhook-sample" - }, - "depth": 1 - }, { - "type": "heading", - "data": { - "level": 1, - "title": "Basic Information", - "slug": "basic-information" - }, - "depth": 1, - "children": [ - { - "type": "heading", - "data": { - "level": 4, - "title": "NOTE: Please note that you need an https url for paypal webhooks. You can however override the url with https, and accept", - "slug": "note-please-note-that-you-need-an-https-url-for-paypal-webhooks-you-can-however-override-the-url-with-https-and-accept" - }, - "depth": 4 - } - ] - }, { - "type": "heading", - "data": { - "level": 1, - "title": "Event Types", - "slug": "event-types" - }, - "depth": 1, - "children": [ - { - "type": "heading", - "data": { - "level": 3, - "title": "Create Webhook", - "slug": "create-webhook" - }, - "depth": 3 - } - ] - } - ] + "depth": 2 }, { "type": "file", "data": { diff --git a/sample/doc/billing/CreateBillingAgreementWithCreditCard.html b/sample/doc/billing/CreateBillingAgreementWithCreditCard.html index aab9861..f5fb6f4 100644 --- a/sample/doc/billing/CreateBillingAgreementWithCreditCard.html +++ b/sample/doc/billing/CreateBillingAgreementWithCreditCard.html @@ -74,11 +74,8 @@ Please note that the plan Id should be only set in this case.

'US'); $agreement->setShippingAddress($shippingAddress);

For Sample Purposes Only.

$request = clone $agreement;

Create 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) { - ResultPrinter::printError("Created Billing Agreement.", "Agreement", $agreement->getId(), $request, $ex); +} 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); exit(1); -} - -ResultPrinter::printResult("Created Billing Agreement.", "Agreement", $agreement->getId(), $request, $agreement); +}

NOTE: PLEASE DO NOT USE RESULTPRINTER CLASS IN YOUR ORIGINAL CODE. FOR SAMPLE ONLY

ResultPrinter::printResult("Created Billing Agreement.", "Agreement", $agreement->getId(), $request, $agreement); return $agreement;
\ No newline at end of file diff --git a/sample/doc/billing/CreateBillingAgreementWithPayPal.html b/sample/doc/billing/CreateBillingAgreementWithPayPal.html index af586ee..ec36690 100644 --- a/sample/doc/billing/CreateBillingAgreementWithPayPal.html +++ b/sample/doc/billing/CreateBillingAgreementWithPayPal.html @@ -49,11 +49,8 @@ Please note that the plan Id should be only set in this case.

$approvalUrl = $agreement->getApprovalLink(); -} catch (Exception $ex) { - ResultPrinter::printError("Created Billing Agreement.", "Agreement", null, $request, $ex); +} 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); exit(1); -} - -ResultPrinter::printResult("Created Billing Agreement. Please visit the URL to Approve.", "Agreement", "<a href='$approvalUrl' >$approvalUrl</a>", $request, $agreement); +}

NOTE: PLEASE DO NOT USE RESULTPRINTER CLASS IN YOUR ORIGINAL CODE. FOR SAMPLE ONLY

ResultPrinter::printResult("Created Billing Agreement. Please visit the URL to Approve.", "Agreement", "<a href='$approvalUrl' >$approvalUrl</a>", $request, $agreement); return $agreement;
\ No newline at end of file diff --git a/sample/doc/billing/CreatePlan.html b/sample/doc/billing/CreatePlan.html index 7e6bde3..69b9ec8 100644 --- a/sample/doc/billing/CreatePlan.html +++ b/sample/doc/billing/CreatePlan.html @@ -36,11 +36,8 @@ This will keep your plan compatible with both the possible scenarios on how it i $plan->setPaymentDefinitions(array($paymentDefinition)); $plan->setMerchantPreferences($merchantPreferences);

For Sample Purposes Only.

$request = clone $plan;

Create Plan

try { $output = $plan->create($apiContext); -} catch (Exception $ex) { - ResultPrinter::printError("Created Plan", "Plan", null, $request, $ex); +} 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); exit(1); -} - -ResultPrinter::printResult("Created Plan", "Plan", $output->getId(), $request, $output); +}

NOTE: PLEASE DO NOT USE RESULTPRINTER CLASS IN YOUR ORIGINAL CODE. FOR SAMPLE ONLY

ResultPrinter::printResult("Created Plan", "Plan", $output->getId(), $request, $output); return $output;
\ No newline at end of file diff --git a/sample/doc/billing/DeletePlan.html b/sample/doc/billing/DeletePlan.html index b76de2d..94a8a2e 100644 --- a/sample/doc/billing/DeletePlan.html +++ b/sample/doc/billing/DeletePlan.html @@ -9,10 +9,12 @@ API used: /v1/payments/billing-plans

< try { $result = $createdPlan->delete($apiContext); } catch (Exception $ex) { - ResultPrinter::printError("Deleted a Plan", "Plan", $createdPlan->getId(), null, $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); exit(1); } -ResultPrinter::printResult("Deleted a Plan", "Plan", $createdPlan->getId(), null, null); +// NOTE: PLEASE DO NOT USE RESULTPRINTER CLASS IN YOUR ORIGINAL CODE. FOR SAMPLE ONLY + ResultPrinter::printResult("Deleted a Plan", "Plan", $createdPlan->getId(), null, null); -return $createdPlan;
\ No newline at end of file +return $createdPlan; diff --git a/sample/doc/billing/ExecuteAgreement.html b/sample/doc/billing/ExecuteAgreement.html index cb87d8e..529f830 100644 --- a/sample/doc/billing/ExecuteAgreement.html +++ b/sample/doc/billing/ExecuteAgreement.html @@ -7,21 +7,14 @@ Use this call to execute an agreement after the buyer approves it

$agreement = new \PayPal\Api\Agreement(); try {

Execute Agreement

Execute the agreement by passing in the token

$agreement->execute($token, $apiContext); - } catch (Exception $ex) { - ResultPrinter::printError("Executed an Agreement", "Agreement", $agreement->getId(), $_GET['token'], $ex); + } 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); exit(1); - } - - ResultPrinter::printResult("Executed an Agreement", "Agreement", $agreement->getId(), $_GET['token'], $agreement);

Get Agreement

+ }

NOTE: PLEASE DO NOT USE RESULTPRINTER CLASS IN YOUR ORIGINAL CODE. FOR SAMPLE ONLY

ResultPrinter::printResult("Executed an Agreement", "Agreement", $agreement->getId(), $_GET['token'], $agreement);

Get Agreement

Make a get call to retrieve the executed agreement details

try { $agreement = \PayPal\Api\Agreement::get($agreement->getId(), $apiContext); - } catch (Exception $ex) { - ResultPrinter::printError("Get Agreement", "Agreement", null, null, $ex); + } 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); 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); - ResultPrinter::printResult("Get Agreement", "Agreement", $agreement->getId(), null, $agreement); - -} else { - ResultPrinter::printResult("User Cancelled the Approval", null); +} else {

NOTE: PLEASE DO NOT USE RESULTPRINTER CLASS IN YOUR ORIGINAL CODE. FOR SAMPLE ONLY

ResultPrinter::printResult("User Cancelled the Approval", null); }
\ No newline at end of file diff --git a/sample/doc/billing/GetBillingAgreement.html b/sample/doc/billing/GetBillingAgreement.html index b456c1a..7b9f206 100644 --- a/sample/doc/billing/GetBillingAgreement.html +++ b/sample/doc/billing/GetBillingAgreement.html @@ -8,11 +8,8 @@ API used: /v1/payments/billing-agreements/

try { $agreement = Agreement::get($createdAgreement->getId(), $apiContext); -} catch (Exception $ex) { - ResultPrinter::printError("Retrieved an Agreement", "Agreement", $agreement->getId(), $createdAgreement->getId(), $ex); +} 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); exit(1); -} - -ResultPrinter::printResult("Retrieved an Agreement", "Agreement", $agreement->getId(), $createdAgreement->getId(), $agreement); +}

NOTE: PLEASE DO NOT USE RESULTPRINTER CLASS IN YOUR ORIGINAL CODE. FOR SAMPLE ONLY

ResultPrinter::printResult("Retrieved an Agreement", "Agreement", $agreement->getId(), $createdAgreement->getId(), $agreement); return $agreement;
\ No newline at end of file diff --git a/sample/doc/billing/GetPlan.html b/sample/doc/billing/GetPlan.html index fefab87..44504d4 100644 --- a/sample/doc/billing/GetPlan.html +++ b/sample/doc/billing/GetPlan.html @@ -9,10 +9,12 @@ API used: /v1/payments/billing-plans

< try { $plan = Plan::get($createdPlan->getId(), $apiContext); } catch (Exception $ex) { - ResultPrinter::printError("Retrieved a Plan", "Plan", $plan->getId(), null, $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); exit(1); } -ResultPrinter::printResult("Retrieved a Plan", "Plan", $plan->getId(), null, $plan); +// NOTE: PLEASE DO NOT USE RESULTPRINTER CLASS IN YOUR ORIGINAL CODE. FOR SAMPLE ONLY + ResultPrinter::printResult("Retrieved a Plan", "Plan", $plan->getId(), null, $plan); -return $plan;
\ No newline at end of file +return $plan; diff --git a/sample/doc/billing/ListPlans.html b/sample/doc/billing/ListPlans.html index 46901e0..dc5e88c 100644 --- a/sample/doc/billing/ListPlans.html +++ b/sample/doc/billing/ListPlans.html @@ -11,11 +11,8 @@ You can modify different params to change the return list. The explanation about each pagination information could be found here at https://developer.paypal.com/webapps/developer/docs/api/#list-plans

$params = array('page_size' => '2'); $planList = Plan::all($params, $apiContext); -} catch (Exception $ex) { - ResultPrinter::printError("List of Plans", "Plan", null, $params, $ex); +} 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); exit(1); -} - -ResultPrinter::printResult("List of Plans", "Plan", null, $params, $planList); +}

NOTE: PLEASE DO NOT USE RESULTPRINTER CLASS IN YOUR ORIGINAL CODE. FOR SAMPLE ONLY

ResultPrinter::printResult("List of Plans", "Plan", null, $params, $planList); return $planList;
\ No newline at end of file diff --git a/sample/doc/billing/ReactivateBillingAgreement.html b/sample/doc/billing/ReactivateBillingAgreement.html index e3895a2..331cd6e 100644 --- a/sample/doc/billing/ReactivateBillingAgreement.html +++ b/sample/doc/billing/ReactivateBillingAgreement.html @@ -15,11 +15,8 @@ API used: /v1/payments/billing-agreements//suspend

$suspendedAgreement->reActivate($agreementStateDescriptor, $apiContext);

Lets get the updated Agreement Object

$agreement = Agreement::get($suspendedAgreement->getId(), $apiContext); -} catch (Exception $ex) { - ResultPrinter::printResult("Reactivate the Agreement", "Agreement", $agreement->getId(), $suspendedAgreement, $ex); +} 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); exit(1); -} - -ResultPrinter::printResult("Reactivate the Agreement", "Agreement", $agreement->getId(), $suspendedAgreement, $agreement); +}

NOTE: PLEASE DO NOT USE RESULTPRINTER CLASS IN YOUR ORIGINAL CODE. FOR SAMPLE ONLY

ResultPrinter::printResult("Reactivate the Agreement", "Agreement", $agreement->getId(), $suspendedAgreement, $agreement); return $agreement;
\ No newline at end of file diff --git a/sample/doc/billing/SearchBillingTransactions.html b/sample/doc/billing/SearchBillingTransactions.html index cd22372..928fce6 100644 --- a/sample/doc/billing/SearchBillingTransactions.html +++ b/sample/doc/billing/SearchBillingTransactions.html @@ -8,11 +8,8 @@ API used: GET /v1/payments/billing-agreements//transactions? start try { $result = Agreement::searchTransactions($agreementId, $params, $apiContext); -} catch (Exception $ex) { - ResultPrinter::printError("Search for Transactions", "AgreementTransaction", $agreementId, null, $ex); +} 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); exit(1); -} - -ResultPrinter::printResult("Search for Transactions", "AgreementTransaction", $agreementId, $params, $result); +}

NOTE: PLEASE DO NOT USE RESULTPRINTER CLASS IN YOUR ORIGINAL CODE. FOR SAMPLE ONLY

ResultPrinter::printResult("Search for Transactions", "AgreementTransaction", $agreementId, $params, $result); return $agreement;
\ No newline at end of file diff --git a/sample/doc/billing/SuspendBillingAgreement.html b/sample/doc/billing/SuspendBillingAgreement.html index ce39717..e9cf5ad 100644 --- a/sample/doc/billing/SuspendBillingAgreement.html +++ b/sample/doc/billing/SuspendBillingAgreement.html @@ -15,11 +15,8 @@ API used: /v1/payments/billing-agreements//suspend

$createdAgreement->suspend($agreementStateDescriptor, $apiContext);

Lets get the updated Agreement Object

$agreement = Agreement::get($createdAgreement->getId(), $apiContext); -} catch (Exception $ex) { - ResultPrinter::printError("Suspended the Agreement", "Agreement", null, $agreementStateDescriptor, $ex); +} 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); exit(1); -} - -ResultPrinter::printResult("Suspended the Agreement", "Agreement", $agreement->getId(), $agreementStateDescriptor, $agreement); +}

NOTE: PLEASE DO NOT USE RESULTPRINTER CLASS IN YOUR ORIGINAL CODE. FOR SAMPLE ONLY

ResultPrinter::printResult("Suspended the Agreement", "Agreement", $agreement->getId(), $agreementStateDescriptor, $agreement); return $agreement;
\ No newline at end of file diff --git a/sample/doc/billing/UpdateBillingAgreement.html b/sample/doc/billing/UpdateBillingAgreement.html index cd79371..ff42c07 100644 --- a/sample/doc/billing/UpdateBillingAgreement.html +++ b/sample/doc/billing/UpdateBillingAgreement.html @@ -27,11 +27,8 @@ API used: /v1/payments/billing-agreements/

try { $createdAgreement->update($patchRequest, $apiContext);

Lets get the updated Agreement Object

$agreement = Agreement::get($createdAgreement->getId(), $apiContext); -} catch (Exception $ex) { - ResultPrinter::printError("Updated the Agreement with new Description and Updated Shipping Address", "Agreement", null, $patchRequest, $ex); +} 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); exit(1); -} - -ResultPrinter::printResult("Updated the Agreement with new Description and Updated Shipping Address", "Agreement", $agreement->getId(), $patchRequest, $agreement); +}

NOTE: PLEASE DO NOT USE RESULTPRINTER CLASS IN YOUR ORIGINAL CODE. FOR SAMPLE ONLY

ResultPrinter::printResult("Updated the Agreement with new Description and Updated Shipping Address", "Agreement", $agreement->getId(), $patchRequest, $agreement); return $agreement;
\ No newline at end of file diff --git a/sample/doc/billing/UpdatePlan.html b/sample/doc/billing/UpdatePlan.html index 1dc562b..8ef91be 100644 --- a/sample/doc/billing/UpdatePlan.html +++ b/sample/doc/billing/UpdatePlan.html @@ -26,11 +26,8 @@ API used: /v1/payments/billing-plans/

$plan = Plan::get($createdPlan->getId(), $apiContext); -} catch (Exception $ex) { - ResultPrinter::printError("Updated the Plan to Active State", "Plan", null, $patchRequest, $ex); +} 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); exit(1); -} - -ResultPrinter::printResult("Updated the Plan to Active State", "Plan", $plan->getId(), $patchRequest, $plan); +}

NOTE: PLEASE DO NOT USE RESULTPRINTER CLASS IN YOUR ORIGINAL CODE. FOR SAMPLE ONLY

ResultPrinter::printResult("Updated the Plan to Active State", "Plan", $plan->getId(), $patchRequest, $plan); return $plan;
\ No newline at end of file diff --git a/sample/doc/billing/UpdatePlanPaymentDefinitions.html b/sample/doc/billing/UpdatePlanPaymentDefinitions.html index 6bbf26a..450f97b 100644 --- a/sample/doc/billing/UpdatePlanPaymentDefinitions.html +++ b/sample/doc/billing/UpdatePlanPaymentDefinitions.html @@ -33,11 +33,8 @@ API used: /v1/payments/billing-plans/

$plan = Plan::get($createdPlan->getId(), $apiContext); -} catch (Exception $ex) { - ResultPrinter::printError("Updated the Plan Payment Definition", "Plan", null, $patchRequest, $ex); +} 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); exit(1); -} - -ResultPrinter::printResult("Updated the Plan Payment Definition", "Plan", $plan->getId(), $patchRequest, $plan); +}

NOTE: PLEASE DO NOT USE RESULTPRINTER CLASS IN YOUR ORIGINAL CODE. FOR SAMPLE ONLY

ResultPrinter::printResult("Updated the Plan Payment Definition", "Plan", $plan->getId(), $patchRequest, $plan); return $plan;
\ No newline at end of file diff --git a/sample/doc/invoice/CancelInvoice.html b/sample/doc/invoice/CancelInvoice.html index f6c61cc..af10410 100644 --- a/sample/doc/invoice/CancelInvoice.html +++ b/sample/doc/invoice/CancelInvoice.html @@ -20,9 +20,6 @@ static cancel method on the Invoice class by passing a valid notification object (See bootstrap.php for more on ApiContext)

$cancelStatus = $invoice->cancel($notify, $apiContext); -} catch (Exception $ex) { - ResultPrinter::printError("Cancel Invoice", "Invoice", null, $notify, $ex); +} 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); exit(1); -} - -ResultPrinter::printResult("Cancel Invoice", "Invoice", $invoice->getId(), $notify, null);
\ No newline at end of file +}

NOTE: PLEASE DO NOT USE RESULTPRINTER CLASS IN YOUR ORIGINAL CODE. FOR SAMPLE ONLY

ResultPrinter::printResult("Cancel Invoice", "Invoice", $invoice->getId(), $notify, null);
\ No newline at end of file diff --git a/sample/doc/invoice/CreateInvoice.html b/sample/doc/invoice/CreateInvoice.html index 2b73711..790abf6 100644 --- a/sample/doc/invoice/CreateInvoice.html +++ b/sample/doc/invoice/CreateInvoice.html @@ -103,11 +103,8 @@ detailed breakdown of invoice

try {

Create Invoice

Create an invoice by calling the invoice->create() method with a valid ApiContext (See bootstrap.php for more on ApiContext)

$invoice->create($apiContext); -} catch (Exception $ex) { - ResultPrinter::printError("Create Invoice", "Invoice", null, $request, $ex); +} 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); exit(1); -} - -ResultPrinter::printResult("Create Invoice", "Invoice", $invoice->getId(), $request, $invoice); +}

NOTE: PLEASE DO NOT USE RESULTPRINTER CLASS IN YOUR ORIGINAL CODE. FOR SAMPLE ONLY

ResultPrinter::printResult("Create Invoice", "Invoice", $invoice->getId(), $request, $invoice); return $invoice;
\ No newline at end of file diff --git a/sample/doc/invoice/DeleteInvoice.html b/sample/doc/invoice/DeleteInvoice.html index 6de371b..a5f72d7 100644 --- a/sample/doc/invoice/DeleteInvoice.html +++ b/sample/doc/invoice/DeleteInvoice.html @@ -12,9 +12,6 @@ an invoice.

$deleteStatus = $invoice->delete($apiContext); -} catch (Exception $ex) { - ResultPrinter::printError("Delete Invoice", "Invoice", null, $deleteStatus, $ex); +} 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); exit(1); -} - -ResultPrinter::printResult("Delete Invoice", "Invoice", $invoice->getId(), null, null);
\ No newline at end of file +}

NOTE: PLEASE DO NOT USE RESULTPRINTER CLASS IN YOUR ORIGINAL CODE. FOR SAMPLE ONLY

ResultPrinter::printResult("Delete Invoice", "Invoice", $invoice->getId(), null, null);
\ No newline at end of file diff --git a/sample/doc/invoice/GetInvoice.html b/sample/doc/invoice/GetInvoice.html index da96413..6d396b7 100644 --- a/sample/doc/invoice/GetInvoice.html +++ b/sample/doc/invoice/GetInvoice.html @@ -11,11 +11,8 @@ on the Invoice class by passing a valid Invoice ID (See bootstrap.php for more on ApiContext)

try { $invoice = Invoice::get($invoiceId, $apiContext); -} catch (Exception $ex) { - ResultPrinter::printError("Get Invoice", "Invoice", $invoice->getId(), $invoiceId, $ex); +} 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); exit(1); -} - -ResultPrinter::printResult("Get Invoice", "Invoice", $invoice->getId(), $invoiceId, $invoice); +}

NOTE: PLEASE DO NOT USE RESULTPRINTER CLASS IN YOUR ORIGINAL CODE. FOR SAMPLE ONLY

ResultPrinter::printResult("Get Invoice", "Invoice", $invoice->getId(), $invoiceId, $invoice); return $invoice;
\ No newline at end of file diff --git a/sample/doc/invoice/ListInvoice.html b/sample/doc/invoice/ListInvoice.html index 465c799..df148ce 100644 --- a/sample/doc/invoice/ListInvoice.html +++ b/sample/doc/invoice/ListInvoice.html @@ -10,7 +10,9 @@ static get_all method on the Invoice class. Refer the method doc for valid values for keys (See bootstrap.php for more on ApiContext)

$invoices = Invoice::getAll(array('page' => 0, 'page_size' => 4, 'total_count_required' => "true"), $apiContext); } catch (Exception $ex) { - ResultPrinter::printError("Lookup Invoice History", "Invoice", null, null, $ex); + // NOTE: PLEASE DO NOT USE RESULTPRINTER CLASS IN YOUR ORIGINAL CODE. FOR SAMPLE ONLY + ResultPrinter::printError("Lookup Invoice History", "Invoice", null, null, $ex); exit(1); } -ResultPrinter::printResult("Lookup Invoice History", "Invoice", null, null, $invoices);
\ No newline at end of file +// NOTE: PLEASE DO NOT USE RESULTPRINTER CLASS IN YOUR ORIGINAL CODE. FOR SAMPLE ONLY + ResultPrinter::printResult("Lookup Invoice History", "Invoice", null, null, $invoices); diff --git a/sample/doc/invoice/RecordPayment.html b/sample/doc/invoice/RecordPayment.html index ee4d6d0..cb66c71 100644 --- a/sample/doc/invoice/RecordPayment.html +++ b/sample/doc/invoice/RecordPayment.html @@ -20,23 +20,17 @@ You can use the new way of injecting json directly to the object.

ApiContext)

$recordStatus = $invoice->recordPayment($record, $apiContext); -} catch (Exception $ex) { - ResultPrinter::printError("Payment for Invoice", "Invoice", null, null, $ex); +} 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); exit(1); -} - -ResultPrinter::printResult("Payment for Invoice", "Invoice", $invoice->getId(), $record, null);

Retrieve Invoice

+}

NOTE: PLEASE DO NOT USE RESULTPRINTER CLASS IN YOUR ORIGINAL CODE. FOR SAMPLE ONLY

ResultPrinter::printResult("Payment for Invoice", "Invoice", $invoice->getId(), $record, null);

Retrieve Invoice

Retrieve the invoice object by calling the static get method on the Invoice class by passing a valid Invoice ID (See bootstrap.php for more on ApiContext)

try { $invoice = Invoice::get($invoice->getId(), $apiContext); -} catch (Exception $ex) { - ResultPrinter::printError("Get Invoice (Not Required - For Sample Only)", "Invoice", $invoice->getId(), $invoice->getId(), $ex); +} 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); exit(1); -} - -ResultPrinter::printResult("Get Invoice (Not Required - For Sample Only)", "Invoice", $invoice->getId(), $invoice->getId(), $invoice); +}

NOTE: PLEASE DO NOT USE RESULTPRINTER CLASS IN YOUR ORIGINAL CODE. FOR SAMPLE ONLY

ResultPrinter::printResult("Get Invoice (Not Required - For Sample Only)", "Invoice", $invoice->getId(), $invoice->getId(), $invoice); return $invoice;
\ No newline at end of file diff --git a/sample/doc/invoice/RecordRefund.html b/sample/doc/invoice/RecordRefund.html index 8280bb4..aa82b78 100644 --- a/sample/doc/invoice/RecordRefund.html +++ b/sample/doc/invoice/RecordRefund.html @@ -19,23 +19,17 @@ You can use the new way of injecting json directly to the object.

ApiContext)

$refundStatus = $invoice->recordRefund($refund, $apiContext); -} catch (Exception $ex) { - ResultPrinter::printError("Refund for Invoice", "Invoice", null, null, $ex); +} 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); exit(1); -} - -ResultPrinter::printResult("Refund for Invoice", "Invoice", $invoice->getId(), $refund, null);

Retrieve Invoice

+}

NOTE: PLEASE DO NOT USE RESULTPRINTER CLASS IN YOUR ORIGINAL CODE. FOR SAMPLE ONLY

ResultPrinter::printResult("Refund for Invoice", "Invoice", $invoice->getId(), $refund, null);

Retrieve Invoice

Retrieve the invoice object by calling the static get method on the Invoice class by passing a valid Invoice ID (See bootstrap.php for more on ApiContext)

try { $invoice = Invoice::get($invoice->getId(), $apiContext); -} catch (Exception $ex) { - ResultPrinter::printError("Get Invoice (Not Required - For Sample Only)", "Invoice", $invoice->getId(), $invoice->getId(), $ex); +} 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); exit(1); -} - -ResultPrinter::printResult("Get Invoice (Not Required - For Sample Only)", "Invoice", $invoice->getId(), $invoice->getId(), $invoice); +}

NOTE: PLEASE DO NOT USE RESULTPRINTER CLASS IN YOUR ORIGINAL CODE. FOR SAMPLE ONLY

ResultPrinter::printResult("Get Invoice (Not Required - For Sample Only)", "Invoice", $invoice->getId(), $invoice->getId(), $invoice); return $invoice;
\ No newline at end of file diff --git a/sample/doc/invoice/RemindInvoice.html b/sample/doc/invoice/RemindInvoice.html index 428df8a..bf4838c 100644 --- a/sample/doc/invoice/RemindInvoice.html +++ b/sample/doc/invoice/RemindInvoice.html @@ -19,23 +19,17 @@ and payer is retrieved from the invoice details

ApiContext)

$remindStatus = $invoice->remind($notify, $apiContext); -} catch (Exception $ex) { - ResultPrinter::printError("Remind Invoice", "Invoice", null, $notify, $ex); +} 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); exit(1); -} - -ResultPrinter::printResult("Remind Invoice", "Invoice", null, $notify, null);

Retrieve Invoice

+}

NOTE: PLEASE DO NOT USE RESULTPRINTER CLASS IN YOUR ORIGINAL CODE. FOR SAMPLE ONLY

ResultPrinter::printResult("Remind Invoice", "Invoice", null, $notify, null);

Retrieve Invoice

Retrieve the invoice object by calling the static get method on the Invoice class by passing a valid Invoice ID (See bootstrap.php for more on ApiContext)

try { $invoice = Invoice::get($invoice->getId(), $apiContext); -} catch (Exception $ex) { - ResultPrinter::printError("Get Invoice (Not Required - For Sample Only)", "Invoice", $invoice->getId(), $invoice->getId(), $ex); +} 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); exit(1); -} - -ResultPrinter::printResult("Get Invoice (Not Required - For Sample Only)", "Invoice", $invoice->getId(), $invoice->getId(), $invoice); +}

NOTE: PLEASE DO NOT USE RESULTPRINTER CLASS IN YOUR ORIGINAL CODE. FOR SAMPLE ONLY

ResultPrinter::printResult("Get Invoice (Not Required - For Sample Only)", "Invoice", $invoice->getId(), $invoice->getId(), $invoice); return $invoice;
\ No newline at end of file diff --git a/sample/doc/invoice/RetrieveQRCode.html b/sample/doc/invoice/RetrieveQRCode.html index aa1771e..f1e982b 100644 --- a/sample/doc/invoice/RetrieveQRCode.html +++ b/sample/doc/invoice/RetrieveQRCode.html @@ -16,12 +16,9 @@ notification object This will save the image as /samples/invoice/images/sample.png

$path = $image->saveToFile("images/sample.png"); -} catch (Exception $ex) { - ResultPrinter::printError("Retrieved QR Code for Invoice", "Invoice", $invoice->getId(), null, $ex); +} 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); exit(1); -} - -ResultPrinter::printResult("Retrieved QR Code for Invoice", "Invoice", $invoice->getId(), null, $image);

Show the Image

+}

NOTE: PLEASE DO NOT USE RESULTPRINTER CLASS IN YOUR ORIGINAL CODE. FOR SAMPLE ONLY

ResultPrinter::printResult("Retrieved QR Code for Invoice", "Invoice", $invoice->getId(), null, $image);

Show the Image

In PHP, there are many ways to present an images. One of the ways, you could directly inject the base64-encoded string with proper image information in front of it.

echo '<img src="data:image/png;base64,'. $image->getImage() . '" alt="Invoice QR Code" />';
\ No newline at end of file diff --git a/sample/doc/invoice/SearchInvoices.html b/sample/doc/invoice/SearchInvoices.html index b458d8c..33b75db 100644 --- a/sample/doc/invoice/SearchInvoices.html +++ b/sample/doc/invoice/SearchInvoices.html @@ -21,7 +21,9 @@ static search method on the Invoice class. Refer the method doc for valid values for keys (See bootstrap.php for more on ApiContext)

$invoices = Invoice::search($search, $apiContext); } catch (Exception $ex) { - ResultPrinter::printError("Search Invoice", "Invoice", null, null, $ex); + // NOTE: PLEASE DO NOT USE RESULTPRINTER CLASS IN YOUR ORIGINAL CODE. FOR SAMPLE ONLY + ResultPrinter::printError("Search Invoice", "Invoice", null, null, $ex); exit(1); } -ResultPrinter::printResult("Search Invoice", "Invoice", null, $search, $invoices);
\ No newline at end of file +// NOTE: PLEASE DO NOT USE RESULTPRINTER CLASS IN YOUR ORIGINAL CODE. FOR SAMPLE ONLY + ResultPrinter::printResult("Search Invoice", "Invoice", null, $search, $invoices); diff --git a/sample/doc/invoice/SendInvoice.html b/sample/doc/invoice/SendInvoice.html index 2a81325..310cda5 100644 --- a/sample/doc/invoice/SendInvoice.html +++ b/sample/doc/invoice/SendInvoice.html @@ -8,23 +8,17 @@ a legitimate invoice to the payer

try {

Send Invoice

Send a legitimate invoice to the payer with a valid ApiContext (See bootstrap.php for more on ApiContext)

$sendStatus = $invoice->send($apiContext); -} catch (Exception $ex) { - ResultPrinter::printResult("Send Invoice", "Invoice", null, null, $ex); +} catch (Exception $ex) {

NOTE: PLEASE DO NOT USE RESULTPRINTER CLASS IN YOUR ORIGINAL CODE. FOR SAMPLE ONLY

ResultPrinter::printError("Send Invoice", "Invoice", null, null, $ex); exit(1); -} - -ResultPrinter::printResult("Send Invoice", "Invoice", $invoice->getId(), null, null);

Retrieve Invoice

+}

NOTE: PLEASE DO NOT USE RESULTPRINTER CLASS IN YOUR ORIGINAL CODE. FOR SAMPLE ONLY

ResultPrinter::printResult("Send Invoice", "Invoice", $invoice->getId(), null, null);

Retrieve Invoice

Retrieve the invoice object by calling the static get method on the Invoice class by passing a valid Invoice ID (See bootstrap.php for more on ApiContext)

try { $invoice = Invoice::get($invoice->getId(), $apiContext); -} catch (Exception $ex) { - ResultPrinter::printError("Get Invoice (Not Required - For Sample Only)", "Invoice", $invoice->getId(), $invoice->getId(), $ex); +} 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); exit(1); -} - -ResultPrinter::printResult("Get Invoice (Not Required - For Sample Only)", "Invoice", $invoice->getId(), $invoice->getId(), $invoice); +}

NOTE: PLEASE DO NOT USE RESULTPRINTER CLASS IN YOUR ORIGINAL CODE. FOR SAMPLE ONLY

ResultPrinter::printResult("Get Invoice (Not Required - For Sample Only)", "Invoice", $invoice->getId(), $invoice->getId(), $invoice); return $invoice;
\ No newline at end of file diff --git a/sample/doc/invoice/UpdateInvoice.html b/sample/doc/invoice/UpdateInvoice.html index 15bb597..63b3550 100644 --- a/sample/doc/invoice/UpdateInvoice.html +++ b/sample/doc/invoice/UpdateInvoice.html @@ -13,23 +13,17 @@ There is already an internal ticket #PPTIPS-1932 created for it.

try {

Update Invoice

Update an invoice by calling the invoice->update() method with a valid ApiContext (See bootstrap.php for more on ApiContext)

$invoice->update($apiContext); -} catch (Exception $ex) { - ResultPrinter::printError("Invoice Updated", "Invoice", null, $request, $ex); +} 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); exit(1); -} - -ResultPrinter::printResult("Invoice Updated", "Invoice", $invoice->getId(), $request, $invoice);

Retrieve Invoice

+}

NOTE: PLEASE DO NOT USE RESULTPRINTER CLASS IN YOUR ORIGINAL CODE. FOR SAMPLE ONLY

ResultPrinter::printResult("Invoice Updated", "Invoice", $invoice->getId(), $request, $invoice);

Retrieve Invoice

Retrieve the invoice object by calling the static get method on the Invoice class by passing a valid Invoice ID (See bootstrap.php for more on ApiContext)

try { $invoice = Invoice::get($invoice->getId(), $apiContext); -} catch (Exception $ex) { - ResultPrinter::printError("Get Invoice (Not Required - For Sample Only)", "Invoice", $invoice->getId(), $invoice->getId(), $ex); +} 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); exit(1); -} - -ResultPrinter::printResult("Get Invoice (Not Required - For Sample Only)", "Invoice", $invoice->getId(), $invoice->getId(), $invoice); +}

NOTE: PLEASE DO NOT USE RESULTPRINTER CLASS IN YOUR ORIGINAL CODE. FOR SAMPLE ONLY

ResultPrinter::printResult("Get Invoice (Not Required - For Sample Only)", "Invoice", $invoice->getId(), $invoice->getId(), $invoice); return $invoice;
\ No newline at end of file diff --git a/sample/doc/lipp/GenerateAccessTokenFromRefreshToken.html b/sample/doc/lipp/GenerateAccessTokenFromRefreshToken.html index 0c38229..fc7bba9 100644 --- a/sample/doc/lipp/GenerateAccessTokenFromRefreshToken.html +++ b/sample/doc/lipp/GenerateAccessTokenFromRefreshToken.html @@ -7,8 +7,10 @@ $tokenInfo = $tokenInfo->createFromRefreshToken(array('refresh_token' => $refreshToken), $apiContext); } catch (Exception $ex) { - ResultPrinter::printError("Obtained Access Token From Refresh Token", "Access Token", null, null, $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); exit(1); } -ResultPrinter::printResult("Obtained Access Token From Refresh Token", "Access Token", $tokenInfo->getAccessToken(), null, $tokenInfo); \ No newline at end of file +// NOTE: PLEASE DO NOT USE RESULTPRINTER CLASS IN YOUR ORIGINAL CODE. FOR SAMPLE ONLY + ResultPrinter::printResult("Obtained Access Token From Refresh Token", "Access Token", $tokenInfo->getAccessToken(), null, $tokenInfo); diff --git a/sample/doc/lipp/GetUserInfo.html b/sample/doc/lipp/GetUserInfo.html index bd73797..a7b717a 100644 --- a/sample/doc/lipp/GetUserInfo.html +++ b/sample/doc/lipp/GetUserInfo.html @@ -17,8 +17,10 @@ to retreive the information. The short lived access token can be retrieved using $userInfo = OpenIdUserinfo::getUserinfo($params, $apiContext); } catch (Exception $ex) { - ResultPrinter::printError("User Information", "User Info", null, $params, $ex); + // NOTE: PLEASE DO NOT USE RESULTPRINTER CLASS IN YOUR ORIGINAL CODE. FOR SAMPLE ONLY + ResultPrinter::printError("User Information", "User Info", null, $params, $ex); exit(1); } -ResultPrinter::printResult("User Information", "User Info", $userInfo->getUserId(), $params, $userInfo); \ No newline at end of file +// NOTE: PLEASE DO NOT USE RESULTPRINTER CLASS IN YOUR ORIGINAL CODE. FOR SAMPLE ONLY + ResultPrinter::printResult("User Information", "User Info", $userInfo->getUserId(), $params, $userInfo); diff --git a/sample/doc/lipp/ObtainUserConsent.html b/sample/doc/lipp/ObtainUserConsent.html index 00a392e..3542e51 100644 --- a/sample/doc/lipp/ObtainUserConsent.html +++ b/sample/doc/lipp/ObtainUserConsent.html @@ -16,4 +16,5 @@ $apiContext ); -ResultPrinter::printResult("Generated the User Consent URL", "URL", '<a href="'. $redirectUrl . '" >Click Here to Obtain User Consent</a>', $baseUrl, $redirectUrl); \ No newline at end of file +// NOTE: PLEASE DO NOT USE RESULTPRINTER CLASS IN YOUR ORIGINAL CODE. FOR SAMPLE ONLY + ResultPrinter::printResult("Generated the User Consent URL", "URL", '<a href="'. $redirectUrl . '" >Click Here to Obtain User Consent</a>', $baseUrl, $redirectUrl); diff --git a/sample/doc/lipp/UserConsentRedirect.html b/sample/doc/lipp/UserConsentRedirect.html index 3029533..d4e9de8 100644 --- a/sample/doc/lipp/UserConsentRedirect.html +++ b/sample/doc/lipp/UserConsentRedirect.html @@ -12,11 +12,8 @@ The user would then able to retrieve the access token by getting the code, which $code = $_GET['code']; try {

Obtain Authorization Code from Code, Client ID and Client Secret

$accessToken = OpenIdTokeninfo::createFromAuthorizationCode(array('code' => $code), null, null, $apiContext); - } catch (PayPalConnectionException $ex) { - ResultPrinter::printError("Obtained Access Token", "Access Token", null, $_GET['code'], $ex); + } 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); exit(1); - } - - ResultPrinter::printResult("Obtained Access Token", "Access Token", $accessToken->getAccessToken(), $_GET['code'], $accessToken); + }

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); }
\ No newline at end of file diff --git a/sample/doc/notifications/CreateWebhook.html b/sample/doc/notifications/CreateWebhook.html index a63b581..c972212 100644 --- a/sample/doc/notifications/CreateWebhook.html +++ b/sample/doc/notifications/CreateWebhook.html @@ -34,25 +34,19 @@ be using this in production

$output = $webhook->create($apiContext); } catch (Exception $ex) {
// Ignore workflow code segment
// Ignore workflow code segment if ($ex instanceof \PayPal\Exception\PayPalConnectionException) { - $data = $ex->getData(); - ResultPrinter::printError("Created Webhook Failed. Checking if it is Webhook Number Limit Exceeded. Trying to delete all existing webhooks", "Webhook", "Please Use <a style='color: red;' href='DeleteAllWebhooks.php' >Delete All Webhooks</a> Sample to delete all existing webhooks in sample", $request, $ex); + $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 <a style='color: red;' href='DeleteAllWebhooks.php' >Delete All Webhooks</a> Sample to delete all existing webhooks in sample", $request, $ex); if (strpos($data,'WEBHOOK_NUMBER_LIMIT_EXCEEDED') !== false) { require 'DeleteAllWebhooks.php'; try { $output = $webhook->create($apiContext); - } catch (Exception $ex) { - ResultPrinter::printError("Created Webhook", "Webhook", null, $request, $ex); + } catch (Exception $ex) {

NOTE: PLEASE DO NOT USE RESULTPRINTER CLASS IN YOUR ORIGINAL CODE. FOR SAMPLE ONLY

ResultPrinter::printError("Created Webhook", "Webhook", null, $request, $ex); exit(1); } - } else { - ResultPrinter::printError("Created Webhook", "Webhook", null, $request, $ex); + } else {

NOTE: PLEASE DO NOT USE RESULTPRINTER CLASS IN YOUR ORIGINAL CODE. FOR SAMPLE ONLY

ResultPrinter::printError("Created Webhook", "Webhook", null, $request, $ex); exit(1); } - } else { - ResultPrinter::printError("Created Webhook", "Webhook", null, $request, $ex); + } else {

NOTE: PLEASE DO NOT USE RESULTPRINTER CLASS IN YOUR ORIGINAL CODE. FOR SAMPLE ONLY

ResultPrinter::printError("Created Webhook", "Webhook", null, $request, $ex); exit(1); - }

Print Success Result

} - -ResultPrinter::printResult("Created Webhook", "Webhook", $output->getId(), $request, $output); + }

Print Success Result

}

NOTE: PLEASE DO NOT USE RESULTPRINTER CLASS IN YOUR ORIGINAL CODE. FOR SAMPLE ONLY

ResultPrinter::printResult("Created Webhook", "Webhook", $output->getId(), $request, $output); return $output;
\ No newline at end of file diff --git a/sample/doc/notifications/DeleteAllWebhooks.html b/sample/doc/notifications/DeleteAllWebhooks.html index ae3732c..d77a099 100644 --- a/sample/doc/notifications/DeleteAllWebhooks.html +++ b/sample/doc/notifications/DeleteAllWebhooks.html @@ -5,11 +5,8 @@ To properly use the sample, change the clientId and Secret from bootstrap.php fi foreach ($webhookList->getWebhooks() as $webhook) { $webhook->delete($apiContext); } -} catch (Exception $ex) { - ResultPrinter::printError("Deleted all Webhooks", "WebhookList", null, null, $ex); +} 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); exit(1); -} - -ResultPrinter::printResult("Delete all Webhook, as it may have exceed the maximum count.", "WebhookList", null, null, null); +}

NOTE: PLEASE DO NOT USE RESULTPRINTER CLASS IN YOUR ORIGINAL CODE. FOR SAMPLE ONLY

ResultPrinter::printResult("Delete all Webhook, as it may have exceed the maximum count.", "WebhookList", null, null, null); return $output;
\ No newline at end of file diff --git a/sample/doc/notifications/DeleteWebhook.html b/sample/doc/notifications/DeleteWebhook.html index 58a5568..451338d 100644 --- a/sample/doc/notifications/DeleteWebhook.html +++ b/sample/doc/notifications/DeleteWebhook.html @@ -4,11 +4,8 @@ API used: DELETE v1/notifications/webhooks/

Get Webhook Instance

/** @var \PayPal\Api\Webhook $webhook */ $webhook = require 'CreateWebhook.php';

Delete Webhook

try { $output = $webhook->delete($apiContext); -} catch (Exception $ex) { - ResultPrinter::printError("Delete a Webhook", "Webhook", null, $webhookId, $ex); +} 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); exit(1); -} - -ResultPrinter::printResult("Delete a Webhook", "Webhook", $webhook->getId(), null, null); +}

NOTE: PLEASE DO NOT USE RESULTPRINTER CLASS IN YOUR ORIGINAL CODE. FOR SAMPLE ONLY

ResultPrinter::printResult("Delete a Webhook", "Webhook", $webhook->getId(), null, null); return $output;
\ No newline at end of file diff --git a/sample/doc/notifications/GetWebhook.html b/sample/doc/notifications/GetWebhook.html index effe762..1708d7f 100644 --- a/sample/doc/notifications/GetWebhook.html +++ b/sample/doc/notifications/GetWebhook.html @@ -7,11 +7,8 @@ However, in real case scenario, we could use just the ID from database or retrie $webhook = require 'CreateWebhook.php'; $webhookId = $webhook->getId();

Get Webhook

try { $output = \PayPal\Api\Webhook::get($webhookId, $apiContext); -} catch (Exception $ex) { - ResultPrinter::printError("Get a Webhook", "Webhook", null, $webhookId, $ex); +} 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); exit(1); -} - -ResultPrinter::printResult("Get a Webhook", "Webhook", $output->getId(), null, $output); +}

NOTE: PLEASE DO NOT USE RESULTPRINTER CLASS IN YOUR ORIGINAL CODE. FOR SAMPLE ONLY

ResultPrinter::printResult("Get a Webhook", "Webhook", $output->getId(), null, $output); return $output;
\ No newline at end of file diff --git a/sample/doc/notifications/ListSubscribedWebhookEventTypes.html b/sample/doc/notifications/ListSubscribedWebhookEventTypes.html index 85262c9..a771a8f 100644 --- a/sample/doc/notifications/ListSubscribedWebhookEventTypes.html +++ b/sample/doc/notifications/ListSubscribedWebhookEventTypes.html @@ -6,11 +6,8 @@ API used: GET /v1/notifications/webhooks/

$webhook = require 'CreateWebhook.php'; $webhookId = $webhook->getId();

Get List of Subscribed Event Types

try { $output = \PayPal\Api\WebhookEventType::subscribedEventTypes($webhookId, $apiContext); -} catch (Exception $ex) { - ResultPrinter::printError("List subscribed webhook event types", "WebhookEventTypeList", null, $webhookId, $ex); +} 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); exit(1); -} - -ResultPrinter::printResult("List subscribed webhook event types", "WebhookEventTypeList",null, null, $output); +}

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); return $output;
\ No newline at end of file diff --git a/sample/doc/notifications/ListWebhooks.html b/sample/doc/notifications/ListWebhooks.html index a001b39..08bc4fc 100644 --- a/sample/doc/notifications/ListWebhooks.html +++ b/sample/doc/notifications/ListWebhooks.html @@ -6,11 +6,8 @@ get an empty list at any point. In real case, you dont need to create any webhook to make this API call.

/** @var \PayPal\Api\Webhook $webhook */ $webhook = require_once __DIR__ . '/../bootstrap.php';

Get List of All Webhooks

try { $output = \PayPal\Api\Webhook::getAll($apiContext); -} catch (Exception $ex) { - ResultPrinter::printError("List all webhooks", "WebhookList", null, $webhookId, $ex); +} 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); exit(1); -} - -ResultPrinter::printResult("List all webhooks", "WebhookList",null, null, $output); +}

NOTE: PLEASE DO NOT USE RESULTPRINTER CLASS IN YOUR ORIGINAL CODE. FOR SAMPLE ONLY

ResultPrinter::printResult("List all webhooks", "WebhookList",null, null, $output); return $output;
\ No newline at end of file diff --git a/sample/doc/notifications/SearchWebhookEvents.html b/sample/doc/notifications/SearchWebhookEvents.html index 558332e..33b2e15 100644 --- a/sample/doc/notifications/SearchWebhookEvents.html +++ b/sample/doc/notifications/SearchWebhookEvents.html @@ -11,12 +11,9 @@ for a webhook events. This is made in a sample just to make sure there is minimu $params = array(

'start_time'=>'2014-12-06T11:00:00Z', 'end_time'=>'2014-12-12T11:00:00Z'

);

Search Webhook events

try { $output = \PayPal\Api\WebhookEvent::all($params, $apiContext); -} catch (Exception $ex) { - ResultPrinter::printError("Search Webhook events", "WebhookEventList", null, null, $ex); +} 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); exit(1); -} - -ResultPrinter::printResult("Search Webhook events", "WebhookEventList", null, $params, $output); +}

NOTE: PLEASE DO NOT USE RESULTPRINTER CLASS IN YOUR ORIGINAL CODE. FOR SAMPLE ONLY

ResultPrinter::printResult("Search Webhook events", "WebhookEventList", null, $params, $output); return $output;
\ No newline at end of file diff --git a/sample/doc/notifications/UpdateWebhook.html b/sample/doc/notifications/UpdateWebhook.html index 57e1547..09ad0f6 100644 --- a/sample/doc/notifications/UpdateWebhook.html +++ b/sample/doc/notifications/UpdateWebhook.html @@ -33,11 +33,8 @@ However, in real case scenario, we could use just the ID from database or use an $patchRequest = new \PayPal\Api\PatchRequest(); $patchRequest->addPatch($patch)->addPatch($patch2);

Get Webhook

try { $output = $webhook->update($patchRequest, $apiContext); -} catch (Exception $ex) { - ResultPrinter::printError("Updated a Webhook", "Webhook", null, $patchRequest, $ex); +} 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); exit(1); -} - -ResultPrinter::printResult("Updated a Webhook", "Webhook", $output->getId(), $patchRequest, $output); +}

NOTE: PLEASE DO NOT USE RESULTPRINTER CLASS IN YOUR ORIGINAL CODE. FOR SAMPLE ONLY

ResultPrinter::printResult("Updated a Webhook", "Webhook", $output->getId(), $patchRequest, $output); return $output;
\ No newline at end of file diff --git a/sample/doc/notifications/WebhookEventTypesList.html b/sample/doc/notifications/WebhookEventTypesList.html index 554a027..c7ef783 100644 --- a/sample/doc/notifications/WebhookEventTypesList.html +++ b/sample/doc/notifications/WebhookEventTypesList.html @@ -3,11 +3,8 @@ https://developer.paypal.com/webapps/developer/docs/api/#get-a-reference-list-of-webhook-event-types API used: GET /v1/notifications/webhooks-event-types

$apiContext = require __DIR__ . '/../bootstrap.php';

Get List of all Webhook event types

try { $output = \PayPal\Api\WebhookEventType::availableEventTypes($apiContext); -} catch (Exception $ex) { - ResultPrinter::printError("Get List of All Webhook Event Types", "WebhookEventTypeList", null, null, $ex); +} 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); exit(1); -} - -ResultPrinter::printResult("Get List of All Webhook Event Types", "WebhookEventTypeList", null, null, $output); +}

NOTE: PLEASE DO NOT USE RESULTPRINTER CLASS IN YOUR ORIGINAL CODE. FOR SAMPLE ONLY

ResultPrinter::printResult("Get List of All Webhook Event Types", "WebhookEventTypeList", null, null, $output); return $output;
\ No newline at end of file diff --git a/sample/doc/payment-experience/CreateWebProfile.html b/sample/doc/payment-experience/CreateWebProfile.html index 8f1926c..8e2202a 100644 --- a/sample/doc/payment-experience/CreateWebProfile.html +++ b/sample/doc/payment-experience/CreateWebProfile.html @@ -6,11 +6,8 @@ Documentation available at
$flowConfig = new \PayPal\Api\FlowConfig();

Type of PayPal page to be displayed when a user lands on the PayPal site for checkout. Allowed values: Billing or Login. When set to Billing, the Non-PayPal account landing page is used. When set to Login, the PayPal account login landing page is used.

$flowConfig->setLandingPageType("Billing");

The URL on the merchant site for transferring to after a bank transfer payment.

$flowConfig->setBankTxnPendingUrl("http://www.yeowza.com/");

Parameters for style and presentation.

$presentation = new \PayPal\Api\Presentation();

A URL to logo image. Allowed vaues: .gif, .jpg, or .png.

$presentation->setLogoImage("http://www.yeowza.com/favico.ico")

A label that overrides the business name in the PayPal account on the PayPal pages.

->setBrandName("YeowZa! Paypal")

Locale of pages displayed by PayPal payment experience.

->setLocaleCode("US");

Parameters for input fields customization.

$inputFields = new \PayPal\Api\InputFields();

Enables the buyer to enter a note to the merchant on the PayPal page during checkout.

$inputFields->setAllowNote(true)

Determines whether or not PayPal displays shipping address fields on the experience pages. Allowed values: 0, 1, or 2. When set to 0, PayPal displays the shipping address on the PayPal pages. When set to 1, PayPal does not display shipping address fields whatsoever. When set to 2, if you do not pass the shipping address, PayPal obtains it from the buyer’s account profile. For digital goods, this field is required, and you must set it to 1.

->setNoShipping(1)

Determines whether or not the PayPal pages should display the shipping address and not the shipping address on file with PayPal for this buyer. Displaying the PayPal street address on file does not allow the buyer to edit that address. Allowed values: 0 or 1. When set to 0, the PayPal pages should not display the shipping address. When set to 1, the PayPal pages should display the shipping address.

->setAddressOverride(0);

Payment Web experience profile resource

$webProfile = new \PayPal\Api\WebProfile();

Name of the web experience profile. Required. Must be unique

$webProfile->setName("YeowZa! T-Shirt Shop" . uniqid())

Parameters for flow configuration.

->setFlowConfig($flowConfig)

Parameters for style and presentation.

->setPresentation($presentation)

Parameters for input field customization.

->setInputFields($inputFields);

For Sample Purposes Only.

$request = clone $webProfile; try {

Use this call to create a profile.

$createProfileResponse = $webProfile->create($apiContext); -} catch (\PayPal\Exception\PayPalConnectionException $ex) { - ResultPrinter::printError("Created Web Profile", "Web Profile", null, $request, $ex); +} 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); exit(1); -} - -ResultPrinter::printResult("Created Web Profile", "Web Profile", $createProfileResponse->getId(), $request, $createProfileResponse); +}

NOTE: PLEASE DO NOT USE RESULTPRINTER CLASS IN YOUR ORIGINAL CODE. FOR SAMPLE ONLY

ResultPrinter::printResult("Created Web Profile", "Web Profile", $createProfileResponse->getId(), $request, $createProfileResponse); return $createProfileResponse;
\ No newline at end of file diff --git a/sample/doc/payment-experience/DeleteWebProfile.html b/sample/doc/payment-experience/DeleteWebProfile.html index 9ab3e85..5ca4b5b 100644 --- a/sample/doc/payment-experience/DeleteWebProfile.html +++ b/sample/doc/payment-experience/DeleteWebProfile.html @@ -8,9 +8,6 @@ that contains the web profile ID.

$webProfile->setId($createProfileResponse->getId()); try {

Execute the delete method

$webProfile->delete($apiContext); -} catch (\PayPal\Exception\PayPalConnectionException $ex) { - ResultPrinter::printError("Deleted Web Profile", "Web Profile", $createProfileResponse->getId(), null, $ex); +} 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); exit(1); -} - -ResultPrinter::printResult("Deleted Web Profile", "Web Profile", $createProfileResponse->getId(), null, null);
\ No newline at end of file +}

NOTE: PLEASE DO NOT USE RESULTPRINTER CLASS IN YOUR ORIGINAL CODE. FOR SAMPLE ONLY

ResultPrinter::printResult("Deleted Web Profile", "Web Profile", $createProfileResponse->getId(), null, null);
\ No newline at end of file diff --git a/sample/doc/payment-experience/GetWebProfile.html b/sample/doc/payment-experience/GetWebProfile.html index f93b603..123797b 100644 --- a/sample/doc/payment-experience/GetWebProfile.html +++ b/sample/doc/payment-experience/GetWebProfile.html @@ -8,10 +8,12 @@ that contains the web profile ID.

try {

If your request is successful, the API returns a web_profile object response that contains the profile details.

$webProfile = \PayPal\Api\WebProfile::get($createProfileResponse->getId(), $apiContext); } catch (\PayPal\Exception\PayPalConnectionException $ex) { - ResultPrinter::printError("Get Web Profile", "Web Profile", $webProfile->getId(), null, $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); exit(1); } -ResultPrinter::printResult("Get Web Profile", "Web Profile", $webProfile->getId(), null, $webProfile); +// NOTE: PLEASE DO NOT USE RESULTPRINTER CLASS IN YOUR ORIGINAL CODE. FOR SAMPLE ONLY + ResultPrinter::printResult("Get Web Profile", "Web Profile", $webProfile->getId(), null, $webProfile); -return $webProfile;
\ No newline at end of file +return $webProfile; diff --git a/sample/doc/payment-experience/ListWebProfiles.html b/sample/doc/payment-experience/ListWebProfiles.html index 0607c20..e60753e 100644 --- a/sample/doc/payment-experience/ListWebProfiles.html +++ b/sample/doc/payment-experience/ListWebProfiles.html @@ -5,15 +5,12 @@ static get_list method on the WebProfile class. (See bootstrap.php for more on ApiContext)

try { $list = \PayPal\Api\WebProfile::get_list($apiContext); -} catch (\PayPal\Exception\PayPalConnectionException $ex) { - ResultPrinter::printError("Get List of All Web Profiles", "Web Profiles", null, null, $ex); +} 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); exit(1); } $result = ''; foreach ($list as $object) { $result .= $object->toJSON(128) . PHP_EOL; -} - -ResultPrinter::printResult("Get List of All Web Profiles", "Web Profiles", null, null, $result); +}

NOTE: PLEASE DO NOT USE RESULTPRINTER CLASS IN YOUR ORIGINAL CODE. FOR SAMPLE ONLY

ResultPrinter::printResult("Get List of All Web Profiles", "Web Profiles", null, null, $result); return $list;
\ No newline at end of file diff --git a/sample/doc/payment-experience/PartiallyUpdateWebProfile.html b/sample/doc/payment-experience/PartiallyUpdateWebProfile.html index 1c1ccb5..808bb61 100644 --- a/sample/doc/payment-experience/PartiallyUpdateWebProfile.html +++ b/sample/doc/payment-experience/PartiallyUpdateWebProfile.html @@ -17,9 +17,6 @@ as shown below

try {

Execute the partial update, to carry out these two operations on a given web profile object

if ($webProfile->partial_update($patches, $apiContext)) { $webProfile = \PayPal\Api\WebProfile::get($webProfile->getId(), $apiContext); } -} catch (\Exception $ex) { - ResultPrinter::printError("Partially Updated Web Profile", "Web Profile", $webProfile->getId(), $patches, $ex); +} 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); exit(1); -} - -ResultPrinter::printResult("Partially Updated Web Profile", "Web Profile", $webProfile->getId(), $patches, $webProfile);
\ No newline at end of file +}

NOTE: PLEASE DO NOT USE RESULTPRINTER CLASS IN YOUR ORIGINAL CODE. FOR SAMPLE ONLY

ResultPrinter::printResult("Partially Updated Web Profile", "Web Profile", $webProfile->getId(), $patches, $webProfile);
\ No newline at end of file diff --git a/sample/doc/payment-experience/UpdateWebProfile.html b/sample/doc/payment-experience/UpdateWebProfile.html index 7cd42b3..ad1ce9e 100644 --- a/sample/doc/payment-experience/UpdateWebProfile.html +++ b/sample/doc/payment-experience/UpdateWebProfile.html @@ -7,9 +7,6 @@ create a new web profileId for sample, and return the web profile object.

try {

Update the web profile to change the logo image.

if ($webProfile->update($apiContext)) {

If the update is successfull, we can now get the object, and verify the web profile object

$updatedWebProfile = \PayPal\Api\WebProfile::get($webProfile->getId(), $apiContext); } -} catch (\Exception $ex) { - ResultPrinter::printError("Updated Web Profile", "Web Profile", $webProfile->getId(), $webProfile, $ex); +} 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); exit(1); -} - -ResultPrinter::printResult("Updated Web Profile", "Web Profile", $updatedWebProfile->getId(), $webProfile, $updatedWebProfile);
\ No newline at end of file +}

NOTE: PLEASE DO NOT USE RESULTPRINTER CLASS IN YOUR ORIGINAL CODE. FOR SAMPLE ONLY

ResultPrinter::printResult("Updated Web Profile", "Web Profile", $updatedWebProfile->getId(), $webProfile, $updatedWebProfile);
\ No newline at end of file diff --git a/sample/doc/payments/AuthorizationCapture.html b/sample/doc/payments/AuthorizationCapture.html index b37203c..e924b14 100644 --- a/sample/doc/payments/AuthorizationCapture.html +++ b/sample/doc/payments/AuthorizationCapture.html @@ -19,11 +19,8 @@ with a valid ApiContext (See bootstrap.php for more on ApiContext)< ### Capture $capture = new Capture(); $capture->setAmount($amt);

Perform a capture

$getCapture = $authorization->capture($capture, $apiContext); -} catch (Exception $ex) { - ResultPrinter::printError("Capture Payment", "Authorization", null, $capture, $ex); +} 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); exit(1); -} - -ResultPrinter::printResult("Capture Payment", "Authorization", $getCapture->getId(), $capture, $getCapture); +}

NOTE: PLEASE DO NOT USE RESULTPRINTER CLASS IN YOUR ORIGINAL CODE. FOR SAMPLE ONLY

ResultPrinter::printResult("Capture Payment", "Authorization", $getCapture->getId(), $capture, $getCapture); return $getCapture;
\ No newline at end of file diff --git a/sample/doc/payments/AuthorizePayment.html b/sample/doc/payments/AuthorizePayment.html index 072252f..10f4a43 100644 --- a/sample/doc/payments/AuthorizePayment.html +++ b/sample/doc/payments/AuthorizePayment.html @@ -52,12 +52,9 @@ authorization. Setting it to sale creates actual payment

ApiContext) The return object contains the state.

try { $payment->create($apiContext); -} catch (Exception $ex) { - ResultPrinter::printError('Authorize a Payment', 'Authorized Payment', $payment->getId(), $request, $ex); +} 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); exit(1); -} - -ResultPrinter::printResult('Authorize a Payment', 'Authorized Payment', $payment->getId(), $request, $payment); +}

NOTE: PLEASE DO NOT USE RESULTPRINTER CLASS IN YOUR ORIGINAL CODE. FOR SAMPLE ONLY

ResultPrinter::printResult('Authorize a Payment', 'Authorized Payment', $payment->getId(), $request, $payment); $transactions = $payment->getTransactions(); $relatedResources = $transactions[0]->getRelatedResources(); diff --git a/sample/doc/payments/AuthorizePaymentUsingPayPal.html b/sample/doc/payments/AuthorizePaymentUsingPayPal.html index d4da445..79269a3 100644 --- a/sample/doc/payments/AuthorizePaymentUsingPayPal.html +++ b/sample/doc/payments/AuthorizePaymentUsingPayPal.html @@ -68,13 +68,15 @@ url to which the buyer must be redirected to for payment approval

try { $payment->create($apiContext); } catch (Exception $ex) { - ResultPrinter::printError("Created Payment Authorization Using PayPal. Please visit the URL to Authorize.", "Payment", null, $request, $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); exit(1); }

Get redirect url

The API response provides the url that you must redirect the buyer to. Retrieve the url from the $payment->getLinks() method

$approvalUrl = $payment->getApprovalLink(); -ResultPrinter::printResult("Created Payment Authorization Using PayPal. Please visit the URL to Authorize.", "Payment", "<a href='$approvalUrl' >$approvalUrl</a>", $request, $payment); +// NOTE: PLEASE DO NOT USE RESULTPRINTER CLASS IN YOUR ORIGINAL CODE. FOR SAMPLE ONLY + ResultPrinter::printResult("Created Payment Authorization Using PayPal. Please visit the URL to Authorize.", "Payment", "<a href='$approvalUrl' >$approvalUrl</a>", $request, $payment); -return $payment;
\ No newline at end of file +return $payment; diff --git a/sample/doc/payments/CreateFuturePayment.html b/sample/doc/payments/CreateFuturePayment.html index bb54d3f..14f6101 100644 --- a/sample/doc/payments/CreateFuturePayment.html +++ b/sample/doc/payments/CreateFuturePayment.html @@ -46,11 +46,8 @@ url to which the buyer must be redirected to for payment approval Please note that currently future payments works only with PayPal as a funding instrument.

$payment->create($apiContext, $clientMetadataId); -} catch (Exception $ex) { - ResultPrinter::printError("Future Payment", "Payment", null, $request, $ex); +} catch (Exception $ex) {

NOTE: PLEASE DO NOT USE RESULTPRINTER CLASS IN YOUR ORIGINAL CODE. FOR SAMPLE ONLY

ResultPrinter::printError("Future Payment", "Payment", null, $request, $ex); exit(1); -} - -ResultPrinter::printResult("Future Payment", "Payment", $payment->getId(), $request, $payment); +}

NOTE: PLEASE DO NOT USE RESULTPRINTER CLASS IN YOUR ORIGINAL CODE. FOR SAMPLE ONLY

ResultPrinter::printResult("Future Payment", "Payment", $payment->getId(), $request, $payment); return $payment;
\ No newline at end of file diff --git a/sample/doc/payments/CreatePayment.html b/sample/doc/payments/CreatePayment.html index 94acf28..4fdec3f 100644 --- a/sample/doc/payments/CreatePayment.html +++ b/sample/doc/payments/CreatePayment.html @@ -77,11 +77,8 @@ the above types and intent set to sale 'sale'

ApiContext) The return object contains the state.

try { $payment->create($apiContext); -} catch (Exception $ex) { - ResultPrinter::printError('Create Payment Using Credit Card. If 500 Exception, try creating a new Credit Card using <a href="https://ppmts.custhelp.com/app/answers/detail/a_id/750">Step 4, on this link</a>, and using it.', 'Payment', null, $request, $ex); +} 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 <a href="https://ppmts.custhelp.com/app/answers/detail/a_id/750">Step 4, on this link</a>, and using it.', 'Payment', null, $request, $ex); exit(1); -} - -ResultPrinter::printResult('Create Payment Using Credit Card', 'Payment', $payment->getId(), $request, $payment); +}

NOTE: PLEASE DO NOT USE RESULTPRINTER CLASS IN YOUR ORIGINAL CODE. FOR SAMPLE ONLY

ResultPrinter::printResult('Create Payment Using Credit Card', 'Payment', $payment->getId(), $request, $payment); return $payment;
\ No newline at end of file diff --git a/sample/doc/payments/CreatePaymentUsingPayPal.html b/sample/doc/payments/CreatePaymentUsingPayPal.html index cc2ff55..baa656b 100644 --- a/sample/doc/payments/CreatePaymentUsingPayPal.html +++ b/sample/doc/payments/CreatePaymentUsingPayPal.html @@ -65,14 +65,11 @@ The return object contains the state and the url to which the buyer must be redirected to for payment approval

try { $payment->create($apiContext); -} catch (Exception $ex) { - ResultPrinter::printError("Created Payment Using PayPal. Please visit the URL to Approve.", "Payment", null, $request, $ex); +} 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); exit(1); }

Get redirect url

The API response provides the url that you must redirect the buyer to. Retrieve the url from the $payment->getApprovalLink() -method

$approvalUrl = $payment->getApprovalLink(); - -ResultPrinter::printResult("Created Payment Using PayPal. Please visit the URL to Approve.", "Payment", "<a href='$approvalUrl' >$approvalUrl</a>", $request, $payment); +method

$approvalUrl = $payment->getApprovalLink();

NOTE: PLEASE DO NOT USE RESULTPRINTER CLASS IN YOUR ORIGINAL CODE. FOR SAMPLE ONLY

ResultPrinter::printResult("Created Payment Using PayPal. Please visit the URL to Approve.", "Payment", "<a href='$approvalUrl' >$approvalUrl</a>", $request, $payment); return $payment;
\ No newline at end of file diff --git a/sample/doc/payments/CreatePaymentUsingSavedCard.html b/sample/doc/payments/CreatePaymentUsingSavedCard.html index bdbfafa..aa54775 100644 --- a/sample/doc/payments/CreatePaymentUsingSavedCard.html +++ b/sample/doc/payments/CreatePaymentUsingSavedCard.html @@ -69,10 +69,12 @@ passing it a valid apiContext. The return object contains the state.

try { $payment->create($apiContext); } catch (Exception $ex) { - ResultPrinter::printError("Create Payment using Saved Card", "Payment", null, $request, $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); exit(1); } -ResultPrinter::printResult("Create Payment using Saved Card", "Payment", $payment->getId(), $request, $payment); +// NOTE: PLEASE DO NOT USE RESULTPRINTER CLASS IN YOUR ORIGINAL CODE. FOR SAMPLE ONLY + ResultPrinter::printResult("Create Payment using Saved Card", "Payment", $payment->getId(), $request, $payment); -return $card;
\ No newline at end of file +return $card; diff --git a/sample/doc/payments/ExecutePayment.html b/sample/doc/payments/ExecutePayment.html index 02df941..0a2907f 100644 --- a/sample/doc/payments/ExecutePayment.html +++ b/sample/doc/payments/ExecutePayment.html @@ -22,27 +22,20 @@ when the user is redirected from paypal back to your site

$execution->setPayerId($_GET['PayerID']); try {

Execute the payment -(See bootstrap.php for more on ApiContext)

$result = $payment->execute($execution, $apiContext); - - ResultPrinter::printResult("Executed Payment", "Payment", $payment->getId(), $execution, $result); +(See bootstrap.php for more on ApiContext)

$result = $payment->execute($execution, $apiContext);

NOTE: PLEASE DO NOT USE RESULTPRINTER CLASS IN YOUR ORIGINAL CODE. FOR SAMPLE ONLY

ResultPrinter::printResult("Executed Payment", "Payment", $payment->getId(), $execution, $result); try { $payment = Payment::get($paymentId, $apiContext); - } catch (Exception $ex) { - ResultPrinter::printError("Get Payment", "Payment", null, null, $ex); + } 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); exit(1); } - } catch (Exception $ex) { - ResultPrinter::printError("Executed Payment", "Payment", null, null, $ex); + } 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); exit(1); - } - - ResultPrinter::printResult("Get Payment", "Payment", $payment->getId(), null, $payment); + }

NOTE: PLEASE DO NOT USE RESULTPRINTER CLASS IN YOUR ORIGINAL CODE. FOR SAMPLE ONLY

ResultPrinter::printResult("Get Payment", "Payment", $payment->getId(), null, $payment); return $payment; -} else { - ResultPrinter::printResult("User Cancelled the Approval", null); +} else {

NOTE: PLEASE DO NOT USE RESULTPRINTER CLASS IN YOUR ORIGINAL CODE. FOR SAMPLE ONLY

ResultPrinter::printResult("User Cancelled the Approval", null); exit; }
\ No newline at end of file diff --git a/sample/doc/payments/GetAuthorization.html b/sample/doc/payments/GetAuthorization.html index 688727d..26897fb 100644 --- a/sample/doc/payments/GetAuthorization.html +++ b/sample/doc/payments/GetAuthorization.html @@ -10,11 +10,8 @@ API used: /v1/payments/authorization/<$authorizationId>

ApiContext) The return object contains the authorization state.

try {

Retrieve the authorization

$result = Authorization::get($authorizationId, $apiContext); -} catch (Exception $ex) { - ResultPrinter::printError("Get Authorization", "Authorization", null, null, $ex); +} 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); exit(1); -} - -ResultPrinter::printResult("Get Authorization", "Authorization", $authorizationId, null, $result); +}

NOTE: PLEASE DO NOT USE RESULTPRINTER CLASS IN YOUR ORIGINAL CODE. FOR SAMPLE ONLY

ResultPrinter::printResult("Get Authorization", "Authorization", $authorizationId, null, $result); return $result;
\ No newline at end of file diff --git a/sample/doc/payments/GetCapture.html b/sample/doc/payments/GetCapture.html index cb40818..bdfbc48 100644 --- a/sample/doc/payments/GetCapture.html +++ b/sample/doc/payments/GetCapture.html @@ -10,9 +10,6 @@ API used: /v1/payments/capture/<$captureId>

try { $capture = Capture::get($request->getId(), $apiContext); -} catch (Exception $ex) { - ResultPrinter::printError("Get Captured Payment", "Capture", $request->getId(), null, $ex); +} 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); exit(1); -} - -ResultPrinter::printResult("Get Captured Payment", "Capture", $capture->getId(), null, $capture);
\ No newline at end of file +}

NOTE: PLEASE DO NOT USE RESULTPRINTER CLASS IN YOUR ORIGINAL CODE. FOR SAMPLE ONLY

ResultPrinter::printResult("Get Captured Payment", "Capture", $capture->getId(), null, $capture);
\ No newline at end of file diff --git a/sample/doc/payments/GetPayment.html b/sample/doc/payments/GetPayment.html index faecd4e..4041c9a 100644 --- a/sample/doc/payments/GetPayment.html +++ b/sample/doc/payments/GetPayment.html @@ -17,10 +17,12 @@ Payment ID (See bootstrap.php for more on ApiContext)

try { $payment = Payment::get($paymentId, $apiContext); } catch (Exception $ex) { - ResultPrinter::printError("Get Payment", "Payment", null, null, $ex); + // NOTE: PLEASE DO NOT USE RESULTPRINTER CLASS IN YOUR ORIGINAL CODE. FOR SAMPLE ONLY + ResultPrinter::printError("Get Payment", "Payment", null, null, $ex); exit(1); } -ResultPrinter::printResult("Get Payment", "Payment", $payment->getId(), null, $payment); +// NOTE: PLEASE DO NOT USE RESULTPRINTER CLASS IN YOUR ORIGINAL CODE. FOR SAMPLE ONLY + ResultPrinter::printResult("Get Payment", "Payment", $payment->getId(), null, $payment); -return $payment;
\ No newline at end of file +return $payment; diff --git a/sample/doc/payments/ListPayments.html b/sample/doc/payments/ListPayments.html index 0bc2677..ca0514a 100644 --- a/sample/doc/payments/ListPayments.html +++ b/sample/doc/payments/ListPayments.html @@ -17,9 +17,6 @@ Refer the method doc for valid values for keys $params = array('count' => 10, 'start_index' => 5); $payments = Payment::all($params, $apiContext); -} catch (Exception $ex) { - ResultPrinter::printError("List Payments", "Payment", null, $params, $ex); +} 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); exit(1); -} - -ResultPrinter::printResult("List Payments", "Payment", null, $params, $payments);
\ No newline at end of file +}

NOTE: PLEASE DO NOT USE RESULTPRINTER CLASS IN YOUR ORIGINAL CODE. FOR SAMPLE ONLY

ResultPrinter::printResult("List Payments", "Payment", null, $params, $payments);
\ No newline at end of file diff --git a/sample/doc/payments/OrderAuthorize.html b/sample/doc/payments/OrderAuthorize.html index a057bea..2e0fb32 100644 --- a/sample/doc/payments/OrderAuthorize.html +++ b/sample/doc/payments/OrderAuthorize.html @@ -22,16 +22,13 @@ API used: POST /v1/payments/orders//authorize

try {

Authorize Order

Authorize the order by passing authorization object we created. -We will get a new authorization object back.

$result = $order->authorize($authorization, $apiContext); - ResultPrinter::printResult("Authorized Order", "Authorization", $result->getId(), $authorization, $result); - } catch (Exception $ex) { - ResultPrinter::printError("Authorized Order", "Authorization", null, $authorization, $ex); +We will get a new authorization object back.

$result = $order->authorize($authorization, $apiContext);

NOTE: PLEASE DO NOT USE RESULTPRINTER CLASS IN YOUR ORIGINAL CODE. FOR SAMPLE ONLY

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); exit(1); } return $result; -} else { - ResultPrinter::printResult("User Cancelled the Approval", null); +} else {

NOTE: PLEASE DO NOT USE RESULTPRINTER CLASS IN YOUR ORIGINAL CODE. FOR SAMPLE ONLY

ResultPrinter::printResult("User Cancelled the Approval", null); exit; }
\ No newline at end of file diff --git a/sample/doc/payments/OrderCapture.html b/sample/doc/payments/OrderCapture.html index 39f35a3..ee92bd0 100644 --- a/sample/doc/payments/OrderCapture.html +++ b/sample/doc/payments/OrderCapture.html @@ -22,16 +22,13 @@ API used: POST /v1/payments/orders//authorize

try {

Capture Order

Capture the order by passing capture object we created. -We will get a new capture object back.

$result = $order->capture($capture, $apiContext); - ResultPrinter::printResult("Captured Order", "Capture", $result->getId(), $capture, $result); - } catch (Exception $ex) { - ResultPrinter::printError("Captured Order", "Capture", null, $capture, $ex); +We will get a new capture object back.

$result = $order->capture($capture, $apiContext);

NOTE: PLEASE DO NOT USE RESULTPRINTER CLASS IN YOUR ORIGINAL CODE. FOR SAMPLE ONLY

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); exit(1); } return $result; -} else { - ResultPrinter::printResult("User Cancelled the Approval", null); +} else {

NOTE: PLEASE DO NOT USE RESULTPRINTER CLASS IN YOUR ORIGINAL CODE. FOR SAMPLE ONLY

ResultPrinter::printResult("User Cancelled the Approval", null); exit; }
\ No newline at end of file diff --git a/sample/doc/payments/OrderCreateForAuthorization.html b/sample/doc/payments/OrderCreateForAuthorization.html index 81809fd..47aa964 100644 --- a/sample/doc/payments/OrderCreateForAuthorization.html +++ b/sample/doc/payments/OrderCreateForAuthorization.html @@ -65,13 +65,15 @@ url to which the buyer must be redirected to for payment approval

try { $payment->create($apiContext); } catch (Exception $ex) { - ResultPrinter::printError("Created Payment Order Using PayPal. Please visit the URL to Approve.", "Payment", null, $request, $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); exit(1); }

Get redirect url

The API response provides the url that you must redirect the buyer to. Retrieve the url from the $payment->getApprovalLink() method

$approvalUrl = $payment->getApprovalLink(); -ResultPrinter::printResult("Created Payment Order Using PayPal. Please visit the URL to Approve.", "Payment", "<a href='$approvalUrl' >$approvalUrl</a>", $request, $payment); +// NOTE: PLEASE DO NOT USE RESULTPRINTER CLASS IN YOUR ORIGINAL CODE. FOR SAMPLE ONLY + ResultPrinter::printResult("Created Payment Order Using PayPal. Please visit the URL to Approve.", "Payment", "<a href='$approvalUrl' >$approvalUrl</a>", $request, $payment); -return $payment;
\ No newline at end of file +return $payment; diff --git a/sample/doc/payments/OrderCreateForCapture.html b/sample/doc/payments/OrderCreateForCapture.html index 7ae56f2..e9e54a9 100644 --- a/sample/doc/payments/OrderCreateForCapture.html +++ b/sample/doc/payments/OrderCreateForCapture.html @@ -65,13 +65,15 @@ url to which the buyer must be redirected to for payment approval

try { $payment->create($apiContext); } catch (Exception $ex) { - ResultPrinter::printError("Created Payment Order Using PayPal. Please visit the URL to Approve.", "Payment", null, $request, $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); exit(1); }

Get redirect url

The API response provides the url that you must redirect the buyer to. Retrieve the url from the $payment->getApprovalLink() method

$approvalUrl = $payment->getApprovalLink(); -ResultPrinter::printResult("Created Payment Order Using PayPal. Please visit the URL to Approve.", "Payment", "<a href='$approvalUrl' >$approvalUrl</a>", $request, $payment); +// NOTE: PLEASE DO NOT USE RESULTPRINTER CLASS IN YOUR ORIGINAL CODE. FOR SAMPLE ONLY + ResultPrinter::printResult("Created Payment Order Using PayPal. Please visit the URL to Approve.", "Payment", "<a href='$approvalUrl' >$approvalUrl</a>", $request, $payment); -return $payment;
\ No newline at end of file +return $payment; diff --git a/sample/doc/payments/OrderCreateForVoid.html b/sample/doc/payments/OrderCreateForVoid.html index e4f341c..e877d97 100644 --- a/sample/doc/payments/OrderCreateForVoid.html +++ b/sample/doc/payments/OrderCreateForVoid.html @@ -64,14 +64,11 @@ The return object contains the state and the url to which the buyer must be redirected to for payment approval

try { $payment->create($apiContext); -} catch (Exception $ex) { - ResultPrinter::printError("Created Payment Order Using PayPal. Please visit the URL to Approve.", "Payment", null, $request, $ex); +} 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); exit(1); }

Get redirect url

The API response provides the url that you must redirect the buyer to. Retrieve the url from the $payment->getApprovalLink() -method

$approvalUrl = $payment->getApprovalLink(); - -ResultPrinter::printResult("Created Payment Order Using PayPal. Please visit the URL to Approve.", "Payment", "<a href='$approvalUrl' >$approvalUrl</a>", $request, $payment); +method

$approvalUrl = $payment->getApprovalLink();

NOTE: PLEASE DO NOT USE RESULTPRINTER CLASS IN YOUR ORIGINAL CODE. FOR SAMPLE ONLY

ResultPrinter::printResult("Created Payment Order Using PayPal. Please visit the URL to Approve.", "Payment", "<a href='$approvalUrl' >$approvalUrl</a>", $request, $payment); return $payment;
\ No newline at end of file diff --git a/sample/doc/payments/OrderCreateUsingPayPal.html b/sample/doc/payments/OrderCreateUsingPayPal.html index 2ae7ada..49090fc 100644 --- a/sample/doc/payments/OrderCreateUsingPayPal.html +++ b/sample/doc/payments/OrderCreateUsingPayPal.html @@ -65,13 +65,15 @@ url to which the buyer must be redirected to for payment approval

try { $payment->create($apiContext); } catch (Exception $ex) { - ResultPrinter::printError("Created Payment Order Using PayPal. Please visit the URL to Approve.", "Payment", null, $request, $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); exit(1); }

Get redirect url

The API response provides the url that you must redirect the buyer to. Retrieve the url from the $payment->getApprovalLink() method

$approvalUrl = $payment->getApprovalLink(); -ResultPrinter::printResult("Created Payment Order Using PayPal. Please visit the URL to Approve.", "Payment", "<a href='$approvalUrl' >$approvalUrl</a>", $request, $payment); +// NOTE: PLEASE DO NOT USE RESULTPRINTER CLASS IN YOUR ORIGINAL CODE. FOR SAMPLE ONLY + ResultPrinter::printResult("Created Payment Order Using PayPal. Please visit the URL to Approve.", "Payment", "<a href='$approvalUrl' >$approvalUrl</a>", $request, $payment); -return $payment;
\ No newline at end of file +return $payment; diff --git a/sample/doc/payments/OrderDoVoid.html b/sample/doc/payments/OrderDoVoid.html index 31877de..0f131db 100644 --- a/sample/doc/payments/OrderDoVoid.html +++ b/sample/doc/payments/OrderDoVoid.html @@ -14,16 +14,13 @@ API used: POST /v1/payments/orders//do-void

$order = $relatedResource->getOrder(); try {

Void Order

-

Call void method on order object. You will get an Order Object back

$result = $order->void($apiContext); - ResultPrinter::printResult("Voided Order", "Order", $result->getId(), null, $result); - } catch (Exception $ex) { - ResultPrinter::printError("Voided Order", "Order", null, null, $ex); +

Call void method on order object. You will get an Order Object back

$result = $order->void($apiContext);

NOTE: PLEASE DO NOT USE RESULTPRINTER CLASS IN YOUR ORIGINAL CODE. FOR SAMPLE ONLY

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); exit(1); } return $result; -} else { - ResultPrinter::printResult("User Cancelled the Approval", null); +} else {

NOTE: PLEASE DO NOT USE RESULTPRINTER CLASS IN YOUR ORIGINAL CODE. FOR SAMPLE ONLY

ResultPrinter::printResult("User Cancelled the Approval", null); exit; }
\ No newline at end of file diff --git a/sample/doc/payments/OrderGet.html b/sample/doc/payments/OrderGet.html index f5bb705..d7a8bbc 100644 --- a/sample/doc/payments/OrderGet.html +++ b/sample/doc/payments/OrderGet.html @@ -11,16 +11,13 @@ API used: GET /v1/payments/orders/

$order = $relatedResource->getOrder(); try { - $result = \PayPal\Api\Order::get($order->getId(), $apiContext); - ResultPrinter::printResult("Get Order", "Order", $result->getId(), null, $result); - } catch (Exception $ex) { - ResultPrinter::printError("Get Order", "Order", null, null, $ex); + $result = \PayPal\Api\Order::get($order->getId(), $apiContext);

NOTE: PLEASE DO NOT USE RESULTPRINTER CLASS IN YOUR ORIGINAL CODE. FOR SAMPLE ONLY

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); exit(1); } return $result; -} else { - ResultPrinter::printResult("User Cancelled the Approval", null); +} else {

NOTE: PLEASE DO NOT USE RESULTPRINTER CLASS IN YOUR ORIGINAL CODE. FOR SAMPLE ONLY

ResultPrinter::printResult("User Cancelled the Approval", null); exit; }
\ No newline at end of file diff --git a/sample/doc/payments/Reauthorization.html b/sample/doc/payments/Reauthorization.html index cf8472d..d865fdc 100644 --- a/sample/doc/payments/Reauthorization.html +++ b/sample/doc/payments/Reauthorization.html @@ -15,9 +15,6 @@ has expired.

$amount->setTotal(1);

Reauthorize with amount being reauthorized

$authorization->setAmount($amount); $reAuthorization = $authorization->reauthorize($apiContext); -} catch (Exception $ex) { - ResultPrinter::printError("Reauthorize Payment", "Payment", null, null, $ex); +} 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); exit(1); -} - -ResultPrinter::printResult("Reauthorize Payment", "Payment", $authorization->getId(), null, $reAuthorization);
\ No newline at end of file +}

NOTE: PLEASE DO NOT USE RESULTPRINTER CLASS IN YOUR ORIGINAL CODE. FOR SAMPLE ONLY

ResultPrinter::printResult("Reauthorize Payment", "Payment", $authorization->getId(), null, $reAuthorization);
\ No newline at end of file diff --git a/sample/doc/payments/RefundCapture.html b/sample/doc/payments/RefundCapture.html index b115eb5..7f138fa 100644 --- a/sample/doc/payments/RefundCapture.html +++ b/sample/doc/payments/RefundCapture.html @@ -16,9 +16,6 @@ refund amount and call the refund method

$apiContext = getApiContext($clientId, $clientSecret); $captureRefund = $capture->refund($refund, $apiContext); -} catch (Exception $ex) { - ResultPrinter::printError("Refund Capture", "Capture", null, $refund, $ex); +} 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); exit(1); -} - -ResultPrinter::printResult("Refund Capture", "Capture", $captureRefund->getId(), $refund, $captureRefund);
\ No newline at end of file +}

NOTE: PLEASE DO NOT USE RESULTPRINTER CLASS IN YOUR ORIGINAL CODE. FOR SAMPLE ONLY

ResultPrinter::printResult("Refund Capture", "Capture", $captureRefund->getId(), $refund, $captureRefund);
\ No newline at end of file diff --git a/sample/doc/payments/UpdatePayment.html b/sample/doc/payments/UpdatePayment.html index f40569f..3894b4f 100644 --- a/sample/doc/payments/UpdatePayment.html +++ b/sample/doc/payments/UpdatePayment.html @@ -72,14 +72,10 @@ Payment ID (See bootstrap.php for more on ApiContext)

try { $result = $createdPayment->update($patchRequest, $apiContext); -} catch (Exception $ex) { - ResultPrinter::printError("Update Payment", "PatchRequest", null, $patchRequest, $ex); +} 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); exit(1); -} - -ResultPrinter::printResult("Update Payment", "PatchRequest", $payment->getId(), $patchRequest, null);

Getting Updated Payment Object

if ($result == true) { - $result = Payment::get($createdPayment->getId(), $apiContext); - ResultPrinter::printResult("Get Payment", "Payment", $result->getId(), null, $result);

Get redirect url

+}

NOTE: PLEASE DO NOT USE RESULTPRINTER CLASS IN YOUR ORIGINAL CODE. FOR SAMPLE ONLY

ResultPrinter::printResult("Update Payment", "PatchRequest", $payment->getId(), $patchRequest, null);

Getting Updated Payment Object

if ($result == true) { + $result = Payment::get($createdPayment->getId(), $apiContext);

NOTE: PLEASE DO NOT USE RESULTPRINTER CLASS IN YOUR ORIGINAL CODE. FOR SAMPLE ONLY

ResultPrinter::printResult("Get Payment", "Payment", $result->getId(), null, $result);

Get redirect url

The API response provides the url that you must redirect the buyer to. Retrieve the url from the $payment->getLinks() method

foreach ($result->getLinks() as $link) { @@ -87,9 +83,7 @@ method

$approvalUrl = $link->getHref(); break; } -} - -ResultPrinter::printResult("Created Payment Using PayPal. Please visit the URL to Approve.", "Payment", "<a href='$approvalUrl' >$approvalUrl</a>", $request, $result); +}

NOTE: PLEASE DO NOT USE RESULTPRINTER CLASS IN YOUR ORIGINAL CODE. FOR SAMPLE ONLY

ResultPrinter::printResult("Created Payment Using PayPal. Please visit the URL to Approve.", "Payment", "<a href='$approvalUrl' >$approvalUrl</a>", $request, $result); } return $result;
\ No newline at end of file diff --git a/sample/doc/payments/VoidAuthorization.html b/sample/doc/payments/VoidAuthorization.html index 219f453..df946cb 100644 --- a/sample/doc/payments/VoidAuthorization.html +++ b/sample/doc/payments/VoidAuthorization.html @@ -7,11 +7,8 @@ API used: /v1/payments/authorization/<{authorizationid}>/void"

You can void a previously authorized payment by invoking the $authorization->void method with a valid ApiContext (See bootstrap.php for more on ApiContext)

try {

Lookup the authorization

$authorization = Authorization::get($authorizationId, $apiContext);

Void the authorization

$voidedAuth = $authorization->void($apiContext); -} catch (Exception $ex) { - ResultPrinter::printError("Void Authorization", "Authorization", null, null, $ex); +} 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); exit(1); -} - -ResultPrinter::printResult("Void Authorization", "Authorization", $voidedAuth->getId(), null, $voidedAuth); +}

NOTE: PLEASE DO NOT USE RESULTPRINTER CLASS IN YOUR ORIGINAL CODE. FOR SAMPLE ONLY

ResultPrinter::printResult("Void Authorization", "Authorization", $voidedAuth->getId(), null, $voidedAuth); return $voidedAuth;
\ No newline at end of file diff --git a/sample/doc/payouts/CancelPayoutItem.html b/sample/doc/payouts/CancelPayoutItem.html index a91545f..99c588a 100644 --- a/sample/doc/payouts/CancelPayoutItem.html +++ b/sample/doc/payouts/CancelPayoutItem.html @@ -9,12 +9,11 @@ API used: POST /v1/payments/payouts-item//cancel

$output = null;

Cancel Payout Item

Check if Payout Item is UNCLAIMED, and if so, cancel it.

try { - if ($payoutItem->getTransactionStatus() == 'UNCLAIMED') {

Cancel the Payout Item

$output = \PayPal\Api\PayoutItem::cancel($payoutItemId, $apiContext); - ResultPrinter::printResult("Cancel Unclaimed Payout Item", "PayoutItem", $output->getPayoutItemId(), null, $output); - } else {

The item transaction status is not unclaimed. You can only cancel an unclaimed transaction.

ResultPrinter::printError("Cancel Unclaimed Payout Item", "PayoutItem", null, $payoutItemId, new Exception("Payout Item Status is not UNCLAIMED")); + if ($payoutItem->getTransactionStatus() == 'UNCLAIMED') {

Cancel the Payout Item

$output = \PayPal\Api\PayoutItem::cancel($payoutItemId, $apiContext);

NOTE: PLEASE DO NOT USE RESULTPRINTER CLASS IN YOUR ORIGINAL CODE. FOR SAMPLE ONLY

ResultPrinter::printResult("Cancel Unclaimed Payout Item", "PayoutItem", $output->getPayoutItemId(), null, $output); + } 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")); } -} catch (Exception $ex) { - ResultPrinter::printError("Cancel Unclaimed Payout Item", "PayoutItem", null, $payoutItemId, $ex); +} 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); exit(1); } diff --git a/sample/doc/payouts/CreateBatchPayout.html b/sample/doc/payouts/CreateBatchPayout.html index 0762272..863cb91 100644 --- a/sample/doc/payouts/CreateBatchPayout.html +++ b/sample/doc/payouts/CreateBatchPayout.html @@ -83,11 +83,8 @@ API used: /v1/payments/payouts

$payouts->setSenderBatchHeader($senderBatchHeader) ->addItem($senderItem1)->addItem($senderItem2)->addItem($senderItem3);

For Sample Purposes Only.

$request = clone $payouts;

Create Payout

try { $output = $payouts->create(null, $apiContext); -} catch (Exception $ex) { - ResultPrinter::printError("Created Batch Payout", "Payout", null, $request, $ex); +} 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); exit(1); -} - -ResultPrinter::printResult("Created Batch Payout", "Payout", $output->getBatchHeader()->getPayoutBatchId(), $request, $output); +}

NOTE: PLEASE DO NOT USE RESULTPRINTER CLASS IN YOUR ORIGINAL CODE. FOR SAMPLE ONLY

ResultPrinter::printResult("Created Batch Payout", "Payout", $output->getBatchHeader()->getPayoutBatchId(), $request, $output); return $output;
\ No newline at end of file diff --git a/sample/doc/payouts/CreateSinglePayout.html b/sample/doc/payouts/CreateSinglePayout.html index 90764ae..3dac425 100644 --- a/sample/doc/payouts/CreateSinglePayout.html +++ b/sample/doc/payouts/CreateSinglePayout.html @@ -38,11 +38,8 @@ API used: /v1/payments/payouts?sync_mode=true

< $payouts->setSenderBatchHeader($senderBatchHeader) ->addItem($senderItem);

For Sample Purposes Only.

$request = clone $payouts;

Create Payout

try { $output = $payouts->createSynchronous($apiContext); -} catch (Exception $ex) { - ResultPrinter::printError("Created Single Synchronous Payout", "Payout", null, $request, $ex); +} 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); exit(1); -} - -ResultPrinter::printResult("Created Single Synchronous Payout", "Payout", $output->getBatchHeader()->getPayoutBatchId(), $request, $output); +}

NOTE: PLEASE DO NOT USE RESULTPRINTER CLASS IN YOUR ORIGINAL CODE. FOR SAMPLE ONLY

ResultPrinter::printResult("Created Single Synchronous Payout", "Payout", $output->getBatchHeader()->getPayoutBatchId(), $request, $output); return $output;
\ No newline at end of file diff --git a/sample/doc/payouts/GetPayoutBatchStatus.html b/sample/doc/payouts/GetPayoutBatchStatus.html index 570477e..5215381 100644 --- a/sample/doc/payouts/GetPayoutBatchStatus.html +++ b/sample/doc/payouts/GetPayoutBatchStatus.html @@ -5,11 +5,8 @@ API used: GET /v1/payments/payouts/

$payoutBatch = require 'CreateBatchPayout.php';

Payout Batch ID

You can replace this with your Payout Batch Id on already created Payout.

$payoutBatchId = $payoutBatch->getBatchHeader()->getPayoutBatchId();

Get Payout Batch Status

try { $output = \PayPal\Api\Payout::get($payoutBatchId, $apiContext); -} catch (Exception $ex) { - ResultPrinter::printError("Get Payout Batch Status", "PayoutBatch", null, $payoutBatchId, $ex); +} 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); exit(1); -} - -ResultPrinter::printResult("Get Payout Batch Status", "PayoutBatch", $output->getBatchHeader()->getPayoutBatchId(), null, $output); +}

NOTE: PLEASE DO NOT USE RESULTPRINTER CLASS IN YOUR ORIGINAL CODE. FOR SAMPLE ONLY

ResultPrinter::printResult("Get Payout Batch Status", "PayoutBatch", $output->getBatchHeader()->getPayoutBatchId(), null, $output); return $output;
\ No newline at end of file diff --git a/sample/doc/payouts/GetPayoutItemStatus.html b/sample/doc/payouts/GetPayoutItemStatus.html index 9c3ff3d..dc79dab 100644 --- a/sample/doc/payouts/GetPayoutItemStatus.html +++ b/sample/doc/payouts/GetPayoutItemStatus.html @@ -7,11 +7,8 @@ API used: GET /v1/payments/payouts-item/

$payoutItem = $payoutItems[0]; $payoutItemId = $payoutItem->getPayoutItemId();

Get Payout Item Status

try { $output = \PayPal\Api\PayoutItem::get($payoutItemId, $apiContext); -} catch (Exception $ex) { - ResultPrinter::printError("Get Payout Item Status", "PayoutItem", null, $payoutItemId, $ex); +} 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); exit(1); -} - -ResultPrinter::printResult("Get Payout Item Status", "PayoutItem", $output->getPayoutItemId(), null, $output); +}

NOTE: PLEASE DO NOT USE RESULTPRINTER CLASS IN YOUR ORIGINAL CODE. FOR SAMPLE ONLY

ResultPrinter::printResult("Get Payout Item Status", "PayoutItem", $output->getPayoutItemId(), null, $output); return $output;
\ No newline at end of file diff --git a/sample/doc/sale/GetSale.html b/sample/doc/sale/GetSale.html index 36a3de7..c2c694e 100644 --- a/sample/doc/sale/GetSale.html +++ b/sample/doc/sale/GetSale.html @@ -15,10 +15,12 @@ API used: /v1/payments/sale/{sale-id}

Pass the ID of the sale transaction from your payment resource.

$sale = Sale::get($saleId, $apiContext); } catch (Exception $ex) { - ResultPrinter::printError("Look Up A Sale", "Sale", $sale->getId(), null, $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); exit(1); } -ResultPrinter::printResult("Look Up A Sale", "Sale", $sale->getId(), null, $sale); +// NOTE: PLEASE DO NOT USE RESULTPRINTER CLASS IN YOUR ORIGINAL CODE. FOR SAMPLE ONLY + ResultPrinter::printResult("Look Up A Sale", "Sale", $sale->getId(), null, $sale); -return $sale;
\ No newline at end of file +return $sale; diff --git a/sample/doc/sale/RefundSale.html b/sample/doc/sale/RefundSale.html index 064329b..7afd2e0 100644 --- a/sample/doc/sale/RefundSale.html +++ b/sample/doc/sale/RefundSale.html @@ -22,11 +22,8 @@ given sale transaction id.

try {

Create a new apiContext object so we send a new PayPal-Request-Id (idempotency) header for this resource

$apiContext = getApiContext($clientId, $clientSecret);

Refund the sale (See bootstrap.php for more on ApiContext)

$refundedSale = $sale->refund($refund, $apiContext); -} catch (Exception $ex) { - ResultPrinter::printError("Refund Sale", "Sale", $refundedSale->getId(), $refund, $ex); +} 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); exit(1); -} - -ResultPrinter::printResult("Refund Sale", "Sale", $refundedSale->getId(), $refund, $refundedSale); +}

NOTE: PLEASE DO NOT USE RESULTPRINTER CLASS IN YOUR ORIGINAL CODE. FOR SAMPLE ONLY

ResultPrinter::printResult("Refund Sale", "Sale", $refundedSale->getId(), $refund, $refundedSale); return $refundedSale;
\ No newline at end of file diff --git a/sample/doc/vault/CreateBankAccount.html b/sample/doc/vault/CreateBankAccount.html index 5c929b2..cff0a65 100644 --- a/sample/doc/vault/CreateBankAccount.html +++ b/sample/doc/vault/CreateBankAccount.html @@ -58,11 +58,8 @@ an 'id' that you can use to refer to it in future payments. (See bootstrap.php for more on ApiContext)

try { $bankAccount->create($apiContext); -} catch (Exception $ex) { - ResultPrinter::printError("Create Bank Account", "Bank Account", null, $request, $ex); +} 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); exit(1); -} - -ResultPrinter::printResult("Create Bank Account", "Bank Account", $bankAccount->getId(), $request, $bankAccount); +}

NOTE: PLEASE DO NOT USE RESULTPRINTER CLASS IN YOUR ORIGINAL CODE. FOR SAMPLE ONLY

ResultPrinter::printResult("Create Bank Account", "Bank Account", $bankAccount->getId(), $request, $bankAccount); return $bankAccount;
\ No newline at end of file diff --git a/sample/doc/vault/CreateCreditCard.html b/sample/doc/vault/CreateCreditCard.html index 0872052..20fb69b 100644 --- a/sample/doc/vault/CreateCreditCard.html +++ b/sample/doc/vault/CreateCreditCard.html @@ -19,11 +19,8 @@ an 'id' that you can use to refer to it in future payments. (See bootstrap.php for more on ApiContext)

try { $card->create($apiContext); -} catch (Exception $ex) { - ResultPrinter::printError("Create Credit Card", "Credit Card", null, $request, $ex); +} 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); exit(1); -} - -ResultPrinter::printResult("Create Credit Card", "Credit Card", $card->getId(), $request, $card); +}

NOTE: PLEASE DO NOT USE RESULTPRINTER CLASS IN YOUR ORIGINAL CODE. FOR SAMPLE ONLY

ResultPrinter::printResult("Create Credit Card", "Credit Card", $card->getId(), $request, $card); return $card;
\ No newline at end of file diff --git a/sample/doc/vault/DeleteBankAccount.html b/sample/doc/vault/DeleteBankAccount.html index e069afd..4986c8f 100644 --- a/sample/doc/vault/DeleteBankAccount.html +++ b/sample/doc/vault/DeleteBankAccount.html @@ -8,9 +8,6 @@ NOTE: HTTP method used here is DELETE

try {

Delete Card

Lookup and delete a saved credit card. (See bootstrap.php for more on ApiContext)

$bankAccount->delete($apiContext); -} catch (Exception $ex) { - ResultPrinter::printError("Delete Bank Account", "Bank Account", null, null, $ex); +} 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); exit(1); -} - -ResultPrinter::printResult("Delete Bank Account", "Bank Account", $bankAccount->getId(), null, null);
\ No newline at end of file +}

NOTE: PLEASE DO NOT USE RESULTPRINTER CLASS IN YOUR ORIGINAL CODE. FOR SAMPLE ONLY

ResultPrinter::printResult("Delete Bank Account", "Bank Account", $bankAccount->getId(), null, null);
\ No newline at end of file diff --git a/sample/doc/vault/DeleteCreditCard.html b/sample/doc/vault/DeleteCreditCard.html index 7539a14..4bf1cf4 100644 --- a/sample/doc/vault/DeleteCreditCard.html +++ b/sample/doc/vault/DeleteCreditCard.html @@ -9,9 +9,6 @@ NOTE: HTTP method used here is DELETE

try {

Delete Card

Lookup and delete a saved credit card. (See bootstrap.php for more on ApiContext)

$card->delete($apiContext); -} catch (Exception $ex) { - ResultPrinter::printError("Delete Credit Card", "Credit Card", null, null, $ex); +} 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); exit(1); -} - -ResultPrinter::printResult("Delete Credit Card", "Credit Card", $card->getId(), null, null);
\ No newline at end of file +}

NOTE: PLEASE DO NOT USE RESULTPRINTER CLASS IN YOUR ORIGINAL CODE. FOR SAMPLE ONLY

ResultPrinter::printResult("Delete Credit Card", "Credit Card", $card->getId(), null, null);
\ No newline at end of file diff --git a/sample/doc/vault/GetBankAccount.html b/sample/doc/vault/GetBankAccount.html index d9aef94..dac25dd 100644 --- a/sample/doc/vault/GetBankAccount.html +++ b/sample/doc/vault/GetBankAccount.html @@ -7,11 +7,8 @@ the process of retrieving a saved Bank Account

/// ### Retrieve Bank Account

(See bootstrap.php for more on ApiContext)

try { $bankAccount = \PayPal\Api\BankAccount::get($bankAccount->getId(), $apiContext); -} catch (Exception $ex) { - ResultPrinter::printError("Get Bank Account", "Bank Account", $bankAccount->getId(), null, $ex); +} 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); exit(1); -} - -ResultPrinter::printResult("Get Bank Account", "Bank Account", $bankAccount->getId(), null, $bankAccount); +}

NOTE: PLEASE DO NOT USE RESULTPRINTER CLASS IN YOUR ORIGINAL CODE. FOR SAMPLE ONLY

ResultPrinter::printResult("Get Bank Account", "Bank Account", $bankAccount->getId(), null, $bankAccount); return $bankAccount;
\ No newline at end of file diff --git a/sample/doc/vault/GetCreditCard.html b/sample/doc/vault/GetCreditCard.html index 105f134..dd1a1cb 100644 --- a/sample/doc/vault/GetCreditCard.html +++ b/sample/doc/vault/GetCreditCard.html @@ -11,11 +11,8 @@ the process of retrieving a saved CreditCard

/// ### Retrieve card

(See bootstrap.php for more on ApiContext)

try { $card = CreditCard::get($card->getId(), $apiContext); -} catch (Exception $ex) { - ResultPrinter::printError("Get Credit Card", "Credit Card", $card->getId(), null, $ex); +} 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); exit(1); -} - -ResultPrinter::printResult("Get Credit Card", "Credit Card", $card->getId(), null, $card); +}

NOTE: PLEASE DO NOT USE RESULTPRINTER CLASS IN YOUR ORIGINAL CODE. FOR SAMPLE ONLY

ResultPrinter::printResult("Get Credit Card", "Credit Card", $card->getId(), null, $card); return $card;
\ No newline at end of file diff --git a/sample/doc/vault/UpdateCreditCard.html b/sample/doc/vault/UpdateCreditCard.html index c69323a..00e17ac 100644 --- a/sample/doc/vault/UpdateCreditCard.html +++ b/sample/doc/vault/UpdateCreditCard.html @@ -29,11 +29,8 @@ the process of updating a saved CreditCard

$pathOperation2); /// ### Update Credit Card

(See bootstrap.php for more on ApiContext)

try { $card = $card->update($pathRequest, $apiContext); -} catch (Exception $ex) { - ResultPrinter::printError("Updated Credit Card", "Credit Card", $card->getId(), $pathRequest, $ex); +} 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); exit(1); -} - -ResultPrinter::printResult("Updated Credit Card", "Credit Card", $card->getId(), $pathRequest, $card); +}

NOTE: PLEASE DO NOT USE RESULTPRINTER CLASS IN YOUR ORIGINAL CODE. FOR SAMPLE ONLY

ResultPrinter::printResult("Updated Credit Card", "Credit Card", $card->getId(), $pathRequest, $card); return $card;
\ No newline at end of file diff --git a/sample/invoice/CancelInvoice.php b/sample/invoice/CancelInvoice.php index 23543f2..366c528 100644 --- a/sample/invoice/CancelInvoice.php +++ b/sample/invoice/CancelInvoice.php @@ -32,8 +32,10 @@ try { // (See bootstrap.php for more on `ApiContext`) $cancelStatus = $invoice->cancel($notify, $apiContext); } catch (Exception $ex) { - ResultPrinter::printError("Cancel Invoice", "Invoice", null, $notify, $ex); + // NOTE: PLEASE DO NOT USE RESULTPRINTER CLASS IN YOUR ORIGINAL CODE. FOR SAMPLE ONLY + ResultPrinter::printError("Cancel Invoice", "Invoice", null, $notify, $ex); exit(1); } -ResultPrinter::printResult("Cancel Invoice", "Invoice", $invoice->getId(), $notify, null); +// NOTE: PLEASE DO NOT USE RESULTPRINTER CLASS IN YOUR ORIGINAL CODE. FOR SAMPLE ONLY + ResultPrinter::printResult("Cancel Invoice", "Invoice", $invoice->getId(), $notify, null); diff --git a/sample/invoice/CreateInvoice.php b/sample/invoice/CreateInvoice.php index fdb4678..3deba88 100644 --- a/sample/invoice/CreateInvoice.php +++ b/sample/invoice/CreateInvoice.php @@ -143,10 +143,12 @@ try { // with a valid ApiContext (See bootstrap.php for more on `ApiContext`) $invoice->create($apiContext); } catch (Exception $ex) { - ResultPrinter::printError("Create Invoice", "Invoice", null, $request, $ex); + // NOTE: PLEASE DO NOT USE RESULTPRINTER CLASS IN YOUR ORIGINAL CODE. FOR SAMPLE ONLY + ResultPrinter::printError("Create Invoice", "Invoice", null, $request, $ex); exit(1); } -ResultPrinter::printResult("Create Invoice", "Invoice", $invoice->getId(), $request, $invoice); +// NOTE: PLEASE DO NOT USE RESULTPRINTER CLASS IN YOUR ORIGINAL CODE. FOR SAMPLE ONLY + ResultPrinter::printResult("Create Invoice", "Invoice", $invoice->getId(), $request, $invoice); return $invoice; diff --git a/sample/invoice/DeleteInvoice.php b/sample/invoice/DeleteInvoice.php index 2c5a392..6063d64 100644 --- a/sample/invoice/DeleteInvoice.php +++ b/sample/invoice/DeleteInvoice.php @@ -20,8 +20,10 @@ try { // (See bootstrap.php for more on `ApiContext`) $deleteStatus = $invoice->delete($apiContext); } catch (Exception $ex) { - ResultPrinter::printError("Delete Invoice", "Invoice", null, $deleteStatus, $ex); + // NOTE: PLEASE DO NOT USE RESULTPRINTER CLASS IN YOUR ORIGINAL CODE. FOR SAMPLE ONLY + ResultPrinter::printError("Delete Invoice", "Invoice", null, $deleteStatus, $ex); exit(1); } -ResultPrinter::printResult("Delete Invoice", "Invoice", $invoice->getId(), null, null); +// NOTE: PLEASE DO NOT USE RESULTPRINTER CLASS IN YOUR ORIGINAL CODE. FOR SAMPLE ONLY + ResultPrinter::printResult("Delete Invoice", "Invoice", $invoice->getId(), null, null); diff --git a/sample/invoice/GetInvoice.php b/sample/invoice/GetInvoice.php index 6395087..d256048 100644 --- a/sample/invoice/GetInvoice.php +++ b/sample/invoice/GetInvoice.php @@ -19,10 +19,12 @@ $invoiceId = $invoice->getId(); try { $invoice = Invoice::get($invoiceId, $apiContext); } catch (Exception $ex) { - ResultPrinter::printError("Get Invoice", "Invoice", $invoice->getId(), $invoiceId, $ex); + // NOTE: PLEASE DO NOT USE RESULTPRINTER CLASS IN YOUR ORIGINAL CODE. FOR SAMPLE ONLY + ResultPrinter::printError("Get Invoice", "Invoice", $invoice->getId(), $invoiceId, $ex); exit(1); } -ResultPrinter::printResult("Get Invoice", "Invoice", $invoice->getId(), $invoiceId, $invoice); +// NOTE: PLEASE DO NOT USE RESULTPRINTER CLASS IN YOUR ORIGINAL CODE. FOR SAMPLE ONLY + ResultPrinter::printResult("Get Invoice", "Invoice", $invoice->getId(), $invoiceId, $invoice); return $invoice; diff --git a/sample/invoice/ListInvoice.php b/sample/invoice/ListInvoice.php index d3f338b..99a3cc0 100644 --- a/sample/invoice/ListInvoice.php +++ b/sample/invoice/ListInvoice.php @@ -16,7 +16,9 @@ try { // (See bootstrap.php for more on `ApiContext`) $invoices = Invoice::getAll(array('page' => 0, 'page_size' => 4, 'total_count_required' => "true"), $apiContext); } catch (Exception $ex) { - ResultPrinter::printError("Lookup Invoice History", "Invoice", null, null, $ex); + // NOTE: PLEASE DO NOT USE RESULTPRINTER CLASS IN YOUR ORIGINAL CODE. FOR SAMPLE ONLY + ResultPrinter::printError("Lookup Invoice History", "Invoice", null, null, $ex); exit(1); } -ResultPrinter::printResult("Lookup Invoice History", "Invoice", null, null, $invoices); +// NOTE: PLEASE DO NOT USE RESULTPRINTER CLASS IN YOUR ORIGINAL CODE. FOR SAMPLE ONLY + ResultPrinter::printResult("Lookup Invoice History", "Invoice", null, null, $invoices); diff --git a/sample/invoice/RecordPayment.php b/sample/invoice/RecordPayment.php index fed036a..b413b37 100644 --- a/sample/invoice/RecordPayment.php +++ b/sample/invoice/RecordPayment.php @@ -30,11 +30,13 @@ try { // (See bootstrap.php for more on `ApiContext`) $recordStatus = $invoice->recordPayment($record, $apiContext); } catch (Exception $ex) { - ResultPrinter::printError("Payment for Invoice", "Invoice", null, null, $ex); + // NOTE: PLEASE DO NOT USE RESULTPRINTER CLASS IN YOUR ORIGINAL CODE. FOR SAMPLE ONLY + ResultPrinter::printError("Payment for Invoice", "Invoice", null, null, $ex); exit(1); } -ResultPrinter::printResult("Payment for Invoice", "Invoice", $invoice->getId(), $record, null); +// NOTE: PLEASE DO NOT USE RESULTPRINTER CLASS IN YOUR ORIGINAL CODE. FOR SAMPLE ONLY + ResultPrinter::printResult("Payment for Invoice", "Invoice", $invoice->getId(), $record, null); // ### Retrieve Invoice // Retrieve the invoice object by calling the @@ -45,10 +47,12 @@ ResultPrinter::printResult("Payment for Invoice", "Invoice", $invoice->getId(), try { $invoice = Invoice::get($invoice->getId(), $apiContext); } catch (Exception $ex) { - ResultPrinter::printError("Get Invoice (Not Required - For Sample Only)", "Invoice", $invoice->getId(), $invoice->getId(), $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); exit(1); } -ResultPrinter::printResult("Get Invoice (Not Required - For Sample Only)", "Invoice", $invoice->getId(), $invoice->getId(), $invoice); +// NOTE: PLEASE DO NOT USE RESULTPRINTER CLASS IN YOUR ORIGINAL CODE. FOR SAMPLE ONLY + ResultPrinter::printResult("Get Invoice (Not Required - For Sample Only)", "Invoice", $invoice->getId(), $invoice->getId(), $invoice); return $invoice; diff --git a/sample/invoice/RecordRefund.php b/sample/invoice/RecordRefund.php index b9d803b..12144fe 100644 --- a/sample/invoice/RecordRefund.php +++ b/sample/invoice/RecordRefund.php @@ -29,11 +29,13 @@ try { // (See bootstrap.php for more on `ApiContext`) $refundStatus = $invoice->recordRefund($refund, $apiContext); } catch (Exception $ex) { - ResultPrinter::printError("Refund for Invoice", "Invoice", null, null, $ex); + // NOTE: PLEASE DO NOT USE RESULTPRINTER CLASS IN YOUR ORIGINAL CODE. FOR SAMPLE ONLY + ResultPrinter::printError("Refund for Invoice", "Invoice", null, null, $ex); exit(1); } -ResultPrinter::printResult("Refund for Invoice", "Invoice", $invoice->getId(), $refund, null); +// NOTE: PLEASE DO NOT USE RESULTPRINTER CLASS IN YOUR ORIGINAL CODE. FOR SAMPLE ONLY + ResultPrinter::printResult("Refund for Invoice", "Invoice", $invoice->getId(), $refund, null); // ### Retrieve Invoice // Retrieve the invoice object by calling the @@ -44,10 +46,12 @@ ResultPrinter::printResult("Refund for Invoice", "Invoice", $invoice->getId(), $ try { $invoice = Invoice::get($invoice->getId(), $apiContext); } catch (Exception $ex) { - ResultPrinter::printError("Get Invoice (Not Required - For Sample Only)", "Invoice", $invoice->getId(), $invoice->getId(), $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); exit(1); } -ResultPrinter::printResult("Get Invoice (Not Required - For Sample Only)", "Invoice", $invoice->getId(), $invoice->getId(), $invoice); +// NOTE: PLEASE DO NOT USE RESULTPRINTER CLASS IN YOUR ORIGINAL CODE. FOR SAMPLE ONLY + ResultPrinter::printResult("Get Invoice (Not Required - For Sample Only)", "Invoice", $invoice->getId(), $invoice->getId(), $invoice); return $invoice; diff --git a/sample/invoice/RemindInvoice.php b/sample/invoice/RemindInvoice.php index 1881724..dc8ab16 100644 --- a/sample/invoice/RemindInvoice.php +++ b/sample/invoice/RemindInvoice.php @@ -30,11 +30,13 @@ try { // (See bootstrap.php for more on `ApiContext`) $remindStatus = $invoice->remind($notify, $apiContext); } catch (Exception $ex) { - ResultPrinter::printError("Remind Invoice", "Invoice", null, $notify, $ex); + // NOTE: PLEASE DO NOT USE RESULTPRINTER CLASS IN YOUR ORIGINAL CODE. FOR SAMPLE ONLY + ResultPrinter::printError("Remind Invoice", "Invoice", null, $notify, $ex); exit(1); } -ResultPrinter::printResult("Remind Invoice", "Invoice", null, $notify, null); +// NOTE: PLEASE DO NOT USE RESULTPRINTER CLASS IN YOUR ORIGINAL CODE. FOR SAMPLE ONLY + ResultPrinter::printResult("Remind Invoice", "Invoice", null, $notify, null); // ### Retrieve Invoice // Retrieve the invoice object by calling the @@ -45,10 +47,12 @@ ResultPrinter::printResult("Remind Invoice", "Invoice", null, $notify, null); try { $invoice = Invoice::get($invoice->getId(), $apiContext); } catch (Exception $ex) { - ResultPrinter::printError("Get Invoice (Not Required - For Sample Only)", "Invoice", $invoice->getId(), $invoice->getId(), $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); exit(1); } -ResultPrinter::printResult("Get Invoice (Not Required - For Sample Only)", "Invoice", $invoice->getId(), $invoice->getId(), $invoice); +// NOTE: PLEASE DO NOT USE RESULTPRINTER CLASS IN YOUR ORIGINAL CODE. FOR SAMPLE ONLY + ResultPrinter::printResult("Get Invoice (Not Required - For Sample Only)", "Invoice", $invoice->getId(), $invoice->getId(), $invoice); return $invoice; diff --git a/sample/invoice/RetrieveQRCode.php b/sample/invoice/RetrieveQRCode.php index e1bd78b..d6081f3 100644 --- a/sample/invoice/RetrieveQRCode.php +++ b/sample/invoice/RetrieveQRCode.php @@ -27,11 +27,13 @@ try { } catch (Exception $ex) { - ResultPrinter::printError("Retrieved QR Code for Invoice", "Invoice", $invoice->getId(), null, $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); exit(1); } -ResultPrinter::printResult("Retrieved QR Code for Invoice", "Invoice", $invoice->getId(), null, $image); +// NOTE: PLEASE DO NOT USE RESULTPRINTER CLASS IN YOUR ORIGINAL CODE. FOR SAMPLE ONLY + ResultPrinter::printResult("Retrieved QR Code for Invoice", "Invoice", $invoice->getId(), null, $image); // ### Show the Image // In PHP, there are many ways to present an images. diff --git a/sample/invoice/SearchInvoices.php b/sample/invoice/SearchInvoices.php index 155e048..b94a3a8 100644 --- a/sample/invoice/SearchInvoices.php +++ b/sample/invoice/SearchInvoices.php @@ -30,7 +30,9 @@ try { // (See bootstrap.php for more on `ApiContext`) $invoices = Invoice::search($search, $apiContext); } catch (Exception $ex) { - ResultPrinter::printError("Search Invoice", "Invoice", null, null, $ex); + // NOTE: PLEASE DO NOT USE RESULTPRINTER CLASS IN YOUR ORIGINAL CODE. FOR SAMPLE ONLY + ResultPrinter::printError("Search Invoice", "Invoice", null, null, $ex); exit(1); } -ResultPrinter::printResult("Search Invoice", "Invoice", null, $search, $invoices); +// NOTE: PLEASE DO NOT USE RESULTPRINTER CLASS IN YOUR ORIGINAL CODE. FOR SAMPLE ONLY + ResultPrinter::printResult("Search Invoice", "Invoice", null, $search, $invoices); diff --git a/sample/invoice/SendInvoice.php b/sample/invoice/SendInvoice.php index ac9abd5..01ca388 100644 --- a/sample/invoice/SendInvoice.php +++ b/sample/invoice/SendInvoice.php @@ -16,11 +16,13 @@ try { // with a valid ApiContext (See bootstrap.php for more on `ApiContext`) $sendStatus = $invoice->send($apiContext); } catch (Exception $ex) { - ResultPrinter::printResult("Send Invoice", "Invoice", null, null, $ex); + // NOTE: PLEASE DO NOT USE RESULTPRINTER CLASS IN YOUR ORIGINAL CODE. FOR SAMPLE ONLY + ResultPrinter::printError("Send Invoice", "Invoice", null, null, $ex); exit(1); } -ResultPrinter::printResult("Send Invoice", "Invoice", $invoice->getId(), null, null); +// NOTE: PLEASE DO NOT USE RESULTPRINTER CLASS IN YOUR ORIGINAL CODE. FOR SAMPLE ONLY + ResultPrinter::printResult("Send Invoice", "Invoice", $invoice->getId(), null, null); // ### Retrieve Invoice // Retrieve the invoice object by calling the @@ -31,10 +33,12 @@ ResultPrinter::printResult("Send Invoice", "Invoice", $invoice->getId(), null, n try { $invoice = Invoice::get($invoice->getId(), $apiContext); } catch (Exception $ex) { - ResultPrinter::printError("Get Invoice (Not Required - For Sample Only)", "Invoice", $invoice->getId(), $invoice->getId(), $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); exit(1); } -ResultPrinter::printResult("Get Invoice (Not Required - For Sample Only)", "Invoice", $invoice->getId(), $invoice->getId(), $invoice); +// NOTE: PLEASE DO NOT USE RESULTPRINTER CLASS IN YOUR ORIGINAL CODE. FOR SAMPLE ONLY + ResultPrinter::printResult("Get Invoice (Not Required - For Sample Only)", "Invoice", $invoice->getId(), $invoice->getId(), $invoice); return $invoice; diff --git a/sample/invoice/UpdateInvoice.php b/sample/invoice/UpdateInvoice.php index 1668f8f..57ca622 100644 --- a/sample/invoice/UpdateInvoice.php +++ b/sample/invoice/UpdateInvoice.php @@ -29,11 +29,13 @@ try { // with a valid ApiContext (See bootstrap.php for more on `ApiContext`) $invoice->update($apiContext); } catch (Exception $ex) { - ResultPrinter::printError("Invoice Updated", "Invoice", null, $request, $ex); + // NOTE: PLEASE DO NOT USE RESULTPRINTER CLASS IN YOUR ORIGINAL CODE. FOR SAMPLE ONLY + ResultPrinter::printError("Invoice Updated", "Invoice", null, $request, $ex); exit(1); } -ResultPrinter::printResult("Invoice Updated", "Invoice", $invoice->getId(), $request, $invoice); +// NOTE: PLEASE DO NOT USE RESULTPRINTER CLASS IN YOUR ORIGINAL CODE. FOR SAMPLE ONLY + ResultPrinter::printResult("Invoice Updated", "Invoice", $invoice->getId(), $request, $invoice); // ### Retrieve Invoice // Retrieve the invoice object by calling the @@ -44,10 +46,12 @@ ResultPrinter::printResult("Invoice Updated", "Invoice", $invoice->getId(), $req try { $invoice = Invoice::get($invoice->getId(), $apiContext); } catch (Exception $ex) { - ResultPrinter::printError("Get Invoice (Not Required - For Sample Only)", "Invoice", $invoice->getId(), $invoice->getId(), $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); exit(1); } -ResultPrinter::printResult("Get Invoice (Not Required - For Sample Only)", "Invoice", $invoice->getId(), $invoice->getId(), $invoice); +// NOTE: PLEASE DO NOT USE RESULTPRINTER CLASS IN YOUR ORIGINAL CODE. FOR SAMPLE ONLY + ResultPrinter::printResult("Get Invoice (Not Required - For Sample Only)", "Invoice", $invoice->getId(), $invoice->getId(), $invoice); return $invoice; diff --git a/sample/lipp/GenerateAccessTokenFromRefreshToken.php b/sample/lipp/GenerateAccessTokenFromRefreshToken.php index 2ee0100..ff90540 100644 --- a/sample/lipp/GenerateAccessTokenFromRefreshToken.php +++ b/sample/lipp/GenerateAccessTokenFromRefreshToken.php @@ -14,8 +14,10 @@ try { $tokenInfo = $tokenInfo->createFromRefreshToken(array('refresh_token' => $refreshToken), $apiContext); } catch (Exception $ex) { - ResultPrinter::printError("Obtained Access Token From Refresh Token", "Access Token", null, null, $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); exit(1); } -ResultPrinter::printResult("Obtained Access Token From Refresh Token", "Access Token", $tokenInfo->getAccessToken(), null, $tokenInfo); +// NOTE: PLEASE DO NOT USE RESULTPRINTER CLASS IN YOUR ORIGINAL CODE. FOR SAMPLE ONLY + ResultPrinter::printResult("Obtained Access Token From Refresh Token", "Access Token", $tokenInfo->getAccessToken(), null, $tokenInfo); diff --git a/sample/lipp/GetUserInfo.php b/sample/lipp/GetUserInfo.php index 0aebb8a..3bdae6c 100644 --- a/sample/lipp/GetUserInfo.php +++ b/sample/lipp/GetUserInfo.php @@ -29,8 +29,10 @@ try { $userInfo = OpenIdUserinfo::getUserinfo($params, $apiContext); } catch (Exception $ex) { - ResultPrinter::printError("User Information", "User Info", null, $params, $ex); + // NOTE: PLEASE DO NOT USE RESULTPRINTER CLASS IN YOUR ORIGINAL CODE. FOR SAMPLE ONLY + ResultPrinter::printError("User Information", "User Info", null, $params, $ex); exit(1); } -ResultPrinter::printResult("User Information", "User Info", $userInfo->getUserId(), $params, $userInfo); +// NOTE: PLEASE DO NOT USE RESULTPRINTER CLASS IN YOUR ORIGINAL CODE. FOR SAMPLE ONLY + ResultPrinter::printResult("User Information", "User Info", $userInfo->getUserId(), $params, $userInfo); diff --git a/sample/lipp/ObtainUserConsent.php b/sample/lipp/ObtainUserConsent.php index 4397552..d7c97f5 100644 --- a/sample/lipp/ObtainUserConsent.php +++ b/sample/lipp/ObtainUserConsent.php @@ -20,4 +20,5 @@ $redirectUrl = OpenIdSession::getAuthorizationUrl( $apiContext ); -ResultPrinter::printResult("Generated the User Consent URL", "URL", '
Click Here to Obtain User Consent', $baseUrl, $redirectUrl); +// NOTE: PLEASE DO NOT USE RESULTPRINTER CLASS IN YOUR ORIGINAL CODE. FOR SAMPLE ONLY + ResultPrinter::printResult("Generated the User Consent URL", "URL", 'Click Here to Obtain User Consent', $baseUrl, $redirectUrl); diff --git a/sample/lipp/UserConsentRedirect.php b/sample/lipp/UserConsentRedirect.php index c97768f..6ac77e7 100644 --- a/sample/lipp/UserConsentRedirect.php +++ b/sample/lipp/UserConsentRedirect.php @@ -18,10 +18,12 @@ if (isset($_GET['success']) && $_GET['success'] == 'true') { // Obtain Authorization Code from Code, Client ID and Client Secret $accessToken = OpenIdTokeninfo::createFromAuthorizationCode(array('code' => $code), null, null, $apiContext); } catch (PayPalConnectionException $ex) { - ResultPrinter::printError("Obtained Access Token", "Access Token", null, $_GET['code'], $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); exit(1); } - ResultPrinter::printResult("Obtained Access Token", "Access Token", $accessToken->getAccessToken(), $_GET['code'], $accessToken); + // 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 b747e20..7606b52 100644 --- a/sample/notifications/CreateWebhook.php +++ b/sample/notifications/CreateWebhook.php @@ -56,26 +56,31 @@ try { // ^ Ignore workflow code segment if ($ex instanceof \PayPal\Exception\PayPalConnectionException) { $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) { require 'DeleteAllWebhooks.php'; try { $output = $webhook->create($apiContext); } catch (Exception $ex) { + // NOTE: PLEASE DO NOT USE RESULTPRINTER CLASS IN YOUR ORIGINAL CODE. FOR SAMPLE ONLY ResultPrinter::printError("Created Webhook", "Webhook", null, $request, $ex); exit(1); } } else { - ResultPrinter::printError("Created Webhook", "Webhook", null, $request, $ex); + // NOTE: PLEASE DO NOT USE RESULTPRINTER CLASS IN YOUR ORIGINAL CODE. FOR SAMPLE ONLY + ResultPrinter::printError("Created Webhook", "Webhook", null, $request, $ex); exit(1); } } else { + // NOTE: PLEASE DO NOT USE RESULTPRINTER CLASS IN YOUR ORIGINAL CODE. FOR SAMPLE ONLY ResultPrinter::printError("Created Webhook", "Webhook", null, $request, $ex); exit(1); } // Print Success Result } -ResultPrinter::printResult("Created Webhook", "Webhook", $output->getId(), $request, $output); +// NOTE: PLEASE DO NOT USE RESULTPRINTER CLASS IN YOUR ORIGINAL CODE. FOR SAMPLE ONLY + ResultPrinter::printResult("Created Webhook", "Webhook", $output->getId(), $request, $output); return $output; diff --git a/sample/notifications/DeleteAllWebhooks.php b/sample/notifications/DeleteAllWebhooks.php index ce4435e..746a7b0 100644 --- a/sample/notifications/DeleteAllWebhooks.php +++ b/sample/notifications/DeleteAllWebhooks.php @@ -15,10 +15,12 @@ try { $webhook->delete($apiContext); } } catch (Exception $ex) { - ResultPrinter::printError("Deleted all Webhooks", "WebhookList", null, null, $ex); + // NOTE: PLEASE DO NOT USE RESULTPRINTER CLASS IN YOUR ORIGINAL CODE. FOR SAMPLE ONLY + ResultPrinter::printError("Deleted all Webhooks", "WebhookList", null, null, $ex); exit(1); } -ResultPrinter::printResult("Delete all Webhook, as it may have exceed the maximum count.", "WebhookList", null, null, null); +// NOTE: PLEASE DO NOT USE RESULTPRINTER CLASS IN YOUR ORIGINAL CODE. FOR SAMPLE ONLY + ResultPrinter::printResult("Delete all Webhook, as it may have exceed the maximum count.", "WebhookList", null, null, null); return $output; diff --git a/sample/notifications/DeleteWebhook.php b/sample/notifications/DeleteWebhook.php index f70f654..c1c70bc 100644 --- a/sample/notifications/DeleteWebhook.php +++ b/sample/notifications/DeleteWebhook.php @@ -16,10 +16,12 @@ $webhook = require 'CreateWebhook.php'; try { $output = $webhook->delete($apiContext); } catch (Exception $ex) { - ResultPrinter::printError("Delete a Webhook", "Webhook", null, $webhookId, $ex); + // NOTE: PLEASE DO NOT USE RESULTPRINTER CLASS IN YOUR ORIGINAL CODE. FOR SAMPLE ONLY + ResultPrinter::printError("Delete a Webhook", "Webhook", null, $webhookId, $ex); exit(1); } -ResultPrinter::printResult("Delete a Webhook", "Webhook", $webhook->getId(), null, null); +// NOTE: PLEASE DO NOT USE RESULTPRINTER CLASS IN YOUR ORIGINAL CODE. FOR SAMPLE ONLY + ResultPrinter::printResult("Delete a Webhook", "Webhook", $webhook->getId(), null, null); return $output; diff --git a/sample/notifications/GetWebhook.php b/sample/notifications/GetWebhook.php index 5a6063d..3ec7a7f 100644 --- a/sample/notifications/GetWebhook.php +++ b/sample/notifications/GetWebhook.php @@ -17,10 +17,12 @@ $webhookId = $webhook->getId(); try { $output = \PayPal\Api\Webhook::get($webhookId, $apiContext); } catch (Exception $ex) { - ResultPrinter::printError("Get a Webhook", "Webhook", null, $webhookId, $ex); + // NOTE: PLEASE DO NOT USE RESULTPRINTER CLASS IN YOUR ORIGINAL CODE. FOR SAMPLE ONLY + ResultPrinter::printError("Get a Webhook", "Webhook", null, $webhookId, $ex); exit(1); } -ResultPrinter::printResult("Get a Webhook", "Webhook", $output->getId(), null, $output); +// NOTE: PLEASE DO NOT USE RESULTPRINTER CLASS IN YOUR ORIGINAL CODE. FOR SAMPLE ONLY + ResultPrinter::printResult("Get a Webhook", "Webhook", $output->getId(), null, $output); return $output; diff --git a/sample/notifications/ListSubscribedWebhookEventTypes.php b/sample/notifications/ListSubscribedWebhookEventTypes.php index a831dbb..186d23b 100644 --- a/sample/notifications/ListSubscribedWebhookEventTypes.php +++ b/sample/notifications/ListSubscribedWebhookEventTypes.php @@ -17,10 +17,12 @@ $webhookId = $webhook->getId(); try { $output = \PayPal\Api\WebhookEventType::subscribedEventTypes($webhookId, $apiContext); } catch (Exception $ex) { - ResultPrinter::printError("List subscribed webhook event types", "WebhookEventTypeList", null, $webhookId, $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); exit(1); } -ResultPrinter::printResult("List subscribed webhook event types", "WebhookEventTypeList",null, null, $output); +// 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); return $output; diff --git a/sample/notifications/ListWebhooks.php b/sample/notifications/ListWebhooks.php index 1317567..05c1dbf 100644 --- a/sample/notifications/ListWebhooks.php +++ b/sample/notifications/ListWebhooks.php @@ -18,10 +18,12 @@ $webhook = require_once __DIR__ . '/../bootstrap.php'; try { $output = \PayPal\Api\Webhook::getAll($apiContext); } catch (Exception $ex) { - ResultPrinter::printError("List all webhooks", "WebhookList", null, $webhookId, $ex); + // NOTE: PLEASE DO NOT USE RESULTPRINTER CLASS IN YOUR ORIGINAL CODE. FOR SAMPLE ONLY + ResultPrinter::printError("List all webhooks", "WebhookList", null, $webhookId, $ex); exit(1); } -ResultPrinter::printResult("List all webhooks", "WebhookList",null, null, $output); +// NOTE: PLEASE DO NOT USE RESULTPRINTER CLASS IN YOUR ORIGINAL CODE. FOR SAMPLE ONLY + ResultPrinter::printResult("List all webhooks", "WebhookList",null, null, $output); return $output; diff --git a/sample/notifications/SearchWebhookEvents.php b/sample/notifications/SearchWebhookEvents.php index 444949b..2548abe 100644 --- a/sample/notifications/SearchWebhookEvents.php +++ b/sample/notifications/SearchWebhookEvents.php @@ -23,11 +23,13 @@ $params = array( try { $output = \PayPal\Api\WebhookEvent::all($params, $apiContext); } catch (Exception $ex) { - ResultPrinter::printError("Search Webhook events", "WebhookEventList", null, null, $ex); + // NOTE: PLEASE DO NOT USE RESULTPRINTER CLASS IN YOUR ORIGINAL CODE. FOR SAMPLE ONLY + ResultPrinter::printError("Search Webhook events", "WebhookEventList", null, null, $ex); exit(1); } -ResultPrinter::printResult("Search Webhook events", "WebhookEventList", null, $params, $output); +// NOTE: PLEASE DO NOT USE RESULTPRINTER CLASS IN YOUR ORIGINAL CODE. FOR SAMPLE ONLY + ResultPrinter::printResult("Search Webhook events", "WebhookEventList", null, $params, $output); return $output; diff --git a/sample/notifications/UpdateWebhook.php b/sample/notifications/UpdateWebhook.php index b506e55..043733b 100644 --- a/sample/notifications/UpdateWebhook.php +++ b/sample/notifications/UpdateWebhook.php @@ -46,10 +46,12 @@ $patchRequest->addPatch($patch)->addPatch($patch2); try { $output = $webhook->update($patchRequest, $apiContext); } catch (Exception $ex) { - ResultPrinter::printError("Updated a Webhook", "Webhook", null, $patchRequest, $ex); + // NOTE: PLEASE DO NOT USE RESULTPRINTER CLASS IN YOUR ORIGINAL CODE. FOR SAMPLE ONLY + ResultPrinter::printError("Updated a Webhook", "Webhook", null, $patchRequest, $ex); exit(1); } -ResultPrinter::printResult("Updated a Webhook", "Webhook", $output->getId(), $patchRequest, $output); +// NOTE: PLEASE DO NOT USE RESULTPRINTER CLASS IN YOUR ORIGINAL CODE. FOR SAMPLE ONLY + ResultPrinter::printResult("Updated a Webhook", "Webhook", $output->getId(), $patchRequest, $output); return $output; diff --git a/sample/notifications/WebhookEventTypesList.php b/sample/notifications/WebhookEventTypesList.php index c7fdf39..f19d591 100644 --- a/sample/notifications/WebhookEventTypesList.php +++ b/sample/notifications/WebhookEventTypesList.php @@ -12,10 +12,12 @@ $apiContext = require __DIR__ . '/../bootstrap.php'; try { $output = \PayPal\Api\WebhookEventType::availableEventTypes($apiContext); } catch (Exception $ex) { - ResultPrinter::printError("Get List of All Webhook Event Types", "WebhookEventTypeList", null, null, $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); exit(1); } -ResultPrinter::printResult("Get List of All Webhook Event Types", "WebhookEventTypeList", null, null, $output); +// NOTE: PLEASE DO NOT USE RESULTPRINTER CLASS IN YOUR ORIGINAL CODE. FOR SAMPLE ONLY + ResultPrinter::printResult("Get List of All Webhook Event Types", "WebhookEventTypeList", null, null, $output); return $output; diff --git a/sample/payment-experience/CreateWebProfile.php b/sample/payment-experience/CreateWebProfile.php index 1b89adf..cac85c8 100644 --- a/sample/payment-experience/CreateWebProfile.php +++ b/sample/payment-experience/CreateWebProfile.php @@ -52,10 +52,12 @@ try { // Use this call to create a profile. $createProfileResponse = $webProfile->create($apiContext); } catch (\PayPal\Exception\PayPalConnectionException $ex) { - ResultPrinter::printError("Created Web Profile", "Web Profile", null, $request, $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); exit(1); } -ResultPrinter::printResult("Created Web Profile", "Web Profile", $createProfileResponse->getId(), $request, $createProfileResponse); +// NOTE: PLEASE DO NOT USE RESULTPRINTER CLASS IN YOUR ORIGINAL CODE. FOR SAMPLE ONLY + ResultPrinter::printResult("Created Web Profile", "Web Profile", $createProfileResponse->getId(), $request, $createProfileResponse); return $createProfileResponse; diff --git a/sample/payment-experience/DeleteWebProfile.php b/sample/payment-experience/DeleteWebProfile.php index 37b6a9e..9cf0c1f 100644 --- a/sample/payment-experience/DeleteWebProfile.php +++ b/sample/payment-experience/DeleteWebProfile.php @@ -19,8 +19,10 @@ try { // Execute the delete method $webProfile->delete($apiContext); } catch (\PayPal\Exception\PayPalConnectionException $ex) { - ResultPrinter::printError("Deleted Web Profile", "Web Profile", $createProfileResponse->getId(), null, $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); exit(1); } -ResultPrinter::printResult("Deleted Web Profile", "Web Profile", $createProfileResponse->getId(), null, null); +// NOTE: PLEASE DO NOT USE RESULTPRINTER CLASS IN YOUR ORIGINAL CODE. FOR SAMPLE ONLY + ResultPrinter::printResult("Deleted Web Profile", "Web Profile", $createProfileResponse->getId(), null, null); diff --git a/sample/payment-experience/GetWebProfile.php b/sample/payment-experience/GetWebProfile.php index 4e1db6c..09bcc93 100644 --- a/sample/payment-experience/GetWebProfile.php +++ b/sample/payment-experience/GetWebProfile.php @@ -15,10 +15,12 @@ try { // If your request is successful, the API returns a web_profile object response that contains the profile details. $webProfile = \PayPal\Api\WebProfile::get($createProfileResponse->getId(), $apiContext); } catch (\PayPal\Exception\PayPalConnectionException $ex) { - ResultPrinter::printError("Get Web Profile", "Web Profile", $webProfile->getId(), null, $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); exit(1); } -ResultPrinter::printResult("Get Web Profile", "Web Profile", $webProfile->getId(), null, $webProfile); +// NOTE: PLEASE DO NOT USE RESULTPRINTER CLASS IN YOUR ORIGINAL CODE. FOR SAMPLE ONLY + ResultPrinter::printResult("Get Web Profile", "Web Profile", $webProfile->getId(), null, $webProfile); return $webProfile; diff --git a/sample/payment-experience/ListWebProfiles.php b/sample/payment-experience/ListWebProfiles.php index 5f84198..57762c7 100644 --- a/sample/payment-experience/ListWebProfiles.php +++ b/sample/payment-experience/ListWebProfiles.php @@ -11,7 +11,8 @@ $apiContext = require __DIR__ . '/../bootstrap.php'; try { $list = \PayPal\Api\WebProfile::get_list($apiContext); } catch (\PayPal\Exception\PayPalConnectionException $ex) { - ResultPrinter::printError("Get List of All Web Profiles", "Web Profiles", null, null, $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); exit(1); } $result = ''; @@ -19,6 +20,7 @@ foreach ($list as $object) { $result .= $object->toJSON(128) . PHP_EOL; } -ResultPrinter::printResult("Get List of All Web Profiles", "Web Profiles", null, null, $result); +// NOTE: PLEASE DO NOT USE RESULTPRINTER CLASS IN YOUR ORIGINAL CODE. FOR SAMPLE ONLY + ResultPrinter::printResult("Get List of All Web Profiles", "Web Profiles", null, null, $result); return $list; diff --git a/sample/payment-experience/PartiallyUpdateWebProfile.php b/sample/payment-experience/PartiallyUpdateWebProfile.php index 88f4f4b..79b25f8 100644 --- a/sample/payment-experience/PartiallyUpdateWebProfile.php +++ b/sample/payment-experience/PartiallyUpdateWebProfile.php @@ -37,8 +37,10 @@ try { $webProfile = \PayPal\Api\WebProfile::get($webProfile->getId(), $apiContext); } } catch (\Exception $ex) { - ResultPrinter::printError("Partially Updated Web Profile", "Web Profile", $webProfile->getId(), $patches, $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); exit(1); } -ResultPrinter::printResult("Partially Updated Web Profile", "Web Profile", $webProfile->getId(), $patches, $webProfile); +// NOTE: PLEASE DO NOT USE RESULTPRINTER CLASS IN YOUR ORIGINAL CODE. FOR SAMPLE ONLY + ResultPrinter::printResult("Partially Updated Web Profile", "Web Profile", $webProfile->getId(), $patches, $webProfile); diff --git a/sample/payment-experience/UpdateWebProfile.php b/sample/payment-experience/UpdateWebProfile.php index 22b9de8..4cf4770 100644 --- a/sample/payment-experience/UpdateWebProfile.php +++ b/sample/payment-experience/UpdateWebProfile.php @@ -21,8 +21,10 @@ try { $updatedWebProfile = \PayPal\Api\WebProfile::get($webProfile->getId(), $apiContext); } } catch (\Exception $ex) { - ResultPrinter::printError("Updated Web Profile", "Web Profile", $webProfile->getId(), $webProfile, $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); exit(1); } -ResultPrinter::printResult("Updated Web Profile", "Web Profile", $updatedWebProfile->getId(), $webProfile, $updatedWebProfile); +// NOTE: PLEASE DO NOT USE RESULTPRINTER CLASS IN YOUR ORIGINAL CODE. FOR SAMPLE ONLY + ResultPrinter::printResult("Updated Web Profile", "Web Profile", $updatedWebProfile->getId(), $webProfile, $updatedWebProfile); diff --git a/sample/payments/AuthorizationCapture.php b/sample/payments/AuthorizationCapture.php index c985ab9..606755a 100644 --- a/sample/payments/AuthorizationCapture.php +++ b/sample/payments/AuthorizationCapture.php @@ -30,10 +30,12 @@ try { // Perform a capture $getCapture = $authorization->capture($capture, $apiContext); } catch (Exception $ex) { - ResultPrinter::printError("Capture Payment", "Authorization", null, $capture, $ex); + // NOTE: PLEASE DO NOT USE RESULTPRINTER CLASS IN YOUR ORIGINAL CODE. FOR SAMPLE ONLY + ResultPrinter::printError("Capture Payment", "Authorization", null, $capture, $ex); exit(1); } -ResultPrinter::printResult("Capture Payment", "Authorization", $getCapture->getId(), $capture, $getCapture); +// NOTE: PLEASE DO NOT USE RESULTPRINTER CLASS IN YOUR ORIGINAL CODE. FOR SAMPLE ONLY + ResultPrinter::printResult("Capture Payment", "Authorization", $getCapture->getId(), $capture, $getCapture); return $getCapture; diff --git a/sample/payments/AuthorizePayment.php b/sample/payments/AuthorizePayment.php index ae27af0..5183624 100644 --- a/sample/payments/AuthorizePayment.php +++ b/sample/payments/AuthorizePayment.php @@ -68,11 +68,13 @@ $request = clone $payment; try { $payment->create($apiContext); } catch (Exception $ex) { - ResultPrinter::printError('Authorize a Payment', 'Authorized Payment', $payment->getId(), $request, $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); exit(1); } -ResultPrinter::printResult('Authorize a Payment', 'Authorized Payment', $payment->getId(), $request, $payment); +// NOTE: PLEASE DO NOT USE RESULTPRINTER CLASS IN YOUR ORIGINAL CODE. FOR SAMPLE ONLY + ResultPrinter::printResult('Authorize a Payment', 'Authorized Payment', $payment->getId(), $request, $payment); $transactions = $payment->getTransactions(); $relatedResources = $transactions[0]->getRelatedResources(); diff --git a/sample/payments/AuthorizePaymentUsingPayPal.php b/sample/payments/AuthorizePaymentUsingPayPal.php index ceb91ad..10900ed 100644 --- a/sample/payments/AuthorizePaymentUsingPayPal.php +++ b/sample/payments/AuthorizePaymentUsingPayPal.php @@ -100,7 +100,8 @@ $request = clone $payment; try { $payment->create($apiContext); } catch (Exception $ex) { - ResultPrinter::printError("Created Payment Authorization Using PayPal. Please visit the URL to Authorize.", "Payment", null, $request, $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); exit(1); } @@ -110,6 +111,7 @@ try { // method $approvalUrl = $payment->getApprovalLink(); -ResultPrinter::printResult("Created Payment Authorization Using PayPal. Please visit the URL to Authorize.", "Payment", "$approvalUrl", $request, $payment); +// NOTE: PLEASE DO NOT USE RESULTPRINTER CLASS IN YOUR ORIGINAL CODE. FOR SAMPLE ONLY + ResultPrinter::printResult("Created Payment Authorization Using PayPal. Please visit the URL to Authorize.", "Payment", "$approvalUrl", $request, $payment); return $payment; diff --git a/sample/payments/CreateFuturePayment.php b/sample/payments/CreateFuturePayment.php index 7cb7299..9a6e579 100644 --- a/sample/payments/CreateFuturePayment.php +++ b/sample/payments/CreateFuturePayment.php @@ -85,10 +85,12 @@ try { $payment->create($apiContext, $clientMetadataId); } catch (Exception $ex) { - ResultPrinter::printError("Future Payment", "Payment", null, $request, $ex); + // NOTE: PLEASE DO NOT USE RESULTPRINTER CLASS IN YOUR ORIGINAL CODE. FOR SAMPLE ONLY + ResultPrinter::printError("Future Payment", "Payment", null, $request, $ex); exit(1); } -ResultPrinter::printResult("Future Payment", "Payment", $payment->getId(), $request, $payment); +// NOTE: PLEASE DO NOT USE RESULTPRINTER CLASS IN YOUR ORIGINAL CODE. FOR SAMPLE ONLY + ResultPrinter::printResult("Future Payment", "Payment", $payment->getId(), $request, $payment); return $payment; diff --git a/sample/payments/CreatePayment.php b/sample/payments/CreatePayment.php index 9280f9d..d983834 100644 --- a/sample/payments/CreatePayment.php +++ b/sample/payments/CreatePayment.php @@ -113,10 +113,12 @@ $request = clone $payment; try { $payment->create($apiContext); } catch (Exception $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); + // 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); exit(1); } -ResultPrinter::printResult('Create Payment Using Credit Card', 'Payment', $payment->getId(), $request, $payment); +// NOTE: PLEASE DO NOT USE RESULTPRINTER CLASS IN YOUR ORIGINAL CODE. FOR SAMPLE ONLY + ResultPrinter::printResult('Create Payment Using Credit Card', 'Payment', $payment->getId(), $request, $payment); return $payment; diff --git a/sample/payments/CreatePaymentUsingPayPal.php b/sample/payments/CreatePaymentUsingPayPal.php index 0af37d5..d0e90e1 100644 --- a/sample/payments/CreatePaymentUsingPayPal.php +++ b/sample/payments/CreatePaymentUsingPayPal.php @@ -98,7 +98,8 @@ $request = clone $payment; try { $payment->create($apiContext); } catch (Exception $ex) { - ResultPrinter::printError("Created Payment Using PayPal. Please visit the URL to Approve.", "Payment", null, $request, $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); exit(1); } @@ -108,6 +109,7 @@ try { // method $approvalUrl = $payment->getApprovalLink(); -ResultPrinter::printResult("Created Payment Using PayPal. Please visit the URL to Approve.", "Payment", "$approvalUrl", $request, $payment); +// NOTE: PLEASE DO NOT USE RESULTPRINTER CLASS IN YOUR ORIGINAL CODE. FOR SAMPLE ONLY + ResultPrinter::printResult("Created Payment Using PayPal. Please visit the URL to Approve.", "Payment", "$approvalUrl", $request, $payment); return $payment; diff --git a/sample/payments/CreatePaymentUsingSavedCard.php b/sample/payments/CreatePaymentUsingSavedCard.php index 94775dc..e92d385 100644 --- a/sample/payments/CreatePaymentUsingSavedCard.php +++ b/sample/payments/CreatePaymentUsingSavedCard.php @@ -104,10 +104,12 @@ $request = clone $payment; try { $payment->create($apiContext); } catch (Exception $ex) { - ResultPrinter::printError("Create Payment using Saved Card", "Payment", null, $request, $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); exit(1); } -ResultPrinter::printResult("Create Payment using Saved Card", "Payment", $payment->getId(), $request, $payment); +// NOTE: PLEASE DO NOT USE RESULTPRINTER CLASS IN YOUR ORIGINAL CODE. FOR SAMPLE ONLY + ResultPrinter::printResult("Create Payment using Saved Card", "Payment", $payment->getId(), $request, $payment); return $card; diff --git a/sample/payments/ExecutePayment.php b/sample/payments/ExecutePayment.php index 09f474f..539becd 100644 --- a/sample/payments/ExecutePayment.php +++ b/sample/payments/ExecutePayment.php @@ -38,25 +38,30 @@ if (isset($_GET['success']) && $_GET['success'] == 'true') { // (See bootstrap.php for more on `ApiContext`) $result = $payment->execute($execution, $apiContext); + // NOTE: PLEASE DO NOT USE RESULTPRINTER CLASS IN YOUR ORIGINAL CODE. FOR SAMPLE ONLY ResultPrinter::printResult("Executed Payment", "Payment", $payment->getId(), $execution, $result); try { $payment = Payment::get($paymentId, $apiContext); } catch (Exception $ex) { - ResultPrinter::printError("Get Payment", "Payment", null, null, $ex); + // NOTE: PLEASE DO NOT USE RESULTPRINTER CLASS IN YOUR ORIGINAL CODE. FOR SAMPLE ONLY + ResultPrinter::printError("Get Payment", "Payment", null, null, $ex); exit(1); } } catch (Exception $ex) { - ResultPrinter::printError("Executed Payment", "Payment", null, null, $ex); + // NOTE: PLEASE DO NOT USE RESULTPRINTER CLASS IN YOUR ORIGINAL CODE. FOR SAMPLE ONLY + ResultPrinter::printError("Executed Payment", "Payment", null, null, $ex); exit(1); } + // NOTE: PLEASE DO NOT USE RESULTPRINTER CLASS IN YOUR ORIGINAL CODE. FOR SAMPLE ONLY 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); exit; } diff --git a/sample/payments/GetAuthorization.php b/sample/payments/GetAuthorization.php index 7171cb2..426d906 100644 --- a/sample/payments/GetAuthorization.php +++ b/sample/payments/GetAuthorization.php @@ -20,10 +20,12 @@ try { // Retrieve the authorization $result = Authorization::get($authorizationId, $apiContext); } catch (Exception $ex) { - ResultPrinter::printError("Get Authorization", "Authorization", null, null, $ex); + // NOTE: PLEASE DO NOT USE RESULTPRINTER CLASS IN YOUR ORIGINAL CODE. FOR SAMPLE ONLY + ResultPrinter::printError("Get Authorization", "Authorization", null, null, $ex); exit(1); } -ResultPrinter::printResult("Get Authorization", "Authorization", $authorizationId, null, $result); +// NOTE: PLEASE DO NOT USE RESULTPRINTER CLASS IN YOUR ORIGINAL CODE. FOR SAMPLE ONLY + ResultPrinter::printResult("Get Authorization", "Authorization", $authorizationId, null, $result); return $result; diff --git a/sample/payments/GetCapture.php b/sample/payments/GetCapture.php index c62f555..fc64b4b 100644 --- a/sample/payments/GetCapture.php +++ b/sample/payments/GetCapture.php @@ -17,8 +17,10 @@ use PayPal\Api\Authorization; try { $capture = Capture::get($request->getId(), $apiContext); } catch (Exception $ex) { - ResultPrinter::printError("Get Captured Payment", "Capture", $request->getId(), null, $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); exit(1); } -ResultPrinter::printResult("Get Captured Payment", "Capture", $capture->getId(), null, $capture); +// NOTE: PLEASE DO NOT USE RESULTPRINTER CLASS IN YOUR ORIGINAL CODE. FOR SAMPLE ONLY + ResultPrinter::printResult("Get Captured Payment", "Capture", $capture->getId(), null, $capture); diff --git a/sample/payments/GetPayment.php b/sample/payments/GetPayment.php index 67e19d8..9df9b66 100644 --- a/sample/payments/GetPayment.php +++ b/sample/payments/GetPayment.php @@ -23,10 +23,12 @@ $paymentId = $createdPayment->getId(); try { $payment = Payment::get($paymentId, $apiContext); } catch (Exception $ex) { - ResultPrinter::printError("Get Payment", "Payment", null, null, $ex); + // NOTE: PLEASE DO NOT USE RESULTPRINTER CLASS IN YOUR ORIGINAL CODE. FOR SAMPLE ONLY + ResultPrinter::printError("Get Payment", "Payment", null, null, $ex); exit(1); } -ResultPrinter::printResult("Get Payment", "Payment", $payment->getId(), null, $payment); +// NOTE: PLEASE DO NOT USE RESULTPRINTER CLASS IN YOUR ORIGINAL CODE. FOR SAMPLE ONLY + ResultPrinter::printResult("Get Payment", "Payment", $payment->getId(), null, $payment); return $payment; diff --git a/sample/payments/ListPayments.php b/sample/payments/ListPayments.php index 94f9cc8..5811072 100644 --- a/sample/payments/ListPayments.php +++ b/sample/payments/ListPayments.php @@ -26,8 +26,10 @@ try { $payments = Payment::all($params, $apiContext); } catch (Exception $ex) { - ResultPrinter::printError("List Payments", "Payment", null, $params, $ex); + // NOTE: PLEASE DO NOT USE RESULTPRINTER CLASS IN YOUR ORIGINAL CODE. FOR SAMPLE ONLY + ResultPrinter::printError("List Payments", "Payment", null, $params, $ex); exit(1); } -ResultPrinter::printResult("List Payments", "Payment", null, $params, $payments); +// NOTE: PLEASE DO NOT USE RESULTPRINTER CLASS IN YOUR ORIGINAL CODE. FOR SAMPLE ONLY + ResultPrinter::printResult("List Payments", "Payment", null, $params, $payments); diff --git a/sample/payments/OrderAuthorize.php b/sample/payments/OrderAuthorize.php index 5cd0ad6..05deb2e 100644 --- a/sample/payments/OrderAuthorize.php +++ b/sample/payments/OrderAuthorize.php @@ -37,15 +37,18 @@ if (isset($_GET['success']) && $_GET['success'] == 'true') { // Authorize the order by passing authorization object we created. // We will get a new authorization object back. $result = $order->authorize($authorization, $apiContext); + // NOTE: PLEASE DO NOT USE RESULTPRINTER CLASS IN YOUR ORIGINAL CODE. FOR SAMPLE ONLY ResultPrinter::printResult("Authorized Order", "Authorization", $result->getId(), $authorization, $result); } catch (Exception $ex) { - ResultPrinter::printError("Authorized Order", "Authorization", null, $authorization, $ex); + // NOTE: PLEASE DO NOT USE RESULTPRINTER CLASS IN YOUR ORIGINAL CODE. FOR SAMPLE ONLY + 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); exit; } diff --git a/sample/payments/OrderCapture.php b/sample/payments/OrderCapture.php index b274db6..d4a3218 100644 --- a/sample/payments/OrderCapture.php +++ b/sample/payments/OrderCapture.php @@ -37,15 +37,18 @@ if (isset($_GET['success']) && $_GET['success'] == 'true') { // Capture the order by passing capture object we created. // We will get a new capture object back. $result = $order->capture($capture, $apiContext); + // NOTE: PLEASE DO NOT USE RESULTPRINTER CLASS IN YOUR ORIGINAL CODE. FOR SAMPLE ONLY ResultPrinter::printResult("Captured Order", "Capture", $result->getId(), $capture, $result); } catch (Exception $ex) { - ResultPrinter::printError("Captured Order", "Capture", null, $capture, $ex); + // NOTE: PLEASE DO NOT USE RESULTPRINTER CLASS IN YOUR ORIGINAL CODE. FOR SAMPLE ONLY + 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); exit; } diff --git a/sample/payments/OrderCreateForAuthorization.php b/sample/payments/OrderCreateForAuthorization.php index d6026b3..704e39a 100644 --- a/sample/payments/OrderCreateForAuthorization.php +++ b/sample/payments/OrderCreateForAuthorization.php @@ -97,7 +97,8 @@ $request = clone $payment; try { $payment->create($apiContext); } catch (Exception $ex) { - ResultPrinter::printError("Created Payment Order Using PayPal. Please visit the URL to Approve.", "Payment", null, $request, $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); exit(1); } @@ -107,6 +108,7 @@ try { // method $approvalUrl = $payment->getApprovalLink(); -ResultPrinter::printResult("Created Payment Order Using PayPal. Please visit the URL to Approve.", "Payment", "$approvalUrl", $request, $payment); +// NOTE: PLEASE DO NOT USE RESULTPRINTER CLASS IN YOUR ORIGINAL CODE. FOR SAMPLE ONLY + ResultPrinter::printResult("Created Payment Order Using PayPal. Please visit the URL to Approve.", "Payment", "$approvalUrl", $request, $payment); return $payment; diff --git a/sample/payments/OrderCreateForCapture.php b/sample/payments/OrderCreateForCapture.php index 4c40fef..d0882c4 100644 --- a/sample/payments/OrderCreateForCapture.php +++ b/sample/payments/OrderCreateForCapture.php @@ -97,7 +97,8 @@ $request = clone $payment; try { $payment->create($apiContext); } catch (Exception $ex) { - ResultPrinter::printError("Created Payment Order Using PayPal. Please visit the URL to Approve.", "Payment", null, $request, $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); exit(1); } @@ -107,6 +108,7 @@ try { // method $approvalUrl = $payment->getApprovalLink(); -ResultPrinter::printResult("Created Payment Order Using PayPal. Please visit the URL to Approve.", "Payment", "$approvalUrl", $request, $payment); +// NOTE: PLEASE DO NOT USE RESULTPRINTER CLASS IN YOUR ORIGINAL CODE. FOR SAMPLE ONLY + ResultPrinter::printResult("Created Payment Order Using PayPal. Please visit the URL to Approve.", "Payment", "$approvalUrl", $request, $payment); return $payment; diff --git a/sample/payments/OrderCreateForVoid.php b/sample/payments/OrderCreateForVoid.php index 6e44a94..eea420d 100644 --- a/sample/payments/OrderCreateForVoid.php +++ b/sample/payments/OrderCreateForVoid.php @@ -97,7 +97,8 @@ $request = clone $payment; try { $payment->create($apiContext); } catch (Exception $ex) { - ResultPrinter::printError("Created Payment Order Using PayPal. Please visit the URL to Approve.", "Payment", null, $request, $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); exit(1); } @@ -107,6 +108,7 @@ try { // method $approvalUrl = $payment->getApprovalLink(); -ResultPrinter::printResult("Created Payment Order Using PayPal. Please visit the URL to Approve.", "Payment", "$approvalUrl", $request, $payment); +// NOTE: PLEASE DO NOT USE RESULTPRINTER CLASS IN YOUR ORIGINAL CODE. FOR SAMPLE ONLY + ResultPrinter::printResult("Created Payment Order Using PayPal. Please visit the URL to Approve.", "Payment", "$approvalUrl", $request, $payment); return $payment; diff --git a/sample/payments/OrderCreateUsingPayPal.php b/sample/payments/OrderCreateUsingPayPal.php index 5f62b2b..f194394 100644 --- a/sample/payments/OrderCreateUsingPayPal.php +++ b/sample/payments/OrderCreateUsingPayPal.php @@ -97,7 +97,8 @@ $request = clone $payment; try { $payment->create($apiContext); } catch (Exception $ex) { - ResultPrinter::printError("Created Payment Order Using PayPal. Please visit the URL to Approve.", "Payment", null, $request, $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); exit(1); } @@ -107,6 +108,7 @@ try { // method $approvalUrl = $payment->getApprovalLink(); -ResultPrinter::printResult("Created Payment Order Using PayPal. Please visit the URL to Approve.", "Payment", "$approvalUrl", $request, $payment); +// NOTE: PLEASE DO NOT USE RESULTPRINTER CLASS IN YOUR ORIGINAL CODE. FOR SAMPLE ONLY + ResultPrinter::printResult("Created Payment Order Using PayPal. Please visit the URL to Approve.", "Payment", "$approvalUrl", $request, $payment); return $payment; diff --git a/sample/payments/OrderDoVoid.php b/sample/payments/OrderDoVoid.php index b9064a8..f619418 100644 --- a/sample/payments/OrderDoVoid.php +++ b/sample/payments/OrderDoVoid.php @@ -26,15 +26,18 @@ if (isset($_GET['success']) && $_GET['success'] == 'true') { // ### Void Order // Call void method on order object. You will get an Order Object back $result = $order->void($apiContext); + // NOTE: PLEASE DO NOT USE RESULTPRINTER CLASS IN YOUR ORIGINAL CODE. FOR SAMPLE ONLY ResultPrinter::printResult("Voided Order", "Order", $result->getId(), null, $result); } catch (Exception $ex) { - ResultPrinter::printError("Voided Order", "Order", null, null, $ex); + // NOTE: PLEASE DO NOT USE RESULTPRINTER CLASS IN YOUR ORIGINAL CODE. FOR SAMPLE ONLY + ResultPrinter::printError("Voided Order", "Order", null, null, $ex); exit(1); } return $result; } else { - ResultPrinter::printResult("User Cancelled the Approval", null); + // NOTE: PLEASE DO NOT USE RESULTPRINTER CLASS IN YOUR ORIGINAL CODE. FOR SAMPLE ONLY + ResultPrinter::printResult("User Cancelled the Approval", null); exit; } diff --git a/sample/payments/OrderGet.php b/sample/payments/OrderGet.php index c9caa8c..05da1e2 100644 --- a/sample/payments/OrderGet.php +++ b/sample/payments/OrderGet.php @@ -18,15 +18,18 @@ if (isset($_GET['success']) && $_GET['success'] == 'true') { try { $result = \PayPal\Api\Order::get($order->getId(), $apiContext); + // NOTE: PLEASE DO NOT USE RESULTPRINTER CLASS IN YOUR ORIGINAL CODE. FOR SAMPLE ONLY ResultPrinter::printResult("Get Order", "Order", $result->getId(), null, $result); } catch (Exception $ex) { - ResultPrinter::printError("Get Order", "Order", null, null, $ex); + // NOTE: PLEASE DO NOT USE RESULTPRINTER CLASS IN YOUR ORIGINAL CODE. FOR SAMPLE ONLY + 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); exit; } diff --git a/sample/payments/Reauthorization.php b/sample/payments/Reauthorization.php index 5ae75d4..ab7c55c 100644 --- a/sample/payments/Reauthorization.php +++ b/sample/payments/Reauthorization.php @@ -27,8 +27,10 @@ try { $reAuthorization = $authorization->reauthorize($apiContext); } catch (Exception $ex) { - ResultPrinter::printError("Reauthorize Payment", "Payment", null, null, $ex); + // NOTE: PLEASE DO NOT USE RESULTPRINTER CLASS IN YOUR ORIGINAL CODE. FOR SAMPLE ONLY + ResultPrinter::printError("Reauthorize Payment", "Payment", null, null, $ex); exit(1); } +// NOTE: PLEASE DO NOT USE RESULTPRINTER CLASS IN YOUR ORIGINAL CODE. FOR SAMPLE ONLY ResultPrinter::printResult("Reauthorize Payment", "Payment", $authorization->getId(), null, $reAuthorization); diff --git a/sample/payments/RefundCapture.php b/sample/payments/RefundCapture.php index 10a8fc9..d368c97 100644 --- a/sample/payments/RefundCapture.php +++ b/sample/payments/RefundCapture.php @@ -25,8 +25,10 @@ try { $captureRefund = $capture->refund($refund, $apiContext); } catch (Exception $ex) { - ResultPrinter::printError("Refund Capture", "Capture", null, $refund, $ex); + // NOTE: PLEASE DO NOT USE RESULTPRINTER CLASS IN YOUR ORIGINAL CODE. FOR SAMPLE ONLY + ResultPrinter::printError("Refund Capture", "Capture", null, $refund, $ex); exit(1); } -ResultPrinter::printResult("Refund Capture", "Capture", $captureRefund->getId(), $refund, $captureRefund); +// NOTE: PLEASE DO NOT USE RESULTPRINTER CLASS IN YOUR ORIGINAL CODE. FOR SAMPLE ONLY + ResultPrinter::printResult("Refund Capture", "Capture", $captureRefund->getId(), $refund, $captureRefund); diff --git a/sample/payments/UpdatePayment.php b/sample/payments/UpdatePayment.php index 624ac20..1f4170b 100644 --- a/sample/payments/UpdatePayment.php +++ b/sample/payments/UpdatePayment.php @@ -83,16 +83,19 @@ try { $result = $createdPayment->update($patchRequest, $apiContext); } catch (Exception $ex) { - ResultPrinter::printError("Update Payment", "PatchRequest", null, $patchRequest, $ex); + // NOTE: PLEASE DO NOT USE RESULTPRINTER CLASS IN YOUR ORIGINAL CODE. FOR SAMPLE ONLY + ResultPrinter::printError("Update Payment", "PatchRequest", null, $patchRequest, $ex); exit(1); } -ResultPrinter::printResult("Update Payment", "PatchRequest", $payment->getId(), $patchRequest, null); +// NOTE: PLEASE DO NOT USE RESULTPRINTER CLASS IN YOUR ORIGINAL CODE. FOR SAMPLE ONLY + ResultPrinter::printResult("Update Payment", "PatchRequest", $payment->getId(), $patchRequest, null); // ### Getting Updated Payment Object if ($result == true) { $result = Payment::get($createdPayment->getId(), $apiContext); - ResultPrinter::printResult("Get Payment", "Payment", $result->getId(), null, $result); + // NOTE: PLEASE DO NOT USE RESULTPRINTER CLASS IN YOUR ORIGINAL CODE. FOR SAMPLE ONLY + ResultPrinter::printResult("Get Payment", "Payment", $result->getId(), null, $result); // ### Get redirect url @@ -106,7 +109,8 @@ foreach ($result->getLinks() as $link) { } } -ResultPrinter::printResult("Created Payment Using PayPal. Please visit the URL to Approve.", "Payment", "$approvalUrl", $request, $result); +// NOTE: PLEASE DO NOT USE RESULTPRINTER CLASS IN YOUR ORIGINAL CODE. FOR SAMPLE ONLY + ResultPrinter::printResult("Created Payment Using PayPal. Please visit the URL to Approve.", "Payment", "$approvalUrl", $request, $result); } return $result; diff --git a/sample/payments/VoidAuthorization.php b/sample/payments/VoidAuthorization.php index bdd8559..2eb5996 100644 --- a/sample/payments/VoidAuthorization.php +++ b/sample/payments/VoidAuthorization.php @@ -23,10 +23,12 @@ try { // Void the authorization $voidedAuth = $authorization->void($apiContext); } catch (Exception $ex) { - ResultPrinter::printError("Void Authorization", "Authorization", null, null, $ex); + // NOTE: PLEASE DO NOT USE RESULTPRINTER CLASS IN YOUR ORIGINAL CODE. FOR SAMPLE ONLY + ResultPrinter::printError("Void Authorization", "Authorization", null, null, $ex); exit(1); } -ResultPrinter::printResult("Void Authorization", "Authorization", $voidedAuth->getId(), null, $voidedAuth); +// NOTE: PLEASE DO NOT USE RESULTPRINTER CLASS IN YOUR ORIGINAL CODE. FOR SAMPLE ONLY + ResultPrinter::printResult("Void Authorization", "Authorization", $voidedAuth->getId(), null, $voidedAuth); return $voidedAuth; diff --git a/sample/payouts/CancelPayoutItem.php b/sample/payouts/CancelPayoutItem.php index 9b0392d..0e8aac6 100644 --- a/sample/payouts/CancelPayoutItem.php +++ b/sample/payouts/CancelPayoutItem.php @@ -21,13 +21,16 @@ try { if ($payoutItem->getTransactionStatus() == 'UNCLAIMED') { // Cancel the Payout Item $output = \PayPal\Api\PayoutItem::cancel($payoutItemId, $apiContext); + // NOTE: PLEASE DO NOT USE RESULTPRINTER CLASS IN YOUR ORIGINAL CODE. FOR SAMPLE ONLY ResultPrinter::printResult("Cancel Unclaimed Payout Item", "PayoutItem", $output->getPayoutItemId(), null, $output); } else { // The item transaction status is not unclaimed. You can only cancel an unclaimed transaction. - ResultPrinter::printError("Cancel Unclaimed Payout Item", "PayoutItem", null, $payoutItemId, new Exception("Payout Item Status is not UNCLAIMED")); + // 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")); } } catch (Exception $ex) { - ResultPrinter::printError("Cancel Unclaimed Payout Item", "PayoutItem", null, $payoutItemId, $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); exit(1); } diff --git a/sample/payouts/CreateBatchPayout.php b/sample/payouts/CreateBatchPayout.php index 7e77800..5003c93 100644 --- a/sample/payouts/CreateBatchPayout.php +++ b/sample/payouts/CreateBatchPayout.php @@ -115,10 +115,12 @@ $request = clone $payouts; try { $output = $payouts->create(null, $apiContext); } catch (Exception $ex) { - ResultPrinter::printError("Created Batch Payout", "Payout", null, $request, $ex); + // NOTE: PLEASE DO NOT USE RESULTPRINTER CLASS IN YOUR ORIGINAL CODE. FOR SAMPLE ONLY + ResultPrinter::printError("Created Batch Payout", "Payout", null, $request, $ex); exit(1); } -ResultPrinter::printResult("Created Batch Payout", "Payout", $output->getBatchHeader()->getPayoutBatchId(), $request, $output); +// NOTE: PLEASE DO NOT USE RESULTPRINTER CLASS IN YOUR ORIGINAL CODE. FOR SAMPLE ONLY + ResultPrinter::printResult("Created Batch Payout", "Payout", $output->getBatchHeader()->getPayoutBatchId(), $request, $output); return $output; diff --git a/sample/payouts/CreateSinglePayout.php b/sample/payouts/CreateSinglePayout.php index b00f626..dd487d9 100644 --- a/sample/payouts/CreateSinglePayout.php +++ b/sample/payouts/CreateSinglePayout.php @@ -64,10 +64,12 @@ $request = clone $payouts; try { $output = $payouts->createSynchronous($apiContext); } catch (Exception $ex) { - ResultPrinter::printError("Created Single Synchronous Payout", "Payout", null, $request, $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); exit(1); } -ResultPrinter::printResult("Created Single Synchronous Payout", "Payout", $output->getBatchHeader()->getPayoutBatchId(), $request, $output); +// NOTE: PLEASE DO NOT USE RESULTPRINTER CLASS IN YOUR ORIGINAL CODE. FOR SAMPLE ONLY + ResultPrinter::printResult("Created Single Synchronous Payout", "Payout", $output->getBatchHeader()->getPayoutBatchId(), $request, $output); return $output; diff --git a/sample/payouts/GetPayoutBatchStatus.php b/sample/payouts/GetPayoutBatchStatus.php index 3044890..6423abd 100644 --- a/sample/payouts/GetPayoutBatchStatus.php +++ b/sample/payouts/GetPayoutBatchStatus.php @@ -16,10 +16,12 @@ $payoutBatchId = $payoutBatch->getBatchHeader()->getPayoutBatchId(); try { $output = \PayPal\Api\Payout::get($payoutBatchId, $apiContext); } catch (Exception $ex) { - ResultPrinter::printError("Get Payout Batch Status", "PayoutBatch", null, $payoutBatchId, $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); exit(1); } -ResultPrinter::printResult("Get Payout Batch Status", "PayoutBatch", $output->getBatchHeader()->getPayoutBatchId(), null, $output); +// NOTE: PLEASE DO NOT USE RESULTPRINTER CLASS IN YOUR ORIGINAL CODE. FOR SAMPLE ONLY + ResultPrinter::printResult("Get Payout Batch Status", "PayoutBatch", $output->getBatchHeader()->getPayoutBatchId(), null, $output); return $output; diff --git a/sample/payouts/GetPayoutItemStatus.php b/sample/payouts/GetPayoutItemStatus.php index c13473f..6bc577f 100644 --- a/sample/payouts/GetPayoutItemStatus.php +++ b/sample/payouts/GetPayoutItemStatus.php @@ -18,10 +18,12 @@ $payoutItemId = $payoutItem->getPayoutItemId(); try { $output = \PayPal\Api\PayoutItem::get($payoutItemId, $apiContext); } catch (Exception $ex) { - ResultPrinter::printError("Get Payout Item Status", "PayoutItem", null, $payoutItemId, $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); exit(1); } -ResultPrinter::printResult("Get Payout Item Status", "PayoutItem", $output->getPayoutItemId(), null, $output); +// NOTE: PLEASE DO NOT USE RESULTPRINTER CLASS IN YOUR ORIGINAL CODE. FOR SAMPLE ONLY + ResultPrinter::printResult("Get Payout Item Status", "PayoutItem", $output->getPayoutItemId(), null, $output); return $output; diff --git a/sample/sale/GetSale.php b/sample/sale/GetSale.php index ad00990..8efb72f 100644 --- a/sample/sale/GetSale.php +++ b/sample/sale/GetSale.php @@ -24,10 +24,12 @@ try { // transaction from your payment resource. $sale = Sale::get($saleId, $apiContext); } catch (Exception $ex) { - ResultPrinter::printError("Look Up A Sale", "Sale", $sale->getId(), null, $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); exit(1); } -ResultPrinter::printResult("Look Up A Sale", "Sale", $sale->getId(), null, $sale); +// NOTE: PLEASE DO NOT USE RESULTPRINTER CLASS IN YOUR ORIGINAL CODE. FOR SAMPLE ONLY + ResultPrinter::printResult("Look Up A Sale", "Sale", $sale->getId(), null, $sale); return $sale; diff --git a/sample/sale/RefundSale.php b/sample/sale/RefundSale.php index 87fe2c5..ef51d1e 100644 --- a/sample/sale/RefundSale.php +++ b/sample/sale/RefundSale.php @@ -41,10 +41,12 @@ try { // (See bootstrap.php for more on `ApiContext`) $refundedSale = $sale->refund($refund, $apiContext); } catch (Exception $ex) { - ResultPrinter::printError("Refund Sale", "Sale", $refundedSale->getId(), $refund, $ex); + // NOTE: PLEASE DO NOT USE RESULTPRINTER CLASS IN YOUR ORIGINAL CODE. FOR SAMPLE ONLY + ResultPrinter::printError("Refund Sale", "Sale", $refundedSale->getId(), $refund, $ex); exit(1); } -ResultPrinter::printResult("Refund Sale", "Sale", $refundedSale->getId(), $refund, $refundedSale); +// NOTE: PLEASE DO NOT USE RESULTPRINTER CLASS IN YOUR ORIGINAL CODE. FOR SAMPLE ONLY + ResultPrinter::printResult("Refund Sale", "Sale", $refundedSale->getId(), $refund, $refundedSale); return $refundedSale; diff --git a/sample/vault/CreateBankAccount.php b/sample/vault/CreateBankAccount.php index 607028b..aeda49b 100644 --- a/sample/vault/CreateBankAccount.php +++ b/sample/vault/CreateBankAccount.php @@ -72,10 +72,12 @@ $request = clone $bankAccount; try { $bankAccount->create($apiContext); } catch (Exception $ex) { - ResultPrinter::printError("Create Bank Account", "Bank Account", null, $request, $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); exit(1); } -ResultPrinter::printResult("Create Bank Account", "Bank Account", $bankAccount->getId(), $request, $bankAccount); +// NOTE: PLEASE DO NOT USE RESULTPRINTER CLASS IN YOUR ORIGINAL CODE. FOR SAMPLE ONLY + ResultPrinter::printResult("Create Bank Account", "Bank Account", $bankAccount->getId(), $request, $bankAccount); return $bankAccount; diff --git a/sample/vault/CreateCreditCard.php b/sample/vault/CreateCreditCard.php index ef5cff7..785ac83 100644 --- a/sample/vault/CreateCreditCard.php +++ b/sample/vault/CreateCreditCard.php @@ -34,10 +34,12 @@ $request = clone $card; try { $card->create($apiContext); } catch (Exception $ex) { - ResultPrinter::printError("Create Credit Card", "Credit Card", null, $request, $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); exit(1); } -ResultPrinter::printResult("Create Credit Card", "Credit Card", $card->getId(), $request, $card); +// NOTE: PLEASE DO NOT USE RESULTPRINTER CLASS IN YOUR ORIGINAL CODE. FOR SAMPLE ONLY + ResultPrinter::printResult("Create Credit Card", "Credit Card", $card->getId(), $request, $card); return $card; diff --git a/sample/vault/DeleteBankAccount.php b/sample/vault/DeleteBankAccount.php index 743a606..48b3835 100644 --- a/sample/vault/DeleteBankAccount.php +++ b/sample/vault/DeleteBankAccount.php @@ -14,8 +14,10 @@ try { // (See bootstrap.php for more on `ApiContext`) $bankAccount->delete($apiContext); } catch (Exception $ex) { - ResultPrinter::printError("Delete Bank Account", "Bank Account", null, null, $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); exit(1); } -ResultPrinter::printResult("Delete Bank Account", "Bank Account", $bankAccount->getId(), null, null); +// NOTE: PLEASE DO NOT USE RESULTPRINTER CLASS IN YOUR ORIGINAL CODE. FOR SAMPLE ONLY + ResultPrinter::printResult("Delete Bank Account", "Bank Account", $bankAccount->getId(), null, null); diff --git a/sample/vault/DeleteCreditCard.php b/sample/vault/DeleteCreditCard.php index 9110daa..3676f58 100644 --- a/sample/vault/DeleteCreditCard.php +++ b/sample/vault/DeleteCreditCard.php @@ -15,8 +15,10 @@ try { // (See bootstrap.php for more on `ApiContext`) $card->delete($apiContext); } catch (Exception $ex) { - ResultPrinter::printError("Delete Credit Card", "Credit Card", null, null, $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); exit(1); } -ResultPrinter::printResult("Delete Credit Card", "Credit Card", $card->getId(), null, null); +// NOTE: PLEASE DO NOT USE RESULTPRINTER CLASS IN YOUR ORIGINAL CODE. FOR SAMPLE ONLY + ResultPrinter::printResult("Delete Credit Card", "Credit Card", $card->getId(), null, null); diff --git a/sample/vault/GetBankAccount.php b/sample/vault/GetBankAccount.php index c93256d..721f287 100644 --- a/sample/vault/GetBankAccount.php +++ b/sample/vault/GetBankAccount.php @@ -16,10 +16,12 @@ $bankAccount = require 'CreateBankAccount.php'; try { $bankAccount = \PayPal\Api\BankAccount::get($bankAccount->getId(), $apiContext); } catch (Exception $ex) { - ResultPrinter::printError("Get Bank Account", "Bank Account", $bankAccount->getId(), null, $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); exit(1); } -ResultPrinter::printResult("Get Bank Account", "Bank Account", $bankAccount->getId(), null, $bankAccount); +// NOTE: PLEASE DO NOT USE RESULTPRINTER CLASS IN YOUR ORIGINAL CODE. FOR SAMPLE ONLY + ResultPrinter::printResult("Get Bank Account", "Bank Account", $bankAccount->getId(), null, $bankAccount); return $bankAccount; diff --git a/sample/vault/GetCreditCard.php b/sample/vault/GetCreditCard.php index fb9ade8..e106d97 100644 --- a/sample/vault/GetCreditCard.php +++ b/sample/vault/GetCreditCard.php @@ -17,10 +17,12 @@ use PayPal\Api\CreditCard; try { $card = CreditCard::get($card->getId(), $apiContext); } catch (Exception $ex) { - ResultPrinter::printError("Get Credit Card", "Credit Card", $card->getId(), null, $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); exit(1); } -ResultPrinter::printResult("Get Credit Card", "Credit Card", $card->getId(), null, $card); +// NOTE: PLEASE DO NOT USE RESULTPRINTER CLASS IN YOUR ORIGINAL CODE. FOR SAMPLE ONLY + ResultPrinter::printResult("Get Credit Card", "Credit Card", $card->getId(), null, $card); return $card; diff --git a/sample/vault/UpdateCreditCard.php b/sample/vault/UpdateCreditCard.php index 3ad36be..9e65944 100644 --- a/sample/vault/UpdateCreditCard.php +++ b/sample/vault/UpdateCreditCard.php @@ -42,10 +42,12 @@ $pathRequest->addPatch($pathOperation) try { $card = $card->update($pathRequest, $apiContext); } catch (Exception $ex) { - ResultPrinter::printError("Updated Credit Card", "Credit Card", $card->getId(), $pathRequest, $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); exit(1); } -ResultPrinter::printResult("Updated Credit Card", "Credit Card", $card->getId(), $pathRequest, $card); +// NOTE: PLEASE DO NOT USE RESULTPRINTER CLASS IN YOUR ORIGINAL CODE. FOR SAMPLE ONLY + ResultPrinter::printResult("Updated Credit Card", "Credit Card", $card->getId(), $pathRequest, $card); return $card;