PHP 클래스 PayPal\Api\WebhookEvent

A webhook event notification.
상속: extends PayPal\Common\PayPalResourceModel
파일 보기 프로젝트 열기: paypal/rest-api-sdk-php 1 사용 예제들

공개 메소드들

메소드 설명
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