From 2f353688b4de3859b49ae74fa7c798dfb3b6baab Mon Sep 17 00:00:00 2001 From: Prakash Gangadharan Date: Tue, 15 Oct 2019 23:30:16 +0530 Subject: [PATCH] Fix links to Developer API Reference #1302 * Fix links to Developer API Reference --- sample/billing/CreateBillingAgreementWithPayPal.php | 4 ++-- sample/billing/CreatePlan.php | 4 ++-- sample/billing/DeletePlan.php | 4 ++-- sample/billing/GetBillingAgreement.php | 4 ++-- sample/billing/GetPlan.php | 4 ++-- sample/billing/ListPlans.php | 4 ++-- sample/billing/ReactivateBillingAgreement.php | 4 ++-- sample/billing/SearchBillingTransactions.php | 4 ++-- sample/billing/SuspendBillingAgreement.php | 4 ++-- sample/billing/UpdateBillingAgreement.php | 4 ++-- sample/billing/UpdatePlan.php | 4 ++-- sample/billing/UpdatePlanPaymentDefinitions.php | 4 ++-- sample/doc/billing/CreateBillingAgreementWithPayPal.html | 4 ++-- sample/doc/billing/CreatePlan.html | 4 ++-- sample/doc/billing/DeletePlan.html | 4 ++-- sample/doc/billing/GetBillingAgreement.html | 4 ++-- sample/doc/billing/GetPlan.html | 4 ++-- sample/doc/billing/ListPlans.html | 6 +++--- sample/doc/billing/ReactivateBillingAgreement.html | 4 ++-- sample/doc/billing/SearchBillingTransactions.html | 4 ++-- sample/doc/billing/SuspendBillingAgreement.html | 4 ++-- sample/doc/billing/UpdateBillingAgreement.html | 4 ++-- sample/doc/billing/UpdatePlan.html | 4 ++-- sample/doc/billing/UpdatePlanPaymentDefinitions.html | 4 ++-- sample/doc/notifications/CreateWebhook.html | 2 +- sample/doc/notifications/DeleteWebhook.html | 2 +- sample/doc/notifications/GetWebhook.html | 2 +- .../doc/notifications/ListSubscribedWebhookEventTypes.html | 2 +- sample/doc/notifications/ListWebhooks.html | 2 +- sample/doc/notifications/SearchWebhookEvents.html | 2 +- sample/doc/notifications/UpdateWebhook.html | 2 +- sample/doc/notifications/ValidateWebhookEvent.html | 4 ++-- sample/doc/notifications/WebhookEventTypesList.html | 2 +- sample/notifications/CreateWebhook.php | 2 +- sample/notifications/DeleteWebhook.php | 4 ++-- sample/notifications/GetWebhook.php | 4 ++-- sample/notifications/ListSubscribedWebhookEventTypes.php | 4 ++-- sample/notifications/ListWebhooks.php | 2 +- sample/notifications/SearchWebhookEvents.php | 2 +- sample/notifications/UpdateWebhook.php | 4 ++-- sample/notifications/ValidateWebhookEvent.php | 4 ++-- sample/notifications/WebhookEventTypesList.php | 2 +- 42 files changed, 73 insertions(+), 73 deletions(-) diff --git a/sample/billing/CreateBillingAgreementWithPayPal.php b/sample/billing/CreateBillingAgreementWithPayPal.php index 5d666edb..65028f56 100644 --- a/sample/billing/CreateBillingAgreementWithPayPal.php +++ b/sample/billing/CreateBillingAgreementWithPayPal.php @@ -3,8 +3,8 @@ // # Create Billing Agreement with PayPal as Payment Source // // This sample code demonstrate how you can create a billing agreement, as documented here at: -// https://developer.paypal.com/docs/api/#create-an-agreement -// API used: /v1/payments/billing-agreements +// https://developer.paypal.com/docs/api/payments.billing-agreements/v1/#billing-agreements_post +// API used: POST /v1/payments/billing-agreements // Retrieving the Plan from the Create Update Sample. This would be used to // define Plan information to create an agreement. Make sure the plan you are using is in active state. diff --git a/sample/billing/CreatePlan.php b/sample/billing/CreatePlan.php index b6aa2021..6925d2d9 100644 --- a/sample/billing/CreatePlan.php +++ b/sample/billing/CreatePlan.php @@ -3,8 +3,8 @@ // # Create Plan Sample // // This sample code demonstrate how you can create a billing plan, as documented here at: -// https://developer.paypal.com/docs/api/#create-a-plan -// API used: /v1/payments/billing-plans +// https://developer.paypal.com/docs/api/payments.billing-plans/v1/#billing-plans_post +// API used: POST /v1/payments/billing-plans require __DIR__ . '/../bootstrap.php'; use PayPal\Api\ChargeModel; diff --git a/sample/billing/DeletePlan.php b/sample/billing/DeletePlan.php index b73a7ab3..6695aca0 100644 --- a/sample/billing/DeletePlan.php +++ b/sample/billing/DeletePlan.php @@ -3,8 +3,8 @@ // # Delete Plan Sample // // This sample code demonstrate how you can delete a billing plan, as documented here at: -// https://developer.paypal.com/docs/api/#retrieve-a-plan -// API used: /v1/payments/billing-plans +// https://developer.paypal.com/docs/api/payments.billing-plans/v1/#billing-plans_patch +// API used: PATCH /v1/payments/billing-plans/{plan_id} // Retrieving the Plan object from Create Plan Sample /** @var Plan $createdPlan */ diff --git a/sample/billing/GetBillingAgreement.php b/sample/billing/GetBillingAgreement.php index 3fda0341..32a2ffd0 100644 --- a/sample/billing/GetBillingAgreement.php +++ b/sample/billing/GetBillingAgreement.php @@ -3,8 +3,8 @@ // # Get Billing Agreement Sample // // This sample code demonstrate how you can get a billing agreement, as documented here at: -// https://developer.paypal.com/docs/api/#retrieve-an-agreement -// API used: /v1/payments/billing-agreements/ +// https://developer.paypal.com/docs/api/payments.billing-agreements/v1/#billing-agreements_get +// API used: GET /v1/payments/billing-agreements/{agreement_id} require __DIR__ . '/../bootstrap.php'; // Retrieving the Agreement object from Create Agreement From Credit Card Sample diff --git a/sample/billing/GetPlan.php b/sample/billing/GetPlan.php index 8f622d5f..b75e0a74 100644 --- a/sample/billing/GetPlan.php +++ b/sample/billing/GetPlan.php @@ -3,8 +3,8 @@ // # Get Plan Sample // // This sample code demonstrate how you can get a billing plan, as documented here at: -// https://developer.paypal.com/docs/api/#retrieve-a-plan -// API used: /v1/payments/billing-plans +// https://developer.paypal.com/docs/api/payments.billing-plans/v1/#billing-plans_get +// API used: GET /v1/payments/billing-plans // Retrieving the Plan object from Create Plan Sample /** @var Plan $createdPlan */ diff --git a/sample/billing/ListPlans.php b/sample/billing/ListPlans.php index 5c309cab..24e024df 100644 --- a/sample/billing/ListPlans.php +++ b/sample/billing/ListPlans.php @@ -3,8 +3,8 @@ // # Get List of Plan Sample // // This sample code demonstrate how you can get a list of billing plan, as documented here at: -// https://developer.paypal.com/docs/api/#list-plans -// API used: /v1/payments/billing-plans +// https://developer.paypal.com/docs/api/payments.billing-plans/v1/#billing-plans_list +// API used: GET /v1/payments/billing-plans // Retrieving the Plan object from Create Plan Sample to demonstrate the List /** @var Plan $createdPlan */ diff --git a/sample/billing/ReactivateBillingAgreement.php b/sample/billing/ReactivateBillingAgreement.php index b0fd49e8..a89059d4 100644 --- a/sample/billing/ReactivateBillingAgreement.php +++ b/sample/billing/ReactivateBillingAgreement.php @@ -3,8 +3,8 @@ // # Reactivate an agreement // // This sample code demonstrate how you can reactivate a billing agreement, as documented here at: -// https://developer.paypal.com/docs/api/#suspend-an-agreement -// API used: /v1/payments/billing-agreements//suspend +// https://developer.paypal.com/docs/api/payments.billing-agreements/v1/#billing-agreements_re-activate +// API used: POST /v1/payments/billing-agreements/{agreement_id}/re-activate // Retrieving the Agreement object from Suspend Agreement Sample to demonstrate the List /** @var Agreement $suspendedAgreement */ diff --git a/sample/billing/SearchBillingTransactions.php b/sample/billing/SearchBillingTransactions.php index 3d19c7c1..046ccec0 100644 --- a/sample/billing/SearchBillingTransactions.php +++ b/sample/billing/SearchBillingTransactions.php @@ -3,8 +3,8 @@ // # Search Billing Transactions Sample // // This sample code demonstrate how you can search all billing transactions, as documented here at: -// https://developer.paypal.com/docs/api/#search-for-transactions -// API used: GET /v1/payments/billing-agreements//transactions? start-date=yyyy-mm-dd&end-date=yyyy-mm-dd +// https://developer.paypal.com/docs/api/payments.billing-agreements/v1/#billing-agreements_transactions +// API used: GET /v1/payments/billing-agreements/{agreement_id}/transactions? start-date=yyyy-mm-dd&end-date=yyyy-mm-dd // Retrieving the Agreement object from Get Billing Agreement. This may not be necessary if you are trying to search for transactions of already created Agreement. /** @var Agreement $agreement */ diff --git a/sample/billing/SuspendBillingAgreement.php b/sample/billing/SuspendBillingAgreement.php index ad599267..54dbdddb 100644 --- a/sample/billing/SuspendBillingAgreement.php +++ b/sample/billing/SuspendBillingAgreement.php @@ -3,8 +3,8 @@ // # Suspend an agreement // // This sample code demonstrate how you can suspend a billing agreement, as documented here at: -// https://developer.paypal.com/docs/api/#suspend-an-agreement -// API used: /v1/payments/billing-agreements//suspend +// https://developer.paypal.com/docs/api/payments.billing-agreements/v1/#billing-agreements_suspend +// API used: POST /v1/payments/billing-agreements/{agreement_id}/suspend // Retrieving the Agreement object from Create Agreement Sample to demonstrate the List require __DIR__ . '/../bootstrap.php'; diff --git a/sample/billing/UpdateBillingAgreement.php b/sample/billing/UpdateBillingAgreement.php index 1ac2887a..6a9bc050 100644 --- a/sample/billing/UpdateBillingAgreement.php +++ b/sample/billing/UpdateBillingAgreement.php @@ -3,8 +3,8 @@ // # Update an agreement // // This sample code demonstrate how you can update a billing agreement, as documented here at: -// https://developer.paypal.com/docs/api/#update-an-agreement -// API used: /v1/payments/billing-agreements/ +// https://developer.paypal.com/docs/api/payments.billing-agreements/v1/#billing-agreements_patch +// API used: PATCH /v1/payments/billing-agreements/{agreement_id} require __DIR__ . '/../bootstrap.php'; diff --git a/sample/billing/UpdatePlan.php b/sample/billing/UpdatePlan.php index 96a96197..70bd1eb9 100644 --- a/sample/billing/UpdatePlan.php +++ b/sample/billing/UpdatePlan.php @@ -3,8 +3,8 @@ // # Update a plan // // This sample code demonstrate how you can update a billing plan, as documented here at: -// https://developer.paypal.com/docs/api/#update-a-plan -// API used: /v1/payments/billing-plans/ +// https://developer.paypal.com/docs/api/payments.billing-plans/v1/#billing-plans_patch +// API used: PATCH /v1/payments/billing-plans/{plan_id} // ### Making Plan Active // This example demonstrate how you could activate the Plan. diff --git a/sample/billing/UpdatePlanPaymentDefinitions.php b/sample/billing/UpdatePlanPaymentDefinitions.php index 9c68b8a3..59debb51 100644 --- a/sample/billing/UpdatePlanPaymentDefinitions.php +++ b/sample/billing/UpdatePlanPaymentDefinitions.php @@ -3,8 +3,8 @@ // # Update a plan // // This sample code demonstrate how you can update a billing plan, as documented here at: -// https://developer.paypal.com/docs/api/#update-a-plan -// API used: /v1/payments/billing-plans/ +// https://developer.paypal.com/docs/api/payments.billing-plans/v1/#billing-plans_patch +// API used: PATCH /v1/payments/billing-plans/{plan_id} // ### Changing Plan Amount // This example demonstrate how you could change the plan amount diff --git a/sample/doc/billing/CreateBillingAgreementWithPayPal.html b/sample/doc/billing/CreateBillingAgreementWithPayPal.html index 1ff9f58b..856a467c 100644 --- a/sample/doc/billing/CreateBillingAgreementWithPayPal.html +++ b/sample/doc/billing/CreateBillingAgreementWithPayPal.html @@ -1,7 +1,7 @@ billing/CreateBillingAgreementWithPayPal
billing/CreateBillingAgreementWithPayPal.php
<?php

