Overview
  • Namespace
  • Class

Namespaces

  • PayPal
    • Api
    • Auth
    • Cache
    • Common
    • Converter
    • Core
    • Exception
    • Handler
    • Log
    • Rest
    • Security
    • Transport
    • Validation

Classes

  • Address
  • Agreement
  • AgreementDetails
  • AgreementStateDescriptor
  • AgreementTransaction
  • AgreementTransactions
  • AlternatePayment
  • Amount
  • Authorization
  • BankAccount
  • BankAccountsList
  • BankToken
  • BaseAddress
  • Billing
  • BillingAgreementToken
  • BillingInfo
  • CancelNotification
  • Capture
  • CarrierAccount
  • CarrierAccountToken
  • CartBase
  • ChargeModel
  • Cost
  • CountryCode
  • CreateProfileResponse
  • Credit
  • CreditCard
  • CreditCardHistory
  • CreditCardList
  • CreditCardToken
  • CreditFinancingOffered
  • Currency
  • CurrencyConversion
  • CustomAmount
  • DetailedRefund
  • Details
  • Error
  • ErrorDetails
  • ExtendedBankAccount
  • ExternalFunding
  • FileAttachment
  • FlowConfig
  • FmfDetails
  • FundingDetail
  • FundingInstrument
  • FundingOption
  • FundingSource
  • FuturePayment
  • HyperSchema
  • Image
  • Incentive
  • InputFields
  • InstallmentInfo
  • InstallmentOption
  • Invoice
  • InvoiceAddress
  • InvoiceItem
  • InvoiceNumber
  • InvoiceSearchResponse
  • Item
  • ItemList
  • Links
  • Measurement
  • MerchantInfo
  • MerchantPreferences
  • Metadata
  • NameValuePair
  • Notification
  • OpenIdAddress
  • OpenIdError
  • OpenIdSession
  • OpenIdTokeninfo
  • OpenIdUserinfo
  • Order
  • OverrideChargeModel
  • Participant
  • Patch
  • PatchRequest
  • Payee
  • Payer
  • PayerInfo
  • Payment
  • PaymentCard
  • PaymentCardToken
  • PaymentDefinition
  • PaymentDetail
  • PaymentExecution
  • PaymentHistory
  • PaymentInstruction
  • PaymentOptions
  • PaymentSummary
  • PaymentTerm
  • Payout
  • PayoutBatch
  • PayoutBatchHeader
  • PayoutItem
  • PayoutItemDetails
  • PayoutSenderBatchHeader
  • Phone
  • Plan
  • PlanList
  • PotentialPayerInfo
  • Presentation
  • PrivateLabelCard
  • ProcessorResponse
  • RecipientBankingInstruction
  • RedirectUrls
  • Refund
  • RefundDetail
  • RefundRequest
  • RelatedResources
  • Sale
  • Search
  • ShippingAddress
  • ShippingCost
  • ShippingInfo
  • Tax
  • Template
  • TemplateData
  • Templates
  • TemplateSettings
  • TemplateSettingsMetadata
  • Terms
  • Transaction
  • TransactionBase
  • Transactions
  • VerifyWebhookSignature
  • VerifyWebhookSignatureResponse
  • Webhook
  • WebhookEvent
  • WebhookEventList
  • WebhookEventType
  • WebhookEventTypeList
  • WebhookList
  • WebProfile

Class WebhookEvent

Class WebhookEvent

A webhook event notification.

PayPal\Common\PayPalModel
Extended by PayPal\Common\PayPalResourceModel implements PayPal\Rest\IResource
Extended by PayPal\Api\WebhookEvent
Namespace: PayPal\Api
Package: PayPal\Api
Located at PayPal/Api/WebhookEvent.php

Methods summary

public
# setId( string $id )

The ID of the webhook event notification.

The ID of the webhook event notification.

Parameters

$id

Returns


$this
public string
# getId( )

The ID of the webhook event notification.

The ID of the webhook event notification.

Returns

string
public
# setCreateTime( string $create_time )

The date and time when the webhook event notification was created.

The date and time when the webhook event notification was created.

Parameters

$create_time

Returns


$this
public string
# getCreateTime( )

The date and time when the webhook event notification was created.

The date and time when the webhook event notification was created.

Returns

