From 4182e335de7dbafe24d8aaaca21672db5f43b481 Mon Sep 17 00:00:00 2001 From: Travis Date: Thu, 14 Jul 2016 19:10:54 +0000 Subject: [PATCH] Updates to Sample Docs --- .../doc/billing/CreateBillingAgreementWithCreditCard.html | 1 - sample/doc/billing/CreateBillingAgreementWithPayPal.html | 1 - sample/doc/billing/CreatePlan.html | 2 +- sample/doc/billing/DeletePlan.html | 2 +- sample/doc/billing/ExecuteAgreement.html | 6 ++---- sample/doc/billing/GetBillingAgreement.html | 2 +- sample/doc/billing/GetPlan.html | 2 +- sample/doc/billing/ListPlans.html | 2 +- sample/doc/billing/ReactivateBillingAgreement.html | 2 -- sample/doc/billing/SearchBillingTransactions.html | 2 +- sample/doc/billing/SuspendBillingAgreement.html | 4 +--- sample/doc/billing/UpdateBillingAgreement.html | 3 +-- sample/doc/billing/UpdatePlan.html | 3 +-- sample/doc/billing/UpdatePlanPaymentDefinitions.html | 3 +-- sample/doc/invoice/CancelInvoice.html | 2 +- sample/doc/invoice/CreateInvoice.html | 2 +- sample/doc/invoice/CreateThirdPartyInvoice.html | 2 +- sample/doc/invoice/DeleteInvoice.html | 2 +- sample/doc/invoice/GetInvoice.html | 2 +- sample/doc/invoice/GetNextInvoiceNumber.html | 2 +- sample/doc/invoice/ListInvoice.html | 2 +- sample/doc/invoice/RecordPayment.html | 4 ++-- sample/doc/invoice/RecordRefund.html | 4 ++-- sample/doc/invoice/RemindInvoice.html | 4 ++-- sample/doc/invoice/RetrieveQRCode.html | 4 +--- sample/doc/invoice/SearchInvoices.html | 2 +- sample/doc/invoice/SendInvoice.html | 2 +- sample/doc/invoice/UpdateInvoice.html | 4 ++-- sample/doc/lipp/GenerateAccessTokenFromRefreshToken.html | 4 +--- sample/doc/lipp/GetUserInfo.html | 4 +--- sample/doc/lipp/ObtainUserConsent.html | 2 +- sample/doc/lipp/UserConsentRedirect.html | 4 +--- sample/doc/notifications/CreateWebhook.html | 4 ++-- sample/doc/notifications/DeleteAllWebhooks.html | 2 +- sample/doc/notifications/DeleteWebhook.html | 2 +- sample/doc/notifications/GetWebhook.html | 2 +- .../doc/notifications/ListSubscribedWebhookEventTypes.html | 4 ++-- sample/doc/notifications/ListWebhooks.html | 4 ++-- sample/doc/notifications/SearchWebhookEvents.html | 2 +- sample/doc/notifications/UpdateWebhook.html | 2 +- sample/doc/notifications/WebhookEventTypesList.html | 2 +- sample/doc/payment-experience/CreateWebProfile.html | 2 +- sample/doc/payment-experience/DeleteWebProfile.html | 2 +- sample/doc/payment-experience/GetWebProfile.html | 2 +- sample/doc/payment-experience/ListWebProfiles.html | 2 +- .../doc/payment-experience/PartiallyUpdateWebProfile.html | 2 +- sample/doc/payment-experience/UpdateWebProfile.html | 2 +- sample/doc/payments/AuthorizationCapture.html | 2 +- sample/doc/payments/AuthorizePayment.html | 2 +- sample/doc/payments/AuthorizePaymentUsingPayPal.html | 2 +- sample/doc/payments/CreateFuturePayment.html | 3 +-- sample/doc/payments/CreatePayment.html | 2 +- sample/doc/payments/CreatePaymentUsingPayPal.html | 2 +- sample/doc/payments/CreatePaymentUsingSavedCard.html | 2 +- sample/doc/payments/ExecutePayment.html | 6 ++---- sample/doc/payments/GetAuthorization.html | 2 +- sample/doc/payments/GetCapture.html | 2 +- sample/doc/payments/GetPayment.html | 2 +- sample/doc/payments/ListPayments.html | 3 +-- sample/doc/payments/OrderAuthorize.html | 3 +-- sample/doc/payments/OrderCapture.html | 3 +-- sample/doc/payments/OrderCreateForAuthorization.html | 2 +- sample/doc/payments/OrderCreateForCapture.html | 2 +- sample/doc/payments/OrderCreateForVoid.html | 2 +- sample/doc/payments/OrderCreateUsingPayPal.html | 2 +- sample/doc/payments/OrderDoVoid.html | 3 +-- sample/doc/payments/OrderGet.html | 4 +--- sample/doc/payments/Reauthorization.html | 3 +-- sample/doc/payments/RefundCapture.html | 2 +- sample/doc/payments/UpdatePayment.html | 3 +-- sample/doc/payments/VoidAuthorization.html | 2 +- sample/doc/payouts/CancelPayoutItem.html | 4 ++-- sample/doc/payouts/CreateBatchPayout.html | 2 +- sample/doc/payouts/CreateSinglePayout.html | 2 +- sample/doc/payouts/GetPayoutBatchStatus.html | 2 +- sample/doc/payouts/GetPayoutItemStatus.html | 2 +- sample/doc/sale/GetSale.html | 2 +- sample/doc/sale/RefundSale.html | 2 +- sample/doc/vault/CreateBankAccount.html | 2 +- sample/doc/vault/CreateCreditCard.html | 2 +- sample/doc/vault/DeleteBankAccount.html | 2 +- sample/doc/vault/DeleteCreditCard.html | 2 +- sample/doc/vault/GetBankAccount.html | 2 +- sample/doc/vault/GetCreditCard.html | 2 +- sample/doc/vault/ListCreditCards.html | 2 +- sample/doc/vault/UpdateCreditCard.html | 2 +- 86 files changed, 93 insertions(+), 123 deletions(-) diff --git a/sample/doc/billing/CreateBillingAgreementWithCreditCard.html b/sample/doc/billing/CreateBillingAgreementWithCreditCard.html index 9a0f778..e7950d3 100644 --- a/sample/doc/billing/CreateBillingAgreementWithCreditCard.html +++ b/sample/doc/billing/CreateBillingAgreementWithCreditCard.html @@ -73,7 +73,6 @@ Please note that the plan Id should be only set in this case.