Create Billing Agreement with PayPal as Payment Source

This sample code demonstrate how you can create a billing agreement, as documented here at: -https://developer.paypal.com/docs/api/#create-an-agreement -API used: /v1/payments/billing-agreements

Retrieving the Plan from the Create Update Sample. This would be used to +https://developer.paypal.com/docs/api/payments.billing-agreements/v1/#billing-agreements_post +API used: POST /v1/payments/billing-agreements

Retrieving the Plan from the Create Update Sample. This would be used to define Plan information to create an agreement. Make sure the plan you are using is in active state.

/** @var Plan $createdPlan */ $createdPlan = require 'UpdatePlan.php'; diff --git a/sample/doc/billing/CreatePlan.html b/sample/doc/billing/CreatePlan.html index 6b217952..3d5f7b2d 100644 --- a/sample/doc/billing/CreatePlan.html +++ b/sample/doc/billing/CreatePlan.html @@ -1,7 +1,7 @@ billing/CreatePlan
billing/CreatePlan.php
<?php

Create Plan Sample

This sample code demonstrate how you can create a billing plan, as documented here at: -https://developer.paypal.com/docs/api/#create-a-plan -API used: /v1/payments/billing-plans

require __DIR__ . '/../bootstrap.php'; +https://developer.paypal.com/docs/api/payments.billing-plans/v1/#billing-plans_post +API used: POST /v1/payments/billing-plans

