diff --git a/lib/PayPal/Api/WebhookEvent.php b/lib/PayPal/Api/WebhookEvent.php index 44babde..cc69209 100644 --- a/lib/PayPal/Api/WebhookEvent.php +++ b/lib/PayPal/Api/WebhookEvent.php @@ -2,6 +2,7 @@ namespace PayPal\Api; +use PayPal\Common\PPModel; use PayPal\Common\ResourceModel; use PayPal\Validation\ArgumentValidator; use PayPal\Api\WebhookEventList; @@ -218,7 +219,7 @@ class WebhookEvent extends ResourceModel /** * This contains the resource that is identified by resource_type element. * - * @param mixed $resource + * @param \PayPal\Common\PPModel $resource * * @return $this */ @@ -231,7 +232,7 @@ class WebhookEvent extends ResourceModel /** * This contains the resource that is identified by resource_type element. * - * @return mixed + * @return \PayPal\Common\PPModel */ public function getResource() { diff --git a/lib/PayPal/Api/WebhookEventType.php b/lib/PayPal/Api/WebhookEventType.php index a3bf71a..c0287ff 100644 --- a/lib/PayPal/Api/WebhookEventType.php +++ b/lib/PayPal/Api/WebhookEventType.php @@ -72,7 +72,7 @@ class WebhookEventType extends ResourceModel * @param string $webhookId * @param ApiContext $apiContext is the APIContext for this call. It can be used to pass dynamic configuration and credentials. * @param PPRestCall $restCall is the Rest Call Service that is used to make rest calls - * @return WebhookEventList + * @return WebhookEventTypeList */ public static function subscribedEventTypes($webhookId, $apiContext = null, $restCall = null) { @@ -86,7 +86,7 @@ class WebhookEventType extends ResourceModel $apiContext, $restCall ); - $ret = new WebhookEventList(); + $ret = new WebhookEventTypeList(); $ret->fromJson($json); return $ret; } @@ -96,7 +96,7 @@ class WebhookEventType extends ResourceModel * * @param ApiContext $apiContext is the APIContext for this call. It can be used to pass dynamic configuration and credentials. * @param PPRestCall $restCall is the Rest Call Service that is used to make rest calls - * @return WebhookEventList + * @return WebhookEventTypeList */ public static function availableEventTypes($apiContext = null, $restCall = null) { @@ -109,7 +109,7 @@ class WebhookEventType extends ResourceModel $apiContext, $restCall ); - $ret = new WebhookEventList(); + $ret = new WebhookEventTypeList(); $ret->fromJson($json); return $ret; } diff --git a/lib/PayPal/Common/PPReflectionUtil.php b/lib/PayPal/Common/PPReflectionUtil.php index 40c10ce..9222bf6 100644 --- a/lib/PayPal/Common/PPReflectionUtil.php +++ b/lib/PayPal/Common/PPReflectionUtil.php @@ -34,6 +34,10 @@ class PPReflectionUtil */ public static function getPropertyClass($class, $propertyName) { + if ($class == get_class(new PPModel())) { + // Make it generic if PPModel is used for generating this + return get_class(new PPModel()); + } if (($annotations = self::propertyAnnotations($class, $propertyName)) && isset($annotations['return'])) { $param = $annotations['return']; diff --git a/sample/doc/assets/behavior.js b/sample/doc/assets/behavior.js index b5c5960..7bad080 100644 --- a/sample/doc/assets/behavior.js +++ b/sample/doc/assets/behavior.js @@ -1235,6 +1235,62 @@ 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 "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/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": "file", "data": { "language": { @@ -1639,62 +1695,6 @@ 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": "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 - } - ] - } - ] } ] }, { diff --git a/sample/doc/notifications/SearchWebhookEvents.html b/sample/doc/notifications/SearchWebhookEvents.html index e446d18..6fafcca 100644 --- a/sample/doc/notifications/SearchWebhookEvents.html +++ b/sample/doc/notifications/SearchWebhookEvents.html @@ -5,15 +5,16 @@ 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.
'start_time'=>'2014-12-06T11:00:00Z', +'end_time'=>'2014-12-12T11:00:00Z'
Search Webhook events