'95070') ->setCountryCode('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) {

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); }

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

ResultPrinter::printResult("Created Billing Agreement.", "Agreement", $agreement->getId(), $request, $agreement); diff --git a/sample/doc/billing/CreateBillingAgreementWithPayPal.html b/sample/doc/billing/CreateBillingAgreementWithPayPal.html index 1e5a85e..1ca1573 100644 --- a/sample/doc/billing/CreateBillingAgreementWithPayPal.html +++ b/sample/doc/billing/CreateBillingAgreementWithPayPal.html @@ -48,7 +48,6 @@ Please note that the plan Id should be only set in this case.

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

$approvalUrl = $agreement->getApprovalLink(); - } catch (Exception $ex) {

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

ResultPrinter::printError("Created Billing Agreement.", "Agreement", null, $request, $ex); exit(1); }

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); diff --git a/sample/doc/billing/CreatePlan.html b/sample/doc/billing/CreatePlan.html index e16f062..1af774b 100644 --- a/sample/doc/billing/CreatePlan.html +++ b/sample/doc/billing/CreatePlan.html @@ -36,7 +36,7 @@ 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) {

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

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); }

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

ResultPrinter::printResult("Created Plan", "Plan", $output->getId(), $request, $output); diff --git a/sample/doc/billing/DeletePlan.html b/sample/doc/billing/DeletePlan.html index d58ea7f..b35510e 100644 --- a/sample/doc/billing/DeletePlan.html +++ b/sample/doc/billing/DeletePlan.html @@ -8,7 +8,7 @@ API used: /v1/payments/billing-plans

< try { $result = $createdPlan->delete($apiContext); -} catch (Exception $ex) {

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

ResultPrinter::printError("Deleted a Plan", "Plan", $createdPlan->getId(), null, $ex); +} catch (Exception $ex) {

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

ResultPrinter::printError("Deleted a Plan", "Plan", $createdPlan->getId(), null, $ex); exit(1); }

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

ResultPrinter::printResult("Deleted a Plan", "Plan", $createdPlan->getId(), null, null); diff --git a/sample/doc/billing/ExecuteAgreement.html b/sample/doc/billing/ExecuteAgreement.html index 529f830..6078686 100644 --- a/sample/doc/billing/ExecuteAgreement.html +++ b/sample/doc/billing/ExecuteAgreement.html @@ -2,19 +2,17 @@

This is the second part of CreateAgreement Sample. Use this call to execute an agreement after the buyer approves it

require __DIR__ . '/../bootstrap.php';

Approval Status

Determine if the user accepted or denied the request

if (isset($_GET['success']) && $_GET['success'] == 'true') { - $token = $_GET['token']; $agreement = new \PayPal\Api\Agreement(); try {

Execute Agreement

Execute the agreement by passing in the token

$agreement->execute($token, $apiContext); - } catch (Exception $ex) {

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

ResultPrinter::printError("Executed an Agreement", "Agreement", $agreement->getId(), $_GET['token'], $ex); + } 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); }

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) {

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

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); - } 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 696d12e..66e6fd5 100644 --- a/sample/doc/billing/GetBillingAgreement.html +++ b/sample/doc/billing/GetBillingAgreement.html @@ -8,7 +8,7 @@ API used: /v1/payments/billing-agreements/

try { $agreement = Agreement::get($createdAgreement->getId(), $apiContext); -} catch (Exception $ex) {

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

ResultPrinter::printError("Retrieved an Agreement", "Agreement", $agreement->getId(), $createdAgreement->getId(), $ex); +} 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); }

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); diff --git a/sample/doc/billing/GetPlan.html b/sample/doc/billing/GetPlan.html index 83eb7d6..55c2544 100644 --- a/sample/doc/billing/GetPlan.html +++ b/sample/doc/billing/GetPlan.html @@ -8,7 +8,7 @@ API used: /v1/payments/billing-plans

< try { $plan = Plan::get($createdPlan->getId(), $apiContext); -} catch (Exception $ex) {

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

ResultPrinter::printError("Retrieved a Plan", "Plan", $plan->getId(), null, $ex); +} catch (Exception $ex) {

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

ResultPrinter::printError("Retrieved a Plan", "Plan", $plan->getId(), null, $ex); exit(1); }

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

ResultPrinter::printResult("Retrieved a Plan", "Plan", $plan->getId(), null, $plan); diff --git a/sample/doc/billing/ListPlans.html b/sample/doc/billing/ListPlans.html index e4f58ff..f131b17 100644 --- a/sample/doc/billing/ListPlans.html +++ b/sample/doc/billing/ListPlans.html @@ -11,7 +11,7 @@ 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) {

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

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); }

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

ResultPrinter::printResult("List of Plans", "Plan", null, $params, $planList); diff --git a/sample/doc/billing/ReactivateBillingAgreement.html b/sample/doc/billing/ReactivateBillingAgreement.html index b3c8ad8..103fec4 100644 --- a/sample/doc/billing/ReactivateBillingAgreement.html +++ b/sample/doc/billing/ReactivateBillingAgreement.html @@ -12,9 +12,7 @@ API used: /v1/payments/billing-agreements//suspend

$agreementStateDescriptor->setNote("Reactivating the agreement"); try { - $suspendedAgreement->reActivate($agreementStateDescriptor, $apiContext);

Lets get the updated Agreement Object

$agreement = Agreement::get($suspendedAgreement->getId(), $apiContext); - } catch (Exception $ex) {

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

ResultPrinter::printResult("Reactivate the Agreement", "Agreement", $agreement->getId(), $suspendedAgreement, $ex); 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); diff --git a/sample/doc/billing/SearchBillingTransactions.html b/sample/doc/billing/SearchBillingTransactions.html index 3c37e1a..ae4a0be 100644 --- a/sample/doc/billing/SearchBillingTransactions.html +++ b/sample/doc/billing/SearchBillingTransactions.html @@ -8,7 +8,7 @@ API used: GET /v1/payments/billing-agreements//transactions? start try { $result = Agreement::searchTransactions($agreementId, $params, $apiContext); -} catch (Exception $ex) {

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

ResultPrinter::printError("Search for Transactions", "AgreementTransaction", $agreementId, null, $ex); +} 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); }

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