string
public
# setResourceType( string $resource_type )

The name of the resource related to the webhook notification event.

The name of the resource related to the webhook notification event.

Parameters

$resource_type

Returns


$this
public string
# getResourceType( )

The name of the resource related to the webhook notification event.

The name of the resource related to the webhook notification event.

Returns

string
public
# setEventVersion( string $event_version )

The version of the event.

The version of the event.

Parameters

$event_version

Returns


$this
public string
# getEventVersion( )

The version of the event.

The version of the event.

Returns

string
public
# setEventType( string $event_type )

The event that triggered the webhook event notification.

The event that triggered the webhook event notification.

Parameters

$event_type

Returns


$this
public string
# getEventType( )

The event that triggered the webhook event notification.

The event that triggered the webhook event notification.

Returns

string
public
# setSummary( string $summary )

A summary description for the event notification. For example, A payment authorization was created.

A summary description for the event notification. For example, A payment authorization was created.

Parameters

$summary

Returns


$this
public string
# getSummary( )

A summary description for the event notification. For example, A payment authorization was created.

A summary description for the event notification. For example, A payment authorization was created.

Returns

string
public
# setResource( PayPal\Common\PayPalModel $resource )

The resource that triggered the webhook event notification.

The resource that triggered the webhook event notification.

Parameters

$resource

Returns


$this
public PayPal\Common\PayPalModel
# getResource( )

The resource that triggered the webhook event notification.

The resource that triggered the webhook event notification.

Returns

PayPal\Common\PayPalModel
public static PayPal\Api\WebhookEvent
# validateAndGetReceivedEvent( string $body, PayPal\Rest\ApiContext $apiContext = null, PayPal\Transport\PayPalRestCall $restCall = null )

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. 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.

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. 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.

Deprecated

Please use VerifyWebhookSignature->post() instead.

Parameters

$body
$apiContext
$restCall
is the Rest Call Service that is used to make rest calls

Returns

PayPal\Api\WebhookEvent

Throws

InvalidArgumentException
if input arguments are incorrect, or Id is not found.
PayPal\Exception\PayPalConnectionException
if any exception from PayPal APIs other than not found is sent.
public static PayPal\Api\WebhookEvent
# get( string $eventId, PayPal\Rest\ApiContext $apiContext = null, PayPal\Transport\PayPalRestCall $restCall = null )

Retrieves the Webhooks event resource identified by event_id. Can be used to retrieve the payload for an event.

Retrieves the Webhooks event resource identified by event_id. Can be used to retrieve the payload for an event.

Parameters

$eventId
$apiContext
is the APIContext for this call. It can be used to pass dynamic configuration and credentials.
$restCall
is the Rest Call Service that is used to make rest calls

Returns

PayPal\Api\WebhookEvent
public PayPal\Api\WebhookEvent
# resend( PayPal\Rest\ApiContext $apiContext = null, PayPal\Transport\PayPalRestCall $restCall = null )

Resends a webhook event notification, by ID. Any pending notifications are not resent.

Resends a webhook event notification, by ID. Any pending notifications are not resent.

Parameters

$apiContext
is the APIContext for this call. It can be used to pass dynamic configuration and credentials.
$restCall
is the Rest Call Service that is used to make rest calls

Returns

PayPal\Api\WebhookEvent
public static PayPal\Api\WebhookEventList
# all( array $params, PayPal\Rest\ApiContext $apiContext = null, PayPal\Transport\PayPalRestCall $restCall = null )

Lists webhook event notifications. Use query parameters to filter the response.

Lists webhook event notifications. Use query parameters to filter the response.

Parameters

$params
$apiContext
is the APIContext for this call. It can be used to pass dynamic configuration and credentials.
$restCall
is the Rest Call Service that is used to make rest calls

Returns

PayPal\Api\WebhookEventList

Methods inherited from PayPal\Common\PayPalResourceModel

addLink(), executeCall(), getLink(), getLinks(), removeLink(), setLinks(), updateAccessToken()

Methods inherited from PayPal\Common\PayPalModel

__construct(), __get(), __isset(), __set(), __toString(), __unset(), fromArray(), fromJson(), getList(), setCredential(), toArray(), toJSON()

Properties summary

Properties inherited from PayPal\Common\PayPalModel

$credential

API documentation generated by ApiGen