require __DIR__ . '/../bootstrap.php'; use PayPal\Api\ChargeModel; use PayPal\Api\Currency; use PayPal\Api\MerchantPreferences; diff --git a/sample/doc/billing/DeletePlan.html b/sample/doc/billing/DeletePlan.html index 235c3877..a5d9839e 100644 --- a/sample/doc/billing/DeletePlan.html +++ b/sample/doc/billing/DeletePlan.html @@ -1,7 +1,7 @@ billing/DeletePlan
billing/DeletePlan.php
<?php

Delete Plan Sample

This sample code demonstrate how you can delete a billing plan, as documented here at: -https://developer.paypal.com/docs/api/#retrieve-a-plan -API used: /v1/payments/billing-plans

Retrieving the Plan object from Create Plan Sample

/** @var Plan $createdPlan */ +https://developer.paypal.com/docs/api/payments.billing-plans/v1/#billing-plans_patch +API used: PATCH /v1/payments/billing-plans/{plan_id}

Retrieving the Plan object from Create Plan Sample

/** @var Plan $createdPlan */ $createdPlan = require 'CreatePlan.php'; use PayPal\Api\Plan; diff --git a/sample/doc/billing/GetBillingAgreement.html b/sample/doc/billing/GetBillingAgreement.html index 301a1a9b..d327f03b 100644 --- a/sample/doc/billing/GetBillingAgreement.html +++ b/sample/doc/billing/GetBillingAgreement.html @@ -1,7 +1,7 @@ billing/GetBillingAgreement
billing/GetBillingAgreement.php
<?php