ResultPrinter::printResult("Search for Transactions", "AgreementTransaction", $agreementId, $params, $result); diff --git a/sample/doc/billing/SuspendBillingAgreement.html b/sample/doc/billing/SuspendBillingAgreement.html index 93a610c..42de872 100644 --- a/sample/doc/billing/SuspendBillingAgreement.html +++ b/sample/doc/billing/SuspendBillingAgreement.html @@ -12,10 +12,8 @@ API used: /v1/payments/billing-agreements//suspend

$agreementStateDescriptor->setNote("Suspending the agreement"); try { - $createdAgreement->suspend($agreementStateDescriptor, $apiContext);

Lets get the updated Agreement Object

$agreement = Agreement::get($createdAgreement->getId(), $apiContext); - -} catch (Exception $ex) {

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

ResultPrinter::printError("Suspended the Agreement", "Agreement", null, $agreementStateDescriptor, $ex); +} 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); }

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

ResultPrinter::printResult("Suspended the Agreement", "Agreement", $agreement->getId(), $agreementStateDescriptor, $agreement); diff --git a/sample/doc/billing/UpdateBillingAgreement.html b/sample/doc/billing/UpdateBillingAgreement.html index b1ed68e..94d22f7 100644 --- a/sample/doc/billing/UpdateBillingAgreement.html +++ b/sample/doc/billing/UpdateBillingAgreement.html @@ -26,8 +26,7 @@ API used: /v1/payments/billing-agreements/

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

Lets get the updated Agreement Object

$agreement = Agreement::get($createdAgreement->getId(), $apiContext); - -} catch (Exception $ex) {

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

ResultPrinter::printError("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); }

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); diff --git a/sample/doc/billing/UpdatePlan.html b/sample/doc/billing/UpdatePlan.html index b7274ee..90c7184 100644 --- a/sample/doc/billing/UpdatePlan.html +++ b/sample/doc/billing/UpdatePlan.html @@ -26,8 +26,7 @@ API used: /v1/payments/billing-plans/

$createdPlan->update($patchRequest, $apiContext); $plan = Plan::get($createdPlan->getId(), $apiContext); - -} catch (Exception $ex) {

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

ResultPrinter::printError("Updated the Plan to Active State", "Plan", null, $patchRequest, $ex); +} 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); }

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); diff --git a/sample/doc/billing/UpdatePlanPaymentDefinitions.html b/sample/doc/billing/UpdatePlanPaymentDefinitions.html index c11e75e..a7481e6 100644 --- a/sample/doc/billing/UpdatePlanPaymentDefinitions.html +++ b/sample/doc/billing/UpdatePlanPaymentDefinitions.html @@ -32,8 +32,7 @@ API used: /v1/payments/billing-plans/

$createdPlan->update($patchRequest, $apiContext); $plan = Plan::get($createdPlan->getId(), $apiContext); - -} catch (Exception $ex) {

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

ResultPrinter::printError("Updated the Plan Payment Definition", "Plan", null, $patchRequest, $ex); +} 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); }

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); diff --git a/sample/doc/invoice/CancelInvoice.html b/sample/doc/invoice/CancelInvoice.html index d0f44c5..878ae92 100644 --- a/sample/doc/invoice/CancelInvoice.html +++ b/sample/doc/invoice/CancelInvoice.html @@ -20,6 +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) {

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

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); }

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 d86432d..d5f2d71 100644 --- a/sample/doc/invoice/CreateInvoice.html +++ b/sample/doc/invoice/CreateInvoice.html @@ -109,7 +109,7 @@ 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) {

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

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); }

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

ResultPrinter::printResult("Create Invoice", "Invoice", $invoice->getId(), $request, $invoice); diff --git a/sample/doc/invoice/CreateThirdPartyInvoice.html b/sample/doc/invoice/CreateThirdPartyInvoice.html index e61f768..727e4aa 100644 --- a/sample/doc/invoice/CreateThirdPartyInvoice.html +++ b/sample/doc/invoice/CreateThirdPartyInvoice.html @@ -63,7 +63,7 @@ detailed breakdown of invoice

try {

Use Refresh Token. MAKE SURE TO update MerchantInfo.Email based on

$invoice->updateAccessToken($refreshToken, $apiContext);

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) {

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

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); }

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

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

Send Invoice

try {

Send Invoice

$invoice->send($apiContext); $invoice = Invoice::get($invoice->getId(), $apiContext); diff --git a/sample/doc/invoice/DeleteInvoice.html b/sample/doc/invoice/DeleteInvoice.html index 96866d9..4db205e 100644 --- a/sample/doc/invoice/DeleteInvoice.html +++ b/sample/doc/invoice/DeleteInvoice.html @@ -11,6 +11,6 @@ an invoice.

$deleteStatus = $invoice->delete($apiContext); -} catch (Exception $ex) {

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

ResultPrinter::printError("Delete Invoice", "Invoice", null, $deleteStatus, $ex); +} 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); }

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 a947c50..934ca74 100644 --- a/sample/doc/invoice/GetInvoice.html +++ b/sample/doc/invoice/GetInvoice.html @@ -11,7 +11,7 @@ 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) {

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

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); }

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

ResultPrinter::printResult("Get Invoice", "Invoice", $invoice->getId(), $invoiceId, $invoice); diff --git a/sample/doc/invoice/GetNextInvoiceNumber.html b/sample/doc/invoice/GetNextInvoiceNumber.html index a24dd85..dffea61 100644 --- a/sample/doc/invoice/GetNextInvoiceNumber.html +++ b/sample/doc/invoice/GetNextInvoiceNumber.html @@ -5,7 +5,7 @@ the next invoice number.

<

To generate the successive invoice number for the merchant, use below code. (See bootstrap.php for more on ApiContext)

try { $number = Invoice::generateNumber($apiContext); -} catch (Exception $ex) {

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

ResultPrinter::printError("Get Next Invoice Number", "InvoiceNumber", null, null, $ex); +} catch (Exception $ex) {

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

ResultPrinter::printError("Get Next Invoice Number", "InvoiceNumber", null, null, $ex); exit(1); }

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

