PHP Класс PayPal\Api\WebhookEvent

A webhook event notification.
Наследование: extends PayPal\Common\PayPalResourceModel
Показать файл Открыть проект Примеры использования класса

Открытые методы

Метод Описание
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.

Описание методов

all() публичный статический Метод

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
Результат WebhookEventList

get() публичный статический Метод

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
Результат WebhookEvent

getCreateTime() публичный Метод

The date and time when the webhook event notification was created.
public getCreateTime ( ) : string
Результат string

getEventType() публичный Метод

The event that triggered the webhook event notification.
public getEventType ( ) : string
Результат string

getEventVersion() публичный Метод

The version of the event.
public getEventVersion ( ) : string
Результат string

getId() публичный Метод

The ID of the webhook event notification.
public getId ( ) : string
Результат string

getResource() публичный Метод

The resource that triggered the webhook event notification.
public getResource ( ) : PayPalModel
Результат PayPal\Common\PayPalModel

getResourceType() публичный Метод

The name of the resource related to the webhook notification event.
public getResourceType ( ) : string
Результат string

getSummary() публичный Метод

A summary description for the event notification. For example, A payment authorization was created.
public getSummary ( ) : string
Результат string

resend() публичный Метод

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
Результат WebhookEvent

setCreateTime() публичный Метод

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

setEventType() публичный Метод

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

setEventVersion() публичный Метод

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

setId() публичный Метод

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

setResource() публичный Метод

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

setResourceType() публичный Метод

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

setSummary() публичный Метод

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

validateAndGetReceivedEvent() публичный статический Метод

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.
Устаревший: 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
Результат WebhookEvent