Get Billing Agreement Sample

This sample code demonstrate how you can get a billing agreement, as documented here at: -https://developer.paypal.com/docs/api/#retrieve-an-agreement -API used: /v1/payments/billing-agreements/

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

Retrieving the Agreement object from Create Agreement From Credit Card Sample

/** @var Agreement $createdAgreement */ +https://developer.paypal.com/docs/api/payments.billing-agreements/v1/#billing-agreements_get +API used: GET /v1/payments/billing-agreements/{agreement_id}

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

Retrieving the Agreement object from Create Agreement From Credit Card Sample

/** @var Agreement $createdAgreement */ $createdAgreement = "your billing agreement id"; use PayPal\Api\Agreement; diff --git a/sample/doc/billing/GetPlan.html b/sample/doc/billing/GetPlan.html index 83d86126..9730c95f 100644 --- a/sample/doc/billing/GetPlan.html +++ b/sample/doc/billing/GetPlan.html @@ -1,7 +1,7 @@ billing/GetPlan
billing/GetPlan.php
<?php

Get Plan Sample

This sample code demonstrate how you can get a billing plan, as documented here at: -https://developer.paypal.com/docs/api/#retrieve-a-plan -API used: /v1/payments/billing-plans

Retrieving the Plan object from Create Plan Sample

/** @var Plan $createdPlan */ +https://developer.paypal.com/docs/api/payments.billing-plans/v1/#billing-plans_list +API used: GET /v1/payments/billing-plans/{plan_id}

Retrieving the Plan object from Create Plan Sample

/** @var Plan $createdPlan */ $createdPlan = require 'CreatePlan.php'; use PayPal\Api\Plan; diff --git a/sample/doc/billing/ListPlans.html b/sample/doc/billing/ListPlans.html index 289c25d5..931d1eac 100644 --- a/sample/doc/billing/ListPlans.html +++ b/sample/doc/billing/ListPlans.html @@ -1,7 +1,7 @@ billing/ListPlans
billing/ListPlans.php
<?php

Get List of Plan Sample

This sample code demonstrate how you can get a list of billing plan, as documented here at: -https://developer.paypal.com/docs/api/#list-plans -API used: /v1/payments/billing-plans

Retrieving the Plan object from Create Plan Sample to demonstrate the List

/** @var Plan $createdPlan */ +https://developer.paypal.com/docs/api/payments.billing-plans/v1/#billing-plans_list +API used: GET /v1/payments/billing-plans

Retrieving the Plan object from Create Plan Sample to demonstrate the List

/** @var Plan $createdPlan */ $createdPlan = require 'CreatePlan.php'; use PayPal\Api\Plan; @@ -9,7 +9,7 @@ try {

Get the list of all plans 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/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); exit(1); diff --git a/sample/doc/billing/ReactivateBillingAgreement.html b/sample/doc/billing/ReactivateBillingAgreement.html index ed817973..b9ae6265 100644 --- a/sample/doc/billing/ReactivateBillingAgreement.html +++ b/sample/doc/billing/ReactivateBillingAgreement.html @@ -1,7 +1,7 @@ billing/ReactivateBillingAgreement
billing/ReactivateBillingAgreement.php
<?php

Reactivate an agreement

This sample code demonstrate how you can reactivate a billing agreement, as documented here at: -https://developer.paypal.com/docs/api/#suspend-an-agreement -API used: /v1/payments/billing-agreements//suspend

Retrieving the Agreement object from Suspend Agreement Sample to demonstrate the List

/** @var Agreement $suspendedAgreement */ +https://developer.paypal.com/docs/api/payments.billing-agreements/v1/#billing-agreements_re-activate +API used: POST /v1/payments/billing-agreements/{agreement_id}/re-activate

Retrieving the Agreement object from Suspend Agreement Sample to demonstrate the List

