PHP Class PayPal\Api\WebhookEvent

A webhook event notification.
Inheritance: extends PayPal\Common\PayPalResourceModel
Afficher le fichier Open project: paypal/rest-api-sdk-php Class Usage Examples

Méthodes publiques

Méthode Description
all ( array $params, ApiContext $apiContext = null, PayPalRestCall $restCall = null ) : WebhookEventList Lists webhook event notifications. Use query parameters to filter the response.
get ( string $eventId, ApiContext $apiContext = null, PayPalRestCall $restCall = null ) : WebhookEvent Retrieves the Webhooks event resource identified by event_id. Can be used to retrieve the payload for an event.
getCreateTime ( ) : string The date and time when the webhook event notification was created.
getEventType ( ) : string The event that triggered the webhook event notification.
getEventVersion ( ) : string The version of the event.
getId ( ) : string The ID of the webhook event notification.
getResource ( ) : PayPalModel The resource that triggered the webhook event notification.
getResourceType ( ) : string The name of the resource related to the webhook notification event.
getSummary ( ) : string A summary description for the event notification. For example, A payment authorization was created.
resend ( ApiContext $apiContext = null, PayPalRestCall $restCall = null ) : WebhookEvent Resends a webhook event notification, by ID. Any pending notifications are not resent.
setCreateTime ( string $create_time ) The date and time when the webhook event notification was created.
setEventType ( string $event_type ) The event that triggered the webhook event notification.
setEventVersion ( string $event_version ) The version of the event.
setId ( string $id ) The ID of the webhook event notification.
setResource ( PayPalModel $resource ) The resource that triggered the webhook event notification.
setResourceType ( string $resource_type ) The name of the resource related to the webhook notification event.
setSummary ( string $summary ) A summary description for the event notification. For example, A payment authorization was created.
validateAndGetReceivedEvent ( string $body, ApiContext $apiContext = null, PayPalRestCall $restCall = null ) : WebhookEvent Validates Received Event from Webhook, and returns the webhook event object. Because security verifications by verifying certificate chain is not enabled in PHP yet, we need to fallback to default behavior of retrieving the ID attribute of the data, and make a separate GET call to PayPal APIs, to retrieve the data.

Method Details

all() public static méthode

Lists webhook event notifications. Use query parameters to filter the response.
public static all ( array $params, ApiContext $apiContext = null, PayPalRestCall $restCall = null ) : WebhookEventList
$params array
$apiContext PayPal\Rest\ApiContext is the APIContext for this call. It can be used to pass dynamic configuration and credentials.
$restCall PayPal\Transport\PayPalRestCall is the Rest Call Service that is used to make rest calls
Résultat WebhookEventList

get() public static méthode

Retrieves the Webhooks event resource identified by event_id. Can be used to retrieve the payload for an event.
public static get ( string $eventId, ApiContext $apiContext = null, PayPalRestCall $restCall = null ) : WebhookEvent
$eventId string
$apiContext PayPal\Rest\ApiContext is the APIContext for this call. It can be used to pass dynamic configuration and credentials.
$restCall PayPal\Transport\PayPalRestCall is the Rest Call Service that is used to make rest calls
Résultat WebhookEvent

getCreateTime() public méthode

The date and time when the webhook event notification was created.
public getCreateTime ( ) : string
Résultat string

getEventType() public méthode

The event that triggered the webhook event notification.
public getEventType ( ) : string
Résultat string

getEventVersion() public méthode

The version of the event.
public getEventVersion ( ) : string
Résultat string

getId() public méthode

The ID of the webhook event notification.
public getId ( ) : string
Résultat string

getResource() public méthode

The resource that triggered the webhook event notification.
public getResource ( ) : PayPalModel
Résultat PayPal\Common\PayPalModel

getResourceType() public méthode

The name of the resource related to the webhook notification event.
public getResourceType ( ) : string
Résultat string

getSummary() public méthode

A summary description for the event notification. For example, A payment authorization was created.
public getSummary ( ) : string
Résultat string

resend() public méthode

Resends a webhook event notification, by ID. Any pending notifications are not resent.
public resend ( ApiContext $apiContext = null, PayPalRestCall $restCall = null ) : WebhookEvent
$apiContext PayPal\Rest\ApiContext is the APIContext for this call. It can be used to pass dynamic configuration and credentials.
$restCall PayPal\Transport\PayPalRestCall is the Rest Call Service that is used to make rest calls
Résultat WebhookEvent

setCreateTime() public méthode

The date and time when the webhook event notification was created.
public setCreateTime ( string $create_time )
$create_time string

setEventType() public méthode

The event that triggered the webhook event notification.
public setEventType ( string $event_type )
$event_type string

setEventVersion() public méthode

The version of the event.
public setEventVersion ( string $event_version )
$event_version string

setId() public méthode

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

setResource() public méthode

The resource that triggered the webhook event notification.
public setResource ( PayPalModel $resource )
$resource PayPal\Common\PayPalModel

setResourceType() public méthode

The name of the resource related to the webhook notification event.
public setResourceType ( string $resource_type )
$resource_type string

setSummary() public méthode

A summary description for the event notification. For example, A payment authorization was created.
public setSummary ( string $summary )
$summary string

validateAndGetReceivedEvent() public static méthode

This is important to do again, as hacker could have faked the data, and the retrieved data cannot be trusted without either doing client side security validation, or making a separate call to PayPal APIs to retrieve the actual data. This limits the hacker to mimick a fake data, as hacker wont be able to predict the Id correctly. NOTE: PLEASE DO NOT USE THE DATA PROVIDED IN WEBHOOK DIRECTLY, AS HACKER COULD PASS IN FAKE DATA. IT IS VERY IMPORTANT THAT YOU RETRIEVE THE ID AND MAKE A SEPARATE CALL TO PAYPAL API.
Deprecation: Please use `VerifyWebhookSignature->post()` instead.
public static validateAndGetReceivedEvent ( string $body, ApiContext $apiContext = null, PayPalRestCall $restCall = null ) : WebhookEvent
$body string
$apiContext PayPal\Rest\ApiContext
$restCall PayPal\Transport\PayPalRestCall is the Rest Call Service that is used to make rest calls
Résultat WebhookEvent