ResultPrinter::printResult("Get Next Invoice Number", "InvoiceNumber", null, $number, $number); diff --git a/sample/doc/invoice/ListInvoice.html b/sample/doc/invoice/ListInvoice.html index 2761bb8..458768c 100644 --- a/sample/doc/invoice/ListInvoice.html +++ b/sample/doc/invoice/ListInvoice.html @@ -9,6 +9,6 @@ all invoice from history.

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) {

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

ResultPrinter::printError("Lookup Invoice History", "Invoice", null, null, $ex); +} catch (Exception $ex) {

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

ResultPrinter::printError("Lookup Invoice History", "Invoice", null, null, $ex); exit(1); }

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

ResultPrinter::printResult("Lookup Invoice History", "Invoice", null, null, $invoices);
\ No newline at end of file diff --git a/sample/doc/invoice/RecordPayment.html b/sample/doc/invoice/RecordPayment.html index 1ce68f5..16276ad 100644 --- a/sample/doc/invoice/RecordPayment.html +++ b/sample/doc/invoice/RecordPayment.html @@ -20,7 +20,7 @@ You can use the new way of injecting json directly to the object.

ApiContext)

$recordStatus = $invoice->recordPayment($record, $apiContext); -} catch (Exception $ex) {

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

ResultPrinter::printError("Payment for Invoice", "Invoice", null, null, $ex); +} 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); }

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 @@ -29,7 +29,7 @@ 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) {

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); +} 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); }

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); diff --git a/sample/doc/invoice/RecordRefund.html b/sample/doc/invoice/RecordRefund.html index 28c132a..b6a9fef 100644 --- a/sample/doc/invoice/RecordRefund.html +++ b/sample/doc/invoice/RecordRefund.html @@ -19,7 +19,7 @@ You can use the new way of injecting json directly to the object.

ApiContext)

$refundStatus = $invoice->recordRefund($refund, $apiContext); -} catch (Exception $ex) {

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

ResultPrinter::printError("Refund for Invoice", "Invoice", null, null, $ex); +} 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); }

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 @@ -28,7 +28,7 @@ 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) {

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); +} 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); }

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); diff --git a/sample/doc/invoice/RemindInvoice.html b/sample/doc/invoice/RemindInvoice.html index a8019d3..8f4b21f 100644 --- a/sample/doc/invoice/RemindInvoice.html +++ b/sample/doc/invoice/RemindInvoice.html @@ -19,7 +19,7 @@ and payer is retrieved from the invoice details

ApiContext)

$remindStatus = $invoice->remind($notify, $apiContext); -} catch (Exception $ex) {

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

ResultPrinter::printError("Remind Invoice", "Invoice", null, $notify, $ex); +} 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); }

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 @@ -28,7 +28,7 @@ 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) {

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); +} 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); }

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); diff --git a/sample/doc/invoice/RetrieveQRCode.html b/sample/doc/invoice/RetrieveQRCode.html index 6682db9..976db68 100644 --- a/sample/doc/invoice/RetrieveQRCode.html +++ b/sample/doc/invoice/RetrieveQRCode.html @@ -13,9 +13,7 @@ notification object

This is not a required step. However, if you want to store this image as a file, you can use 'saveToFile' method with proper file name. This will save the image as /samples/invoice/images/sample.png

$path = $image->saveToFile("images/sample.png"); - - -} catch (Exception $ex) {

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

ResultPrinter::printError("Retrieved QR Code for Invoice", "Invoice", $invoice->getId(), null, $ex); +} 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); }

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/doc/invoice/SearchInvoices.html b/sample/doc/invoice/SearchInvoices.html index 3431699..d9735eb 100644 --- a/sample/doc/invoice/SearchInvoices.html +++ b/sample/doc/invoice/SearchInvoices.html @@ -20,6 +20,6 @@ Using the new way to inject raw json string to constructor

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) {

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

ResultPrinter::printError("Search Invoice", "Invoice", null, null, $ex); +} catch (Exception $ex) {

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

ResultPrinter::printError("Search Invoice", "Invoice", null, null, $ex); exit(1); }

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

ResultPrinter::printResult("Search Invoice", "Invoice", null, $search, $invoices);
\ No newline at end of file diff --git a/sample/doc/invoice/SendInvoice.html b/sample/doc/invoice/SendInvoice.html index 3d93dcb..05b0b24 100644 --- a/sample/doc/invoice/SendInvoice.html +++ b/sample/doc/invoice/SendInvoice.html @@ -17,7 +17,7 @@ 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) {

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); +} 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); }

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); diff --git a/sample/doc/invoice/UpdateInvoice.html b/sample/doc/invoice/UpdateInvoice.html index d09f6bd..84d41a6 100644 --- a/sample/doc/invoice/UpdateInvoice.html +++ b/sample/doc/invoice/UpdateInvoice.html @@ -13,7 +13,7 @@ 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) {

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

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); }

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 @@ -22,7 +22,7 @@ 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) {

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); +} 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); }

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); diff --git a/sample/doc/lipp/GenerateAccessTokenFromRefreshToken.html b/sample/doc/lipp/GenerateAccessTokenFromRefreshToken.html index a00e32c..1e24725 100644 --- a/sample/doc/lipp/GenerateAccessTokenFromRefreshToken.html +++ b/sample/doc/lipp/GenerateAccessTokenFromRefreshToken.html @@ -2,10 +2,8 @@ use PayPal\Api\OpenIdTokeninfo;

You can retrieve the refresh token by executing ObtainUserConsent.php and store the refresh token

$refreshToken = 'yzX4AkmMyBKR4on7vB5he-tDu38s24Zy-kTibhSuqA8kTdy0Yinxj7NpAyULx0bxqC5G8dbXOt0aVMlMmtpiVmSzhcjVZhYDM7WUQLC9KpaXGBHyltJPkLLQkXE'; try { - $tokenInfo = new OpenIdTokeninfo(); $tokenInfo = $tokenInfo->createFromRefreshToken(array('refresh_token' => $refreshToken), $apiContext); - -} catch (Exception $ex) {

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

ResultPrinter::printError("Obtained Access Token From Refresh Token", "Access Token", null, null, $ex); +} catch (Exception $ex) {

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

ResultPrinter::printError("Obtained Access Token From Refresh Token", "Access Token", null, null, $ex); exit(1); }

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);
\ No newline at end of file diff --git a/sample/doc/lipp/GetUserInfo.html b/sample/doc/lipp/GetUserInfo.html index 86b5ba1..62d9eae 100644 --- a/sample/doc/lipp/GetUserInfo.html +++ b/sample/doc/lipp/GetUserInfo.html @@ -9,13 +9,11 @@ to retreive the information. The short lived access token can be retrieved using "GenerateAccessTokenFromRefreshToken.php", or as shown below