/** @var Agreement $suspendedAgreement */ $suspendedAgreement = require 'SuspendBillingAgreement.php'; use PayPal\Api\Agreement; diff --git a/sample/doc/billing/SearchBillingTransactions.html b/sample/doc/billing/SearchBillingTransactions.html index 972bca5a..e06bb7fe 100644 --- a/sample/doc/billing/SearchBillingTransactions.html +++ b/sample/doc/billing/SearchBillingTransactions.html @@ -1,7 +1,7 @@ billing/SearchBillingTransactions
billing/SearchBillingTransactions.php
<?php

Search Billing Transactions Sample

This sample code demonstrate how you can search all billing transactions, as documented here at: -https://developer.paypal.com/docs/api/#search-for-transactions -API used: GET /v1/payments/billing-agreements//transactions? start-date=yyyy-mm-dd&end-date=yyyy-mm-dd

Retrieving the Agreement object from Get Billing Agreement. This may not be necessary if you are trying to search for transactions of already created Agreement.

/** @var Agreement $agreement */ +https://developer.paypal.com/docs/api/payments.billing-agreements/v1/#billing-agreements_transactions +API used: GET /v1/payments/billing-agreements/{agreement_id}/transactions? start-date=yyyy-mm-dd&end-date=yyyy-mm-dd

Retrieving the Agreement object from Get Billing Agreement. This may not be necessary if you are trying to search for transactions of already created Agreement.

/** @var Agreement $agreement */ $agreement = require 'GetBillingAgreement.php';

Replace this with your AgreementId to search transactions based on your agreement.

$agreementId = $agreement->getId(); use PayPal\Api\Agreement;

Adding Params to search transaction within a given time frame.

$params = array('start_date' => date('Y-m-d', strtotime('-15 years')), 'end_date' => date('Y-m-d', strtotime('+5 days'))); diff --git a/sample/doc/billing/SuspendBillingAgreement.html b/sample/doc/billing/SuspendBillingAgreement.html index 243853ee..da100f64 100644 --- a/sample/doc/billing/SuspendBillingAgreement.html +++ b/sample/doc/billing/SuspendBillingAgreement.html @@ -1,7 +1,7 @@ billing/SuspendBillingAgreement
billing/SuspendBillingAgreement.php
<?php

Suspend an agreement

This sample code demonstrate how you can suspend a billing agreement, as documented here at: -https://developer.paypal.com/docs/api/#suspend-an-agreement -API used: /v1/payments/billing-agreements//suspend

Retrieving the Agreement object from Create Agreement Sample to demonstrate the List

require __DIR__ . '/../bootstrap.php'; +https://developer.paypal.com/docs/api/payments.billing-agreements/v1/#billing-agreements_suspend +API used: POST /v1/payments/billing-agreements/{agreement_id}/suspend

Retrieving the Agreement object from Create Agreement Sample to demonstrate the List

require __DIR__ . '/../bootstrap.php'; use PayPal\Api\Agreement; use PayPal\Api\AgreementStateDescriptor; diff --git a/sample/doc/billing/UpdateBillingAgreement.html b/sample/doc/billing/UpdateBillingAgreement.html index febb91ce..0e648e96 100644 --- a/sample/doc/billing/UpdateBillingAgreement.html +++ b/sample/doc/billing/UpdateBillingAgreement.html @@ -1,7 +1,7 @@ billing/UpdateBillingAgreement
billing/UpdateBillingAgreement.php
<?php

Update an agreement

This sample code demonstrate how you can update a billing agreement, as documented here at: -https://developer.paypal.com/docs/api/#update-an-agreement -API used: /v1/payments/billing-agreements/

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

Retrieving the Agreement object from Create Agreement Sample to demonstrate the List

/** @var Agreement $createdAgreement */ +https://developer.paypal.com/docs/api/payments.billing-agreements/v1/#billing-agreements_patch +API used: PATCH /v1/payments/billing-agreements/{agreement_id}

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

Retrieving the Agreement object from Create Agreement Sample to demonstrate the List

/** @var Agreement $createdAgreement */ $createdAgreement = 'your agreement id'; use PayPal\Api\Agreement; diff --git a/sample/doc/billing/UpdatePlan.html b/sample/doc/billing/UpdatePlan.html index be3c9f43..54e013c0 100644 --- a/sample/doc/billing/UpdatePlan.html +++ b/sample/doc/billing/UpdatePlan.html @@ -1,7 +1,7 @@ billing/UpdatePlan
billing/UpdatePlan.php
<?php

Update a plan

This sample code demonstrate how you can update a billing plan, as documented here at: -https://developer.paypal.com/docs/api/#update-a-plan -API used: /v1/payments/billing-plans/

Making Plan Active

+https://developer.paypal.com/docs/api/payments.billing-plans/v1/#billing-plans_patch +API used: PATCH /v1/payments/billing-plans/{plan_id}

Making Plan Active

This example demonstrate how you could activate the Plan.

Retrieving the Plan object from Create Plan Sample to demonstrate the List

