PHP Class PayPal\Api\Webhook

One or more webhook objects.
Inheritance: extends PayPal\Common\PayPalResourceModel
Show file Open project: paypal/rest-api-sdk-php Class Usage Examples

Public Methods

Method Description
addEventType ( WebhookEventType $webhookEventType ) Append EventTypes to the list.
create ( ApiContext $apiContext = null, PayPalRestCall $restCall = null ) : Webhook Subscribes your webhook listener to events. A successful call returns a webhook object, which includes the webhook ID for later use.
delete ( ApiContext $apiContext = null, PayPalRestCall $restCall = null ) : boolean Deletes a webhook, by ID.
get ( string $webhookId, ApiContext $apiContext = null, PayPalRestCall $restCall = null ) : Webhook Shows details for a webhook, by ID.
getAll ( ApiContext $apiContext = null, PayPalRestCall $restCall = null ) : WebhookList Retrieves all Webhooks for the application associated with access token.
getAllWithParams ( array $params = [], ApiContext $apiContext = null, PayPalRestCall $restCall = null ) : WebhookList Lists all webhooks for an app.
getEventTypes ( ) : WebhookEventType[] A list of up to ten events to which to subscribe your webhook. To subscribe to all events including new events as they are added, specify the asterisk (*) wildcard. To replace the event_types array, specify the * wildcard. To see all supported events, list available events.
getId ( ) : string The ID of the webhook.
getUrl ( ) : string The URL that is configured to listen on localhost for incoming POST notification messages that contain event information.
removeEventType ( WebhookEventType $webhookEventType ) Remove EventTypes from the list.
setEventTypes ( WebhookEventType[] $event_types ) A list of up to ten events to which to subscribe your webhook. To subscribe to all events including new events as they are added, specify the asterisk (*) wildcard. To replace the event_types array, specify the * wildcard. To see all supported events, list available events.
setId ( string $id ) The ID of the webhook.
setUrl ( string $url ) The URL that is configured to listen on localhost for incoming POST notification messages that contain event information.
update ( PatchRequest $patchRequest, ApiContext $apiContext = null, PayPalRestCall $restCall = null ) : Webhook Replaces webhook fields with new values. Pass a json_patch object with replace operation and path, which is /url for a URL or /event_types for events. The value is either the URL or a list of events.

Method Details

addEventType() public method

Append EventTypes to the list.
public addEventType ( WebhookEventType $webhookEventType )
$webhookEventType WebhookEventType

create() public method

Subscribes your webhook listener to events. A successful call returns a webhook object, which includes the webhook ID for later use.
public create ( ApiContext $apiContext = null, PayPalRestCall $restCall = null ) : Webhook
$apiContext PayPal\Rest\ApiContext is the APIContext for this call. It can be used to pass dynamic configuration and credentials.
$restCall PayPalRestCall is the Rest Call Service that is used to make rest calls
return Webhook

delete() public method

Deletes a webhook, by ID.
public delete ( ApiContext $apiContext = null, PayPalRestCall $restCall = null ) : boolean
$apiContext PayPal\Rest\ApiContext is the APIContext for this call. It can be used to pass dynamic configuration and credentials.
$restCall PayPalRestCall is the Rest Call Service that is used to make rest calls
return boolean

get() public static method

Shows details for a webhook, by ID.
public static get ( string $webhookId, ApiContext $apiContext = null, PayPalRestCall $restCall = null ) : Webhook
$webhookId string
$apiContext PayPal\Rest\ApiContext is the APIContext for this call. It can be used to pass dynamic configuration and credentials.
$restCall PayPalRestCall is the Rest Call Service that is used to make rest calls
return Webhook

getAll() public static method

Retrieves all Webhooks for the application associated with access token.
Deprecation: Please use Webhook#getAllWithParams instead.
public static getAll ( ApiContext $apiContext = null, PayPalRestCall $restCall = null ) : WebhookList
$apiContext PayPal\Rest\ApiContext is the APIContext for this call. It can be used to pass dynamic configuration and credentials.
$restCall PayPalRestCall is the Rest Call Service that is used to make rest calls
return WebhookList

getAllWithParams() public static method

Lists all webhooks for an app.
public static getAllWithParams ( array $params = [], ApiContext $apiContext = null, PayPalRestCall $restCall = null ) : WebhookList
$params array
$apiContext PayPal\Rest\ApiContext is the APIContext for this call. It can be used to pass dynamic configuration and credentials.
$restCall PayPalRestCall is the Rest Call Service that is used to make rest calls
return WebhookList

getEventTypes() public method

A list of up to ten events to which to subscribe your webhook. To subscribe to all events including new events as they are added, specify the asterisk (*) wildcard. To replace the event_types array, specify the * wildcard. To see all supported events, list available events.
public getEventTypes ( ) : WebhookEventType[]
return WebhookEventType[]

getId() public method

The ID of the webhook.
public getId ( ) : string
return string

getUrl() public method

The URL that is configured to listen on localhost for incoming POST notification messages that contain event information.
public getUrl ( ) : string
return string

removeEventType() public method

Remove EventTypes from the list.
public removeEventType ( WebhookEventType $webhookEventType )
$webhookEventType WebhookEventType

setEventTypes() public method

A list of up to ten events to which to subscribe your webhook. To subscribe to all events including new events as they are added, specify the asterisk (*) wildcard. To replace the event_types array, specify the * wildcard. To see all supported events, list available events.
public setEventTypes ( WebhookEventType[] $event_types )
$event_types WebhookEventType[]

setId() public method

The ID of the webhook.
public setId ( string $id )
$id string

setUrl() public method

The URL that is configured to listen on localhost for incoming POST notification messages that contain event information.
public setUrl ( string $url )
$url string

update() public method

Replaces webhook fields with new values. Pass a json_patch object with replace operation and path, which is /url for a URL or /event_types for events. The value is either the URL or a list of events.
public update ( PatchRequest $patchRequest, ApiContext $apiContext = null, PayPalRestCall $restCall = null ) : Webhook
$patchRequest PatchRequest
$apiContext PayPal\Rest\ApiContext is the APIContext for this call. It can be used to pass dynamic configuration and credentials.
$restCall PayPalRestCall is the Rest Call Service that is used to make rest calls
return Webhook