You can retrieve the refresh token by executing ObtainUserConsent.php and store the refresh token

$refreshToken = 'W1JmxG-Cogm-4aSc5Vlen37XaQTj74aQcQiTtXax5UgY7M_AJ--kLX8xNVk8LtCpmueFfcYlRK6UgQLJ-XHsxpw6kZzPpKKccRQeC4z2ldTMfXdIWajZ6CHuebs'; try { - $tokenInfo = new OpenIdTokeninfo(); $tokenInfo = $tokenInfo->createFromRefreshToken(array('refresh_token' => $refreshToken), $apiContext); $params = array('access_token' => $tokenInfo->getAccessToken()); $userInfo = OpenIdUserinfo::getUserinfo($params, $apiContext); - -} catch (Exception $ex) {

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

ResultPrinter::printError("User Information", "User Info", null, $params, $ex); +} catch (Exception $ex) {

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

ResultPrinter::printError("User Information", "User Info", null, $params, $ex); exit(1); }

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

ResultPrinter::printResult("User Information", "User Info", $userInfo->getUserId(), $params, $userInfo);
\ No newline at end of file diff --git a/sample/doc/lipp/ObtainUserConsent.html b/sample/doc/lipp/ObtainUserConsent.html index 70f205d..69c66bf 100644 --- a/sample/doc/lipp/ObtainUserConsent.html +++ b/sample/doc/lipp/ObtainUserConsent.html @@ -9,7 +9,7 @@ $redirectUrl = OpenIdSession::getAuthorizationUrl( $baseUrl, array('openid', 'profile', 'address', 'email', 'phone', - 'https://uri.paypal.com/services/paypalattributes', + 'https://uri.paypal.com/services/paypalattributes', 'https://uri.paypal.com/services/expresscheckout', 'https://uri.paypal.com/services/invoicing'), null, diff --git a/sample/doc/lipp/UserConsentRedirect.html b/sample/doc/lipp/UserConsentRedirect.html index d4e9de8..5373232 100644 --- a/sample/doc/lipp/UserConsentRedirect.html +++ b/sample/doc/lipp/UserConsentRedirect.html @@ -8,12 +8,10 @@ session_start();

PayPal would redirect the user to the redirect_uri mentioned when creating the consent URL. The user would then able to retrieve the access token by getting the code, which is returned as a GET parameter.

if (isset($_GET['success']) && $_GET['success'] == 'true') { - $code = $_GET['code']; try {

Obtain Authorization Code from Code, Client ID and Client Secret

$accessToken = OpenIdTokeninfo::createFromAuthorizationCode(array('code' => $code), null, null, $apiContext); - } catch (PayPalConnectionException $ex) {

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

ResultPrinter::printError("Obtained Access Token", "Access Token", null, $_GET['code'], $ex); + } 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); }

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 c972212..0a76b53 100644 --- a/sample/doc/notifications/CreateWebhook.html +++ b/sample/doc/notifications/CreateWebhook.html @@ -35,14 +35,14 @@ be using this in production

catch (Exception $ex) {
// Ignore workflow code segment
// 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 <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) { + 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 {

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

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 {

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

ResultPrinter::printError("Created Webhook", "Webhook", null, $request, $ex); diff --git a/sample/doc/notifications/DeleteAllWebhooks.html b/sample/doc/notifications/DeleteAllWebhooks.html index 06a9281..d5c80b0 100644 --- a/sample/doc/notifications/DeleteAllWebhooks.html +++ b/sample/doc/notifications/DeleteAllWebhooks.html @@ -5,7 +5,7 @@ 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) {

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

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); }

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); diff --git a/sample/doc/notifications/DeleteWebhook.html b/sample/doc/notifications/DeleteWebhook.html index d5f4f78..8eb151b 100644 --- a/sample/doc/notifications/DeleteWebhook.html +++ b/sample/doc/notifications/DeleteWebhook.html @@ -4,7 +4,7 @@ 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) {

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

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); }

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

ResultPrinter::printResult("Delete a Webhook", "Webhook", $webhook->getId(), null, null); diff --git a/sample/doc/notifications/GetWebhook.html b/sample/doc/notifications/GetWebhook.html index 9782ded..a03915f 100644 --- a/sample/doc/notifications/GetWebhook.html +++ b/sample/doc/notifications/GetWebhook.html @@ -7,7 +7,7 @@ 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) {

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

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); }

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

ResultPrinter::printResult("Get a Webhook", "Webhook", $output->getId(), null, $output); diff --git a/sample/doc/notifications/ListSubscribedWebhookEventTypes.html b/sample/doc/notifications/ListSubscribedWebhookEventTypes.html index c4d28bc..2b4a8ec 100644 --- a/sample/doc/notifications/ListSubscribedWebhookEventTypes.html +++ b/sample/doc/notifications/ListSubscribedWebhookEventTypes.html @@ -6,8 +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) {

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); +} 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); -}

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); +}

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 6923e56..275db13 100644 --- a/sample/doc/notifications/ListWebhooks.html +++ b/sample/doc/notifications/ListWebhooks.html @@ -6,8 +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) {

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

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); -}

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

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 86d4de3..266f726 100644 --- a/sample/doc/notifications/SearchWebhookEvents.html +++ b/sample/doc/notifications/SearchWebhookEvents.html @@ -10,7 +10,7 @@ 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) {

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

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); }

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

ResultPrinter::printResult("Search Webhook events", "WebhookEventList", null, $params, $output); diff --git a/sample/doc/notifications/UpdateWebhook.html b/sample/doc/notifications/UpdateWebhook.html index fa7a5bf..c2b7b9d 100644 --- a/sample/doc/notifications/UpdateWebhook.html +++ b/sample/doc/notifications/UpdateWebhook.html @@ -33,7 +33,7 @@ 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) {

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

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); }

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