/** @var Plan $createdPlan */ $createdPlan = require 'CreatePlan.php'; diff --git a/sample/doc/billing/UpdatePlanPaymentDefinitions.html b/sample/doc/billing/UpdatePlanPaymentDefinitions.html index 3459e4d1..e44925e3 100644 --- a/sample/doc/billing/UpdatePlanPaymentDefinitions.html +++ b/sample/doc/billing/UpdatePlanPaymentDefinitions.html @@ -1,7 +1,7 @@ billing/UpdatePlanPaymentDefinitions
billing/UpdatePlanPaymentDefinitions.php
<?php

Update a plan

This sample code demonstrate how you can update a billing plan, as documented here at: -https://developer.paypal.com/docs/api/#update-a-plan -API used: /v1/payments/billing-plans/

Changing Plan Amount

+https://developer.paypal.com/docs/api/payments.billing-plans/v1/#billing-plans_patch +API used: PATCH /v1/payments/billing-plans/{plan_id}

Changing Plan Amount

This example demonstrate how you could change the plan amount

Retrieving the Plan object from Create Plan Sample to demonstrate the List

/** @var Plan $createdPlan */ $createdPlan = require 'CreatePlan.php'; diff --git a/sample/doc/notifications/CreateWebhook.html b/sample/doc/notifications/CreateWebhook.html index c7316007..b7ed3b5b 100644 --- a/sample/doc/notifications/CreateWebhook.html +++ b/sample/doc/notifications/CreateWebhook.html @@ -1,6 +1,6 @@ notifications/CreateWebhook
notifications/CreateWebhook.php
<?php

Create Webhook Sample

This sample code demonstrate how you can create a webhook, as documented here at: -https://developer.paypal.com/docs/api/#create-a-webhook +https://developer.paypal.com/docs/api/webhooks/v1/#webhooks_post API used: POST /v1/notifications/webhooks

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

Create a new instance of Webhook object

$webhook = new \PayPal\Api\Webhook();

Basic Information

