diff --git a/sample/doc/assets/behavior.js b/sample/doc/assets/behavior.js index 1047527..b5c5960 100644 --- a/sample/doc/assets/behavior.js +++ b/sample/doc/assets/behavior.js @@ -1226,6 +1226,477 @@ f.event={add:function(a,c,d,e,g){var h,i,j,k,l,m,n,o,p,q,r,s;if(!(a.nodeType===3 ] } ] + }, { + "type": "folder", + "data": { + "path": "notifications", + "title": "notifications" + }, + "depth": 1, + "children": [ + { + "type": "file", + "data": { + "language": { + "nameMatchers": [{}, ".fbp"], + "pygmentsLexer": "php", + "singleLineComment": ["//"], + "ignorePrefix": "}", + "foldPrefix": "^", + "name": "PHP" + }, + "sourcePath": "/Users/japatel/Documents/workspace/Server-SDK/PayPal-PHP-SDK/sample/notifications/DeleteAllWebhooks.php", + "projectPath": "notifications/DeleteAllWebhooks.php", + "targetPath": "notifications/DeleteAllWebhooks", + "pageTitle": "notifications/DeleteAllWebhooks", + "title": "DeleteAllWebhooks" + }, + "depth": 2, + "outline": [ + { + "type": "heading", + "data": { + "level": 1, + "title": "Delete All Webhook Sample", + "slug": "delete-all-webhook-sample" + }, + "depth": 1, + "children": [ + { + "type": "heading", + "data": { + "level": 2, + "title": "Get Webhook Instance", + "slug": "get-webhook-instance" + }, + "depth": 2, + "children": [ + { + "type": "heading", + "data": { + "level": 3, + "title": "Delete Webhook", + "slug": "delete-webhook" + }, + "depth": 3 + } + ] + } + ] + } + ] + }, { + "type": "file", + "data": { + "language": { + "nameMatchers": [{}, ".fbp"], + "pygmentsLexer": "php", + "singleLineComment": ["//"], + "ignorePrefix": "}", + "foldPrefix": "^", + "name": "PHP" + }, + "sourcePath": "/Users/japatel/Documents/workspace/Server-SDK/PayPal-PHP-SDK/sample/notifications/DeleteWebhook.php", + "projectPath": "notifications/DeleteWebhook.php", + "targetPath": "notifications/DeleteWebhook", + "pageTitle": "notifications/DeleteWebhook", + "title": "DeleteWebhook" + }, + "depth": 2, + "outline": [ + { + "type": "heading", + "data": { + "level": 1, + "title": "Delete Webhook Sample", + "slug": "delete-webhook-sample" + }, + "depth": 1, + "children": [ + { + "type": "heading", + "data": { + "level": 2, + "title": "Get Webhook Instance", + "slug": "get-webhook-instance" + }, + "depth": 2, + "children": [ + { + "type": "heading", + "data": { + "level": 3, + "title": "Delete Webhook", + "slug": "delete-webhook" + }, + "depth": 3 + } + ] + } + ] + } + ] + }, { + "type": "file", + "data": { + "language": { + "nameMatchers": [{}, ".fbp"], + "pygmentsLexer": "php", + "singleLineComment": ["//"], + "ignorePrefix": "}", + "foldPrefix": "^", + "name": "PHP" + }, + "sourcePath": "/Users/japatel/Documents/workspace/Server-SDK/PayPal-PHP-SDK/sample/notifications/GetWebhook.php", + "projectPath": "notifications/GetWebhook.php", + "targetPath": "notifications/GetWebhook", + "pageTitle": "notifications/GetWebhook", + "title": "GetWebhook" + }, + "depth": 2, + "outline": [ + { + "type": "heading", + "data": { + "level": 1, + "title": "Get Webhook Sample", + "slug": "get-webhook-sample" + }, + "depth": 1, + "children": [ + { + "type": "heading", + "data": { + "level": 2, + "title": "Get Webhook ID.", + "slug": "get-webhook-id" + }, + "depth": 2, + "children": [ + { + "type": "heading", + "data": { + "level": 3, + "title": "Get Webhook", + "slug": "get-webhook" + }, + "depth": 3 + } + ] + } + ] + } + ] + }, { + "type": "file", + "data": { + "language": { + "nameMatchers": [{}, ".fbp"], + "pygmentsLexer": "php", + "singleLineComment": ["//"], + "ignorePrefix": "}", + "foldPrefix": "^", + "name": "PHP" + }, + "sourcePath": "/Users/japatel/Documents/workspace/Server-SDK/PayPal-PHP-SDK/sample/notifications/ListSubscribedWebhookEventTypes.php", + "projectPath": "notifications/ListSubscribedWebhookEventTypes.php", + "targetPath": "notifications/ListSubscribedWebhookEventTypes", + "pageTitle": "notifications/ListSubscribedWebhookEventTypes", + "title": "ListSubscribedWebhookEventTypes" + }, + "depth": 2, + "outline": [ + { + "type": "heading", + "data": { + "level": 1, + "title": "Get Webhook Sample", + "slug": "get-webhook-sample" + }, + "depth": 1, + "children": [ + { + "type": "heading", + "data": { + "level": 2, + "title": "List Subscribed Event Types", + "slug": "list-subscribed-event-types" + }, + "depth": 2, + "children": [ + { + "type": "heading", + "data": { + "level": 3, + "title": "Get List of Subscribed Event Types", + "slug": "get-list-of-subscribed-event-types" + }, + "depth": 3 + } + ] + } + ] + } + ] + }, { + "type": "file", + "data": { + "language": { + "nameMatchers": [{}, ".fbp"], + "pygmentsLexer": "php", + "singleLineComment": ["//"], + "ignorePrefix": "}", + "foldPrefix": "^", + "name": "PHP" + }, + "sourcePath": "/Users/japatel/Documents/workspace/Server-SDK/PayPal-PHP-SDK/sample/notifications/ListWebhooks.php", + "projectPath": "notifications/ListWebhooks.php", + "targetPath": "notifications/ListWebhooks", + "pageTitle": "notifications/ListWebhooks", + "title": "ListWebhooks" + }, + "depth": 2, + "outline": [ + { + "type": "heading", + "data": { + "level": 1, + "title": "Get All Webhooks Sample", + "slug": "get-all-webhooks-sample" + }, + "depth": 1, + "children": [ + { + "type": "heading", + "data": { + "level": 2, + "title": "List Webhooks", + "slug": "list-webhooks" + }, + "depth": 2, + "children": [ + { + "type": "heading", + "data": { + "level": 3, + "title": "Get List of All Webhooks", + "slug": "get-list-of-all-webhooks" + }, + "depth": 3 + } + ] + } + ] + } + ] + }, { + "type": "file", + "data": { + "language": { + "nameMatchers": [{}, ".fbp"], + "pygmentsLexer": "php", + "singleLineComment": ["//"], + "ignorePrefix": "}", + "foldPrefix": "^", + "name": "PHP" + }, + "sourcePath": "/Users/japatel/Documents/workspace/Server-SDK/PayPal-PHP-SDK/sample/notifications/SearchWebhookEvents.php", + "projectPath": "notifications/SearchWebhookEvents.php", + "targetPath": "notifications/SearchWebhookEvents", + "pageTitle": "notifications/SearchWebhookEvents", + "title": "SearchWebhookEvents" + }, + "depth": 2, + "outline": [ + { + "type": "heading", + "data": { + "level": 1, + "title": "Search Webhook Events Sample", + "slug": "search-webhook-events-sample" + }, + "depth": 1, + "children": [ + { + "type": "heading", + "data": { + "level": 2, + "title": "Get Webhook Instance", + "slug": "get-webhook-instance" + }, + "depth": 2 + }, { + "type": "heading", + "data": { + "level": 2, + "title": "PLEASE NOTE:", + "slug": "please-note" + }, + "depth": 2, + "children": [ + { + "type": "heading", + "data": { + "level": 3, + "title": "Search Webhook events", + "slug": "search-webhook-events" + }, + "depth": 3 + } + ] + } + ] + } + ] + }, { + "type": "file", + "data": { + "language": { + "nameMatchers": [{}, ".fbp"], + "pygmentsLexer": "php", + "singleLineComment": ["//"], + "ignorePrefix": "}", + "foldPrefix": "^", + "name": "PHP" + }, + "sourcePath": "/Users/japatel/Documents/workspace/Server-SDK/PayPal-PHP-SDK/sample/notifications/UpdateWebhook.php", + "projectPath": "notifications/UpdateWebhook.php", + "targetPath": "notifications/UpdateWebhook", + "pageTitle": "notifications/UpdateWebhook", + "title": "UpdateWebhook" + }, + "depth": 2, + "outline": [ + { + "type": "heading", + "data": { + "level": 1, + "title": "Update Webhook Sample", + "slug": "update-webhook-sample" + }, + "depth": 1, + "children": [ + { + "type": "heading", + "data": { + "level": 2, + "title": "Get Webhook ID.", + "slug": "get-webhook-id" + }, + "depth": 2, + "children": [ + { + "type": "heading", + "data": { + "level": 3, + "title": "Get Webhook", + "slug": "get-webhook" + }, + "depth": 3 + } + ] + } + ] + } + ] + }, { + "type": "file", + "data": { + "language": { + "nameMatchers": [{}, ".fbp"], + "pygmentsLexer": "php", + "singleLineComment": ["//"], + "ignorePrefix": "}", + "foldPrefix": "^", + "name": "PHP" + }, + "sourcePath": "/Users/japatel/Documents/workspace/Server-SDK/PayPal-PHP-SDK/sample/notifications/WebhookEventTypesList.php", + "projectPath": "notifications/WebhookEventTypesList.php", + "targetPath": "notifications/WebhookEventTypesList", + "pageTitle": "notifications/WebhookEventTypesList", + "title": "WebhookEventTypesList" + }, + "depth": 2, + "outline": [ + { + "type": "heading", + "data": { + "level": 1, + "title": "Get Reference List of all Webhook Event Types", + "slug": "get-reference-list-of-all-webhook-event-types" + }, + "depth": 1, + "children": [ + { + "type": "heading", + "data": { + "level": 3, + "title": "Get List of all Webhook event types", + "slug": "get-list-of-all-webhook-event-types" + }, + "depth": 3 + } + ] + } + ] + }, { + "type": "file", + "data": { + "language": { + "nameMatchers": [{}, ".fbp"], + "pygmentsLexer": "php", + "singleLineComment": ["//"], + "ignorePrefix": "}", + "foldPrefix": "^", + "name": "PHP" + }, + "sourcePath": "/Users/japatel/Documents/workspace/Server-SDK/PayPal-PHP-SDK/sample/notifications/createWebhook.php", + "projectPath": "notifications/createWebhook.php", + "targetPath": "notifications/createWebhook", + "pageTitle": "notifications/createWebhook", + "title": "createWebhook" + }, + "depth": 2, + "outline": [ + { + "type": "heading", + "data": { + "level": 1, + "title": "Create Webhook Sample", + "slug": "create-webhook-sample" + }, + "depth": 1 + }, { + "type": "heading", + "data": { + "level": 1, + "title": "Basic Information", + "slug": "basic-information" + }, + "depth": 1 + }, { + "type": "heading", + "data": { + "level": 1, + "title": "Event Types", + "slug": "event-types" + }, + "depth": 1, + "children": [ + { + "type": "heading", + "data": { + "level": 3, + "title": "Create Webhook", + "slug": "create-webhook" + }, + "depth": 3 + } + ] + } + ] + } + ] }, { "type": "folder", "data": { diff --git a/sample/doc/notifications/DeleteAllWebhooks.html b/sample/doc/notifications/DeleteAllWebhooks.html new file mode 100644 index 0000000..ae3732c --- /dev/null +++ b/sample/doc/notifications/DeleteAllWebhooks.html @@ -0,0 +1,15 @@ +
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/
This sample code demonstrate how you can get a webhook, as documented here at:
+https://developer.paypal.com/webapps/developer/docs/api/#get-a-webhook
+API used: GET /v1/notifications/webhooks/
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.
This sample code demonstrate how you can get a webhook, as documented here at:
+https://developer.paypal.com/webapps/developer/docs/api/#get-a-webhook
+API used: GET /v1/notifications/webhooks/
Use this call to retrieve the list of events types that are subscribed to a webhook.
Use this call to list all the webhooks, as documented here at: +https://developer.paypal.com/webapps/developer/docs/api/#list-all-webhooks +API used: GET /v1/notifications/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.
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 +API used: GET /v1/notifications/webhooks-events
Creating webhook is sample purposes only. In real scenario, you dont need to create a new webhook everytime you want to search +for a webhook events. This is made in a sample just to make sure there is minimum of one webhook to listen to.
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/webapps/developer/docs/api/#update-a-webhook
+API used: PATCH v1/notifications/webhooks/
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.
Updating the webhook as per given request + [ + { + "op":"replace", + "path":"/url", + "value":"https://requestb.in/10ujt3c1" + }, + { + "op":"replace", + "path":"/event_types", + "value":[ + { + "name":"PAYMENT.SALE.REFUNDED" + } + ] + } + ]
This sample code demonstrate how you can get reference list of all webhook event types, as documented here at: +https://developer.paypal.com/webapps/developer/docs/api/#get-a-reference-list-of-webhook-event-types +API used: GET /v1/notifications/webhooks-event-types
This sample code demonstrate how you can create a webhook, as documented here at: +https://developer.paypal.com/webapps/developer/docs/api/#create-a-webhook +API used: POST /v1/notifications/webhooks
Create a new instance of Webhook object
{
+ "url":"https://requestb.in/10ujt3c1",
+ "event_types":[
+ {
+ "name":"PAYMENT.AUTHORIZATION.CREATED"
+ },
+ {
+ "name":"PAYMENT.AUTHORIZATION.VOIDED"
+ }
+ ]
+ }
+Fill up the basic information that is required for the webhook +The URL should be actually accessible over the internet. Having a localhost here would not work.
Event types correspond to what kind of notifications you want to receive on the given URL.
For Sample Purposes Only.
Print Success Result
Delete All Webhook Sample
+This is a sample helper method, to delete all existing webhooks, because of limited number of webhooks that are allowed per app. +To properly use the sample, change the clientId and Secret from bootstrap.php file with your own app ClientId and Secret.