ResultPrinter::printResult("Updated a Webhook", "Webhook", $output->getId(), $patchRequest, $output); diff --git a/sample/doc/notifications/WebhookEventTypesList.html b/sample/doc/notifications/WebhookEventTypesList.html index c7ef783..9be884d 100644 --- a/sample/doc/notifications/WebhookEventTypesList.html +++ b/sample/doc/notifications/WebhookEventTypesList.html @@ -3,7 +3,7 @@ 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) {

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); +} 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); }

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); diff --git a/sample/doc/payment-experience/CreateWebProfile.html b/sample/doc/payment-experience/CreateWebProfile.html index 8e2202a..1d81b91 100644 --- a/sample/doc/payment-experience/CreateWebProfile.html +++ b/sample/doc/payment-experience/CreateWebProfile.html @@ -6,7 +6,7 @@ Documentation available at
$flowConfig = new \PayPal\Api\FlowConfig();
\ No newline at end of file diff --git a/sample/doc/payment-experience/GetWebProfile.html b/sample/doc/payment-experience/GetWebProfile.html index c8621f5..2191446 100644 --- a/sample/doc/payment-experience/GetWebProfile.html +++ b/sample/doc/payment-experience/GetWebProfile.html @@ -7,7 +7,7 @@ that contains the web profile ID.

$createProfileResponse = require 'CreateWebProfile.php'; 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) {

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); +} catch (\PayPal\Exception\PayPalConnectionException $ex) {

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

ResultPrinter::printError("Get Web Profile", "Web Profile", $webProfile->getId(), null, $ex); exit(1); }

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); diff --git a/sample/doc/payment-experience/ListWebProfiles.html b/sample/doc/payment-experience/ListWebProfiles.html index e60753e..784dd4c 100644 --- a/sample/doc/payment-experience/ListWebProfiles.html +++ b/sample/doc/payment-experience/ListWebProfiles.html @@ -5,7 +5,7 @@ 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) {

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); +} 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 = ''; diff --git a/sample/doc/payment-experience/PartiallyUpdateWebProfile.html b/sample/doc/payment-experience/PartiallyUpdateWebProfile.html index 0998901..e94c6d7 100644 --- a/sample/doc/payment-experience/PartiallyUpdateWebProfile.html +++ b/sample/doc/payment-experience/PartiallyUpdateWebProfile.html @@ -17,6 +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) {

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); +} 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); }

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 5e4a360..4519663 100644 --- a/sample/doc/payment-experience/UpdateWebProfile.html +++ b/sample/doc/payment-experience/UpdateWebProfile.html @@ -7,6 +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) {

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); +} 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); }

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 76963f6..e7d996a 100644 --- a/sample/doc/payments/AuthorizationCapture.html +++ b/sample/doc/payments/AuthorizationCapture.html @@ -19,7 +19,7 @@ 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) {

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

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); }

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

ResultPrinter::printResult("Capture Payment", "Authorization", $getCapture->getId(), $capture, $getCapture); diff --git a/sample/doc/payments/AuthorizePayment.html b/sample/doc/payments/AuthorizePayment.html index 53e7743..2920ecc 100644 --- a/sample/doc/payments/AuthorizePayment.html +++ b/sample/doc/payments/AuthorizePayment.html @@ -52,7 +52,7 @@ authorization. Setting it to sale creates actual payment

ApiContext) The return object contains the state.

try { $payment->create($apiContext); -} catch (Exception $ex) {

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

ResultPrinter::printError('Authorize a Payment', 'Authorized Payment', $payment->getId(), $request, $ex); +} 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); }

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); diff --git a/sample/doc/payments/AuthorizePaymentUsingPayPal.html b/sample/doc/payments/AuthorizePaymentUsingPayPal.html index 0c548f2..8c4f264 100644 --- a/sample/doc/payments/AuthorizePaymentUsingPayPal.html +++ b/sample/doc/payments/AuthorizePaymentUsingPayPal.html @@ -67,7 +67,7 @@ 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) {

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); +} catch (Exception $ex) {

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

ResultPrinter::printError("Created Payment Authorization Using PayPal. Please visit the URL to Authorize.", "Payment", null, $request, $ex); exit(1); }

Get redirect url

The API response provides the url that you must redirect diff --git a/sample/doc/payments/CreateFuturePayment.html b/sample/doc/payments/CreateFuturePayment.html index 0fb1e81..14c4516 100644 --- a/sample/doc/payments/CreateFuturePayment.html +++ b/sample/doc/payments/CreateFuturePayment.html @@ -46,8 +46,7 @@ The return object contains the state and the 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) {

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

ResultPrinter::printError("Future Payment", "Payment", null, $payment, $ex); +} catch (Exception $ex) {

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

ResultPrinter::printError("Future Payment", "Payment", null, $payment, $ex); exit(1); }

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

ResultPrinter::printResult("Future Payment", "Payment", $payment->getId(), $request, $payment); diff --git a/sample/doc/payments/CreatePayment.html b/sample/doc/payments/CreatePayment.html index d04b12a..7035052 100644 --- a/sample/doc/payments/CreatePayment.html +++ b/sample/doc/payments/CreatePayment.html @@ -77,7 +77,7 @@ the above types and intent set to sale 'sale'

ApiContext) The return object contains the state.

try { $payment->create($apiContext); -} catch (Exception $ex) {

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

ResultPrinter::printError('Create Payment Using Credit Card. If 500 Exception, try creating a new Credit Card using <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); }

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); diff --git a/sample/doc/payments/CreatePaymentUsingPayPal.html b/sample/doc/payments/CreatePaymentUsingPayPal.html index 6e917a2..3f2f985 100644 --- a/sample/doc/payments/CreatePaymentUsingPayPal.html +++ b/sample/doc/payments/CreatePaymentUsingPayPal.html @@ -67,7 +67,7 @@ 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) {

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); +} 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 diff --git a/sample/doc/payments/CreatePaymentUsingSavedCard.html b/sample/doc/payments/CreatePaymentUsingSavedCard.html index c6a121d..452980f 100644 --- a/sample/doc/payments/CreatePaymentUsingSavedCard.html +++ b/sample/doc/payments/CreatePaymentUsingSavedCard.html @@ -68,7 +68,7 @@ passing it a valid apiContext. (See bootstrap.php for more on ApiContext) The return object contains the state.

try { $payment->create($apiContext); -} catch (Exception $ex) {

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

ResultPrinter::printError("Create Payment using Saved Card", "Payment", null, $request, $ex); +} catch (Exception $ex) {

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

ResultPrinter::printError("Create Payment using Saved Card", "Payment", null, $request, $ex); exit(1); }

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); diff --git a/sample/doc/payments/ExecutePayment.html b/sample/doc/payments/ExecutePayment.html index f1fc85f..98211df 100644 --- a/sample/doc/payments/ExecutePayment.html +++ b/sample/doc/payments/ExecutePayment.html @@ -44,16 +44,14 @@ Here is the example on how we changed the shipping to $1 more than before.