{
     "url":"https://requestb.in/10ujt3c1",
diff --git a/sample/doc/notifications/DeleteWebhook.html b/sample/doc/notifications/DeleteWebhook.html
index c706cb99..9e7733ef 100644
--- a/sample/doc/notifications/DeleteWebhook.html
+++ b/sample/doc/notifications/DeleteWebhook.html
@@ -1,6 +1,6 @@
 notifications/DeleteWebhook
notifications/DeleteWebhook.php
<?php

Delete Webhook Sample

This sample code demonstrate how to use this call to search for all webhook events., as documented here at: -https://developer.paypal.com/docs/api/#delete-a-webhook +https://developer.paypal.com/docs/api/webhooks/v1/#webhooks_delete 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); diff --git a/sample/doc/notifications/GetWebhook.html b/sample/doc/notifications/GetWebhook.html index c77254e0..0defe74a 100644 --- a/sample/doc/notifications/GetWebhook.html +++ b/sample/doc/notifications/GetWebhook.html @@ -1,6 +1,6 @@ notifications/GetWebhook
notifications/GetWebhook.php
<?php

Get Webhook Sample

This sample code demonstrate how you can get a webhook, as documented here at: -https://developer.paypal.com/docs/api/#get-a-webhook +https://developer.paypal.com/docs/api/webhooks/v1/#webhooks_get API used: GET /v1/notifications/webhooks/

Get Webhook ID.

In samples we are using CreateWebhook.php sample to get the created instance of webhook. However, in real case scenario, we could use just the ID from database or retrieved from the form.

/** @var \PayPal\Api\Webhook $webhook */ diff --git a/sample/doc/notifications/ListSubscribedWebhookEventTypes.html b/sample/doc/notifications/ListSubscribedWebhookEventTypes.html index f672d14a..ef49575e 100644 --- a/sample/doc/notifications/ListSubscribedWebhookEventTypes.html +++ b/sample/doc/notifications/ListSubscribedWebhookEventTypes.html @@ -1,6 +1,6 @@ notifications/ListSubscribedWebhookEventTypes
notifications/ListSubscribedWebhookEventTypes.php
<?php

Get Webhook Sample

This sample code demonstrate how you can get a webhook, as documented here at: -https://developer.paypal.com/docs/api/#get-a-webhook +https://developer.paypal.com/docs/api/webhooks/v1/#webhooks_get API used: GET /v1/notifications/webhooks/

List Subscribed Event Types

Use this call to retrieve the list of events types that are subscribed to a webhook.

/** @var \PayPal\Api\Webhook $webhook */ $webhook = require 'CreateWebhook.php'; diff --git a/sample/doc/notifications/ListWebhooks.html b/sample/doc/notifications/ListWebhooks.html index 8088c0a1..37be165c 100644 --- a/sample/doc/notifications/ListWebhooks.html +++ b/sample/doc/notifications/ListWebhooks.html @@ -1,6 +1,6 @@ notifications/ListWebhooks
notifications/ListWebhooks.php
<?php

Get All Webhooks Sample

Use this call to list all the webhooks, as documented here at: -https://developer.paypal.com/docs/api/#list-all-webhooks +https://developer.paypal.com/docs/api/webhooks/v1/#webhooks_list API used: GET /v1/notifications/webhooks

List Webhooks

This step is not necessarily required. We are creating a webhook for sample purpose only, so that we would not 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 */ diff --git a/sample/doc/notifications/SearchWebhookEvents.html b/sample/doc/notifications/SearchWebhookEvents.html index db880347..222feeb4 100644 --- a/sample/doc/notifications/SearchWebhookEvents.html +++ b/sample/doc/notifications/SearchWebhookEvents.html @@ -1,6 +1,6 @@ notifications/SearchWebhookEvents
notifications/SearchWebhookEvents.php
<?php

Search Webhook Events Sample

This sample code demonstrate how to use this call to search for all webhook events., as documented here at: -https://developer.paypal.com/docs/api/#search-webhook-events +https://developer.paypal.com/docs/api/webhooks/v1/#webhooks-events_list API used: GET /v1/notifications/webhooks-events

Get Webhook Instance

PLEASE NOTE:

Creating webhook is sample purposes only. In real scenario, you dont need to create a new webhook everytime you want to search diff --git a/sample/doc/notifications/UpdateWebhook.html b/sample/doc/notifications/UpdateWebhook.html index c5831c10..2f67fb01 100644 --- a/sample/doc/notifications/UpdateWebhook.html +++ b/sample/doc/notifications/UpdateWebhook.html @@ -1,6 +1,6 @@ notifications/UpdateWebhook

notifications/UpdateWebhook.php
<?php

Update Webhook Sample

This sample code demonstrate how to use this call to update a webhook; supports the replace operation only, as documented here at: -https://developer.paypal.com/docs/api/#update-a-webhook +https://developer.paypal.com/docs/api/webhooks/v1/#webhooks_update API used: PATCH v1/notifications/webhooks/

Get Webhook ID.

In samples we are using CreateWebhook.php sample to get the created instance of webhook. However, in real case scenario, we could use just the ID from database or use an already existing webhook.

/** @var \PayPal\Api\Webhook $webhook */ diff --git a/sample/doc/notifications/ValidateWebhookEvent.html b/sample/doc/notifications/ValidateWebhookEvent.html index a75bee54..8c9e5215 100644 --- a/sample/doc/notifications/ValidateWebhookEvent.html +++ b/sample/doc/notifications/ValidateWebhookEvent.html @@ -39,8 +39,8 @@ //$headers = getallheaders(); /** -* In Documentions https://developer.paypal.com/docs/api/webhooks/#verify-webhook-signature_post -* All header keys as UPPERCASE, but I recive the header key as the example array, First letter as UPPERCASE +* In documentations https://developer.paypal.com/docs/api/webhooks/v1/#verify-webhook-signature +* All header keys as UPPERCASE, but I receive the header key as the example array, First letter as UPPERCASE */ $headers = array_change_key_case($headers, CASE_UPPER); diff --git a/sample/doc/notifications/WebhookEventTypesList.html b/sample/doc/notifications/WebhookEventTypesList.html index 9c2b0755..200361ab 100644 --- a/sample/doc/notifications/WebhookEventTypesList.html +++ b/sample/doc/notifications/WebhookEventTypesList.html @@ -1,6 +1,6 @@ notifications/WebhookEventTypesList
notifications/WebhookEventTypesList.php
<?php

Get Reference List of all Webhook Event Types

This sample code demonstrate how you can get reference list of all webhook event types, as documented here at: -https://developer.paypal.com/docs/api/#get-a-reference-list-of-webhook-event-types +https://developer.paypal.com/docs/api/webhooks/v1/#webhooks-event-types_list 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); diff --git a/sample/notifications/CreateWebhook.php b/sample/notifications/CreateWebhook.php index 5b3710ca..bae64b5e 100644 --- a/sample/notifications/CreateWebhook.php +++ b/sample/notifications/CreateWebhook.php @@ -3,7 +3,7 @@ // # Create Webhook Sample // // This sample code demonstrate how you can create a webhook, as documented here at: -// https://developer.paypal.com/docs/api/#create-a-webhook +// https://developer.paypal.com/docs/api/webhooks/v1/#webhooks_post // API used: POST /v1/notifications/webhooks require __DIR__ . '/../bootstrap.php'; diff --git a/sample/notifications/DeleteWebhook.php b/sample/notifications/DeleteWebhook.php index 09bb898a..a8102fd1 100644 --- a/sample/notifications/DeleteWebhook.php +++ b/sample/notifications/DeleteWebhook.php @@ -3,8 +3,8 @@ // # Delete Webhook Sample // // This sample code demonstrate how to use this call to search for all webhook events., as documented here at: -// https://developer.paypal.com/docs/api/#delete-a-webhook -// API used: DELETE v1/notifications/webhooks/ +// https://developer.paypal.com/docs/api/webhooks/v1/#webhooks_delete +// API used: DELETE v1/notifications/webhooks/{webhook_id} // ## Get Webhook Instance diff --git a/sample/notifications/GetWebhook.php b/sample/notifications/GetWebhook.php index bbb1f89a..1926e535 100644 --- a/sample/notifications/GetWebhook.php +++ b/sample/notifications/GetWebhook.php @@ -3,8 +3,8 @@ // # Get Webhook Sample // // This sample code demonstrate how you can get a webhook, as documented here at: -// https://developer.paypal.com/docs/api/#get-a-webhook -// API used: GET /v1/notifications/webhooks/ +// https://developer.paypal.com/docs/api/webhooks/v1/#webhooks_get +// API used: GET /v1/notifications/webhooks/{webhook_id} // ## Get Webhook ID. // In samples we are using CreateWebhook.php sample to get the created instance of webhook. diff --git a/sample/notifications/ListSubscribedWebhookEventTypes.php b/sample/notifications/ListSubscribedWebhookEventTypes.php index a91b2967..193805d1 100644 --- a/sample/notifications/ListSubscribedWebhookEventTypes.php +++ b/sample/notifications/ListSubscribedWebhookEventTypes.php @@ -3,8 +3,8 @@ // # Get Webhook Sample // // This sample code demonstrate how you can get a webhook, as documented here at: -// https://developer.paypal.com/docs/api/#get-a-webhook -// API used: GET /v1/notifications/webhooks/ +// https://developer.paypal.com/docs/api/webhooks/v1/#webhooks_get +// API used: GET /v1/notifications/webhooks/{webhook_id} // ## List Subscribed Event Types // Use this call to retrieve the list of events types that are subscribed to a webhook. diff --git a/sample/notifications/ListWebhooks.php b/sample/notifications/ListWebhooks.php index 16d8ee7c..faf73228 100644 --- a/sample/notifications/ListWebhooks.php +++ b/sample/notifications/ListWebhooks.php @@ -3,7 +3,7 @@ // # Get All Webhooks Sample // // Use this call to list all the webhooks, as documented here at: -// https://developer.paypal.com/docs/api/#list-all-webhooks +// https://developer.paypal.com/docs/api/webhooks/v1/#webhooks_list // API used: GET /v1/notifications/webhooks // ## List Webhooks diff --git a/sample/notifications/SearchWebhookEvents.php b/sample/notifications/SearchWebhookEvents.php index 45a7d93b..cf6b72b4 100644 --- a/sample/notifications/SearchWebhookEvents.php +++ b/sample/notifications/SearchWebhookEvents.php @@ -3,7 +3,7 @@ // # Search Webhook Events Sample // // This sample code demonstrate how to use this call to search for all webhook events., as documented here at: -// https://developer.paypal.com/docs/api/#search-webhook-events +// https://developer.paypal.com/docs/api/webhooks/v1/#webhooks-events_list // API used: GET /v1/notifications/webhooks-events // ## Get Webhook Instance diff --git a/sample/notifications/UpdateWebhook.php b/sample/notifications/UpdateWebhook.php index e338815d..be963d10 100644 --- a/sample/notifications/UpdateWebhook.php +++ b/sample/notifications/UpdateWebhook.php @@ -3,8 +3,8 @@ // # Update Webhook Sample // // This sample code demonstrate how to use this call to update a webhook; supports the replace operation only, as documented here at: -// https://developer.paypal.com/docs/api/#update-a-webhook -// API used: PATCH v1/notifications/webhooks/ +// https://developer.paypal.com/docs/api/webhooks/v1/#webhooks_update +// API used: PATCH v1/notifications/webhooks/{webhook_id} // ## Get Webhook ID. // In samples we are using CreateWebhook.php sample to get the created instance of webhook. diff --git a/sample/notifications/ValidateWebhookEvent.php b/sample/notifications/ValidateWebhookEvent.php index cc22276f..ae927887 100644 --- a/sample/notifications/ValidateWebhookEvent.php +++ b/sample/notifications/ValidateWebhookEvent.php @@ -44,8 +44,8 @@ //$headers = getallheaders(); /** -* In Documentions https://developer.paypal.com/docs/api/webhooks/#verify-webhook-signature_post -* All header keys as UPPERCASE, but I recive the header key as the example array, First letter as UPPERCASE +* In documentations https://developer.paypal.com/docs/api/webhooks/v1/#verify-webhook-signature +* All header keys as UPPERCASE, but I receive the header key as the example array, First letter as UPPERCASE */ $headers = array_change_key_case($headers, CASE_UPPER); diff --git a/sample/notifications/WebhookEventTypesList.php b/sample/notifications/WebhookEventTypesList.php index 1607f5b7..3d0abf58 100644 --- a/sample/notifications/WebhookEventTypesList.php +++ b/sample/notifications/WebhookEventTypesList.php @@ -3,7 +3,7 @@ // # Get Reference List of all Webhook Event Types // // This sample code demonstrate how you can get reference list of all webhook event types, as documented here at: -// https://developer.paypal.com/docs/api/#get-a-reference-list-of-webhook-event-types +// https://developer.paypal.com/docs/api/webhooks/v1/#webhooks-event-types_list // API used: GET /v1/notifications/webhooks-event-types $apiContext = require __DIR__ . '/../bootstrap.php';