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 5d666ed..65028f5 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 b6aa202..6925d2d 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 b73a7ab..6695aca 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 3fda034..32a2ffd 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 8f622d5..b75e0a7 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 5c309ca..24e024d 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 b0fd49e..a89059d 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 3d19c7c..046ccec 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 ad59926..54dbddd 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 1ac2887..6a9bc05 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 96a9619..70bd1eb 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 9c68b8a..59debb5 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 1ff9f58..856a467 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 6b21795..3d5f7b2 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 235c387..a5d9839 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 301a1a9..d327f03 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 83d8612..9730c95 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 289c25d..931d1ea 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 @@ API used: /v1/payments/billing-plans

< 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 ed81797..b9ae626 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 972bca5..e06bb7f 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 243853e..da100f6 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 febb91c..0e648e9 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 be3c9f4..54e013c 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 3459e4d..e44925e 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 c731600..b7ed3b5 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 c706cb9..9e7733e 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 c77254e..0defe74 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 f672d14..ef49575 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 8088c0a..37be165 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 db88034..222feeb 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 c5831c1..2f67fb0 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 a75bee5..8c9e521 100644 --- a/sample/doc/notifications/ValidateWebhookEvent.html +++ b/sample/doc/notifications/ValidateWebhookEvent.html @@ -39,8 +39,8 @@ To resolve that, we need to use alternative, which makes a call to PayPal's //$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 9c2b075..200361a 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 5b3710c..bae64b5 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 09bb898..a8102fd 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 bbb1f89..1926e53 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 a91b296..193805d 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 16d8ee7..faf7322 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 45a7d93..cf6b72b 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 e338815..be963d1 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 cc22276..ae92788 100644 --- a/sample/notifications/ValidateWebhookEvent.php +++ b/sample/notifications/ValidateWebhookEvent.php @@ -44,8 +44,8 @@ $requestBody = '{"id":"WH-7MU294299R542214K-4N1831857K851783H","event_version":" //$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 1607f5b..3d0abf5 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';