try { $payment = Payment::get($paymentId, $apiContext); - } catch (Exception $ex) {

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

ResultPrinter::printError("Get Payment", "Payment", null, null, $ex); + } 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) {

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

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); }

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; }
\ No newline at end of file diff --git a/sample/doc/payments/GetAuthorization.html b/sample/doc/payments/GetAuthorization.html index 922e9c0..82401f5 100644 --- a/sample/doc/payments/GetAuthorization.html +++ b/sample/doc/payments/GetAuthorization.html @@ -9,7 +9,7 @@ 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) {

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

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); }

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

ResultPrinter::printResult("Get Authorization", "Authorization", $authorizationId, null, $result); diff --git a/sample/doc/payments/GetCapture.html b/sample/doc/payments/GetCapture.html index cdd7230..c054f3e 100644 --- a/sample/doc/payments/GetCapture.html +++ b/sample/doc/payments/GetCapture.html @@ -8,6 +8,6 @@ API used: /v1/payments/capture/<$captureId>

try { $capture = Capture::get($request->getId(), $apiContext); -} catch (Exception $ex) {

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

ResultPrinter::printError("Get Captured Payment", "Capture", $request->getId(), null, $ex); +} 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); }

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 034eeba..d8ed527 100644 --- a/sample/doc/payments/GetPayment.html +++ b/sample/doc/payments/GetPayment.html @@ -16,7 +16,7 @@ on the Payment class by passing a valid Payment ID (See bootstrap.php for more on ApiContext)

try { $payment = Payment::get($paymentId, $apiContext); -} catch (Exception $ex) {

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

ResultPrinter::printError("Get Payment", "Payment", null, null, $ex); +} 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); }

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

ResultPrinter::printResult("Get Payment", "Payment", $payment->getId(), null, $payment); diff --git a/sample/doc/payments/ListPayments.html b/sample/doc/payments/ListPayments.html index ca0514a..5ced04c 100644 --- a/sample/doc/payments/ListPayments.html +++ b/sample/doc/payments/ListPayments.html @@ -13,10 +13,9 @@ and pass a Map object that contains query parameters for paginations and filtering. Refer the method doc for valid values for keys (See bootstrap.php for more on ApiContext)

try { - $params = array('count' => 10, 'start_index' => 5); $payments = Payment::all($params, $apiContext); -} catch (Exception $ex) {

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

ResultPrinter::printError("List Payments", "Payment", null, $params, $ex); +} 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); }

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 37b8f7e..1f7dcb4 100644 --- a/sample/doc/payments/OrderAuthorize.html +++ b/sample/doc/payments/OrderAuthorize.html @@ -22,12 +22,11 @@ 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);

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); + } 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 {

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 1484dd2..70bd553 100644 --- a/sample/doc/payments/OrderCapture.html +++ b/sample/doc/payments/OrderCapture.html @@ -23,12 +23,11 @@ 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);

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); + } 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 {

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 9630749..4a87f53 100644 --- a/sample/doc/payments/OrderCreateForAuthorization.html +++ b/sample/doc/payments/OrderCreateForAuthorization.html @@ -64,7 +64,7 @@ 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) {

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); +} 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 diff --git a/sample/doc/payments/OrderCreateForCapture.html b/sample/doc/payments/OrderCreateForCapture.html index 3ba9869..bff949c 100644 --- a/sample/doc/payments/OrderCreateForCapture.html +++ b/sample/doc/payments/OrderCreateForCapture.html @@ -64,7 +64,7 @@ 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) {

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); +} 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 diff --git a/sample/doc/payments/OrderCreateForVoid.html b/sample/doc/payments/OrderCreateForVoid.html index e877d97..4492e28 100644 --- a/sample/doc/payments/OrderCreateForVoid.html +++ b/sample/doc/payments/OrderCreateForVoid.html @@ -64,7 +64,7 @@ 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) {

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); +} 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 diff --git a/sample/doc/payments/OrderCreateUsingPayPal.html b/sample/doc/payments/OrderCreateUsingPayPal.html index d1eb8e1..835d98f 100644 --- a/sample/doc/payments/OrderCreateUsingPayPal.html +++ b/sample/doc/payments/OrderCreateUsingPayPal.html @@ -64,7 +64,7 @@ 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) {

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); +} 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 diff --git a/sample/doc/payments/OrderDoVoid.html b/sample/doc/payments/OrderDoVoid.html index 2773f36..13ae352 100644 --- a/sample/doc/payments/OrderDoVoid.html +++ b/sample/doc/payments/OrderDoVoid.html @@ -12,12 +12,11 @@ API used: POST /v1/payments/orders//do-void

try {

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) {

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

ResultPrinter::printError("Voided Order", "Order", null, null, $ex); + } 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 {

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 411f6f1..42e5751 100644 --- a/sample/doc/payments/OrderGet.html +++ b/sample/doc/payments/OrderGet.html @@ -3,7 +3,6 @@ API used: GET /v1/payments/orders/

/** @var \PayPal\Api\Payment $payment */ $payment = require __DIR__ . '/ExecutePayment.php';

Approval Status

Determine if the user approved the payment or not

if (isset($_GET['success']) && $_GET['success'] == 'true') { - $transactions = $payment->getTransactions(); $transaction = $transactions[0]; $relatedResources = $transaction->getRelatedResources(); @@ -12,12 +11,11 @@ API used: GET /v1/payments/orders/

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) {

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

ResultPrinter::printError("Get Order", "Order", null, null, $ex); + } 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 {

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 e4a15ac..a247ab5 100644 --- a/sample/doc/payments/Reauthorization.html +++ b/sample/doc/payments/Reauthorization.html @@ -9,12 +9,11 @@ API used: v1/payments/authorization/{authorization_id}/reauthorize

You can reauthorize a payment only once 4 to 29 days after the 3-day honor period for the original authorization has expired.

try { - $amount = new Amount(); $amount->setCurrency("USD"); $amount->setTotal(1);

Reauthorize with amount being reauthorized

$authorization->setAmount($amount); $reAuthorization = $authorization->reauthorize($apiContext); -} catch (Exception $ex) {

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

ResultPrinter::printError("Reauthorize Payment", "Payment", null, null, $ex); +} 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); }

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 fbcb2a4..85a1119 100644 --- a/sample/doc/payments/RefundCapture.html +++ b/sample/doc/payments/RefundCapture.html @@ -14,6 +14,6 @@ refund amount and call the refund method

$apiContext = getApiContext($clientId, $clientSecret); $captureRefund = $capture->refund($refund, $apiContext); -} catch (Exception $ex) {

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

ResultPrinter::printError("Refund Capture", "Capture", null, $refund, $ex); +} 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); }

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 025ecab..153b5ee 100644 --- a/sample/doc/payments/UpdatePayment.html +++ b/sample/doc/payments/UpdatePayment.html @@ -71,8 +71,7 @@ on the Payment class by passing a valid Payment ID (See bootstrap.php for more on ApiContext)

try { $result = $createdPayment->update($patchRequest, $apiContext); - -} catch (Exception $ex) {

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

ResultPrinter::printError("Update Payment", "PatchRequest", null, $patchRequest, $ex); +} 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); }

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

diff --git a/sample/doc/payments/VoidAuthorization.html b/sample/doc/payments/VoidAuthorization.html index daeecf8..ddbe818 100644 --- a/sample/doc/payments/VoidAuthorization.html +++ b/sample/doc/payments/VoidAuthorization.html @@ -7,7 +7,7 @@ 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) {

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

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); }

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

ResultPrinter::printResult("Void Authorization", "Authorization", $voidedAuth->getId(), null, $voidedAuth); diff --git a/sample/doc/payouts/CancelPayoutItem.html b/sample/doc/payouts/CancelPayoutItem.html index 5e25155..997397a 100644 --- a/sample/doc/payouts/CancelPayoutItem.html +++ b/sample/doc/payouts/CancelPayoutItem.html @@ -11,9 +11,9 @@ API used: POST /v1/payments/payouts-item//cancel

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);

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")); +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) {

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

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 79c2f0e..9933e6b 100644 --- a/sample/doc/payouts/CreateBatchPayout.html +++ b/sample/doc/payouts/CreateBatchPayout.html @@ -83,7 +83,7 @@ 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) {

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

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); }

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); diff --git a/sample/doc/payouts/CreateSinglePayout.html b/sample/doc/payouts/CreateSinglePayout.html index f948d0b..471a7bc 100644 --- a/sample/doc/payouts/CreateSinglePayout.html +++ b/sample/doc/payouts/CreateSinglePayout.html @@ -38,7 +38,7 @@ 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) {

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

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); }

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); diff --git a/sample/doc/payouts/GetPayoutBatchStatus.html b/sample/doc/payouts/GetPayoutBatchStatus.html index f86ea07..6f28674 100644 --- a/sample/doc/payouts/GetPayoutBatchStatus.html +++ b/sample/doc/payouts/GetPayoutBatchStatus.html @@ -5,7 +5,7 @@ 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) {

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

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); }

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); diff --git a/sample/doc/payouts/GetPayoutItemStatus.html b/sample/doc/payouts/GetPayoutItemStatus.html index bfd89bf..ccba29f 100644 --- a/sample/doc/payouts/GetPayoutItemStatus.html +++ b/sample/doc/payouts/GetPayoutItemStatus.html @@ -7,7 +7,7 @@ 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) {

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

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); }

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); diff --git a/sample/doc/sale/GetSale.html b/sample/doc/sale/GetSale.html index f545e16..1105b9e 100644 --- a/sample/doc/sale/GetSale.html +++ b/sample/doc/sale/GetSale.html @@ -14,7 +14,7 @@ API used: /v1/payments/sale/{sale-id}

try {

Retrieve the sale object

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

$sale = Sale::get($saleId, $apiContext); -} catch (Exception $ex) {

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

ResultPrinter::printError("Look Up A Sale", "Sale", $sale->getId(), null, $ex); +} catch (Exception $ex) {

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

ResultPrinter::printError("Look Up A Sale", "Sale", $sale->getId(), null, $ex); exit(1); }

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); diff --git a/sample/doc/sale/RefundSale.html b/sample/doc/sale/RefundSale.html index d013389..8f9909b 100644 --- a/sample/doc/sale/RefundSale.html +++ b/sample/doc/sale/RefundSale.html @@ -22,7 +22,7 @@ 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) {

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

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); }

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

ResultPrinter::printResult("Refund Sale", "Sale", $refundedSale->getId(), $refund, $refundedSale); diff --git a/sample/doc/vault/CreateBankAccount.html b/sample/doc/vault/CreateBankAccount.html index cff0a65..39c0a7e 100644 --- a/sample/doc/vault/CreateBankAccount.html +++ b/sample/doc/vault/CreateBankAccount.html @@ -58,7 +58,7 @@ 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) {

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

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); }

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); diff --git a/sample/doc/vault/CreateCreditCard.html b/sample/doc/vault/CreateCreditCard.html index 6fd5db4..cfcaffd 100644 --- a/sample/doc/vault/CreateCreditCard.html +++ b/sample/doc/vault/CreateCreditCard.html @@ -27,7 +27,7 @@ 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) {

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

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); }

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); diff --git a/sample/doc/vault/DeleteBankAccount.html b/sample/doc/vault/DeleteBankAccount.html index d1bd5ff..439fbd5 100644 --- a/sample/doc/vault/DeleteBankAccount.html +++ b/sample/doc/vault/DeleteBankAccount.html @@ -8,6 +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) {

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

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); }

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 cdfb9aa..25295fd 100644 --- a/sample/doc/vault/DeleteCreditCard.html +++ b/sample/doc/vault/DeleteCreditCard.html @@ -9,6 +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) {

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

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); }

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 42488d1..bb6c4b3 100644 --- a/sample/doc/vault/GetBankAccount.html +++ b/sample/doc/vault/GetBankAccount.html @@ -7,7 +7,7 @@ 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) {

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); +} 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); }

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); diff --git a/sample/doc/vault/GetCreditCard.html b/sample/doc/vault/GetCreditCard.html index 7f2c190..18ad21c 100644 --- a/sample/doc/vault/GetCreditCard.html +++ b/sample/doc/vault/GetCreditCard.html @@ -11,7 +11,7 @@ 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) {

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); +} 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); }