PATH:
home
/
lab2454c
/
keebchat.com
/
core
/
libs
/
paypal
/
vendor
/
paypal
/
rest-api-sdk-php
/
lib
/
PayPal
/
Api
<?php namespace PayPal\Api; use PayPal\Common\PayPalResourceModel; use PayPal\Validation\ArgumentValidator; use PayPal\Api\VerifyWebhookSignatureResponse; use PayPal\Rest\ApiContext; use PayPal\Validation\UrlValidator; /** * Class VerifyWebhookSignature * * Verify webhook signature. * * @package PayPal\Api * * @property string auth_algo * @property string cert_url * @property string transmission_id * @property string transmission_sig * @property string transmission_time * @property string webhook_id * @property \PayPal\Api\WebhookEvent webhook_event */ class VerifyWebhookSignature extends PayPalResourceModel { /** * The algorithm that PayPal uses to generate the signature and that you can use to verify the signature. Extract this value from the `PAYPAL-AUTH-ALGO` response header, which is received with the webhook notification. * * @param string $auth_algo * * @return $this */ public function setAuthAlgo($auth_algo) { $this->auth_algo = $auth_algo; return $this; } /** * The algorithm that PayPal uses to generate the signature and that you can use to verify the signature. Extract this value from the `PAYPAL-AUTH-ALGO` response header, which is received with the webhook notification. * * @return string */ public function getAuthAlgo() { return $this->auth_algo; } /** * The X.509 public key certificate. Download the certificate from this URL and use it to verify the signature. Extract this value from the `PAYPAL-CERT-URL` response header, which is received with the webhook notification. * * @param string $cert_url * @throws \InvalidArgumentException * @return $this */ public function setCertUrl($cert_url) { UrlValidator::validate($cert_url, "CertUrl"); $this->cert_url = $cert_url; return $this; } /** * The X.509 public key certificate. Download the certificate from this URL and use it to verify the signature. Extract this value from the `PAYPAL-CERT-URL` response header, which is received with the webhook notification. * * @return string */ public function getCertUrl() { return $this->cert_url; } /** * The ID of the HTTP transmission. Contained in the `PAYPAL-TRANSMISSION-ID` header of the notification message. * * @param string $transmission_id * * @return $this */ public function setTransmissionId($transmission_id) { $this->transmission_id = $transmission_id; return $this; } /** * The ID of the HTTP transmission. Contained in the `PAYPAL-TRANSMISSION-ID` header of the notification message. * * @return string */ public function getTransmissionId() { return $this->transmission_id; } /** * The PayPal-generated asymmetric signature. Extract this value from the `PAYPAL-TRANSMISSION-SIG` response header, which is received with the webhook notification. * * @param string $transmission_sig * * @return $this */ public function setTransmissionSig($transmission_sig) { $this->transmission_sig = $transmission_sig; return $this; } /** * The PayPal-generated asymmetric signature. Extract this value from the `PAYPAL-TRANSMISSION-SIG` response header, which is received with the webhook notification. * * @return string */ public function getTransmissionSig() { return $this->transmission_sig; } /** * The date and time of the HTTP transmission. Contained in the `PAYPAL-TRANSMISSION-TIME` header of the notification message. * * @param string $transmission_time * * @return $this */ public function setTransmissionTime($transmission_time) { $this->transmission_time = $transmission_time; return $this; } /** * The date and time of the HTTP transmission. Contained in the `PAYPAL-TRANSMISSION-TIME` header of the notification message. * * @return string */ public function getTransmissionTime() { return $this->transmission_time; } /** * The ID of the webhook as configured in your Developer Portal account. * * @param string $webhook_id * * @return $this */ public function setWebhookId($webhook_id) { $this->webhook_id = $webhook_id; return $this; } /** * The ID of the webhook as configured in your Developer Portal account. * * @return string */ public function getWebhookId() { return $this->webhook_id; } /** * The webhook notification, which is the content of the HTTP `POST` request body. * @deprecated Please use setRequestBody($request_body) instead. * @param \PayPal\Api\WebhookEvent $webhook_event * * @return $this */ public function setWebhookEvent($webhook_event) { $this->webhook_event = $webhook_event; return $this; } /** * The webhook notification, which is the content of the HTTP `POST` request body. * * @return \PayPal\Api\WebhookEvent */ public function getWebhookEvent() { return $this->webhook_event; } /** * The content of the HTTP `POST` request body of the webhook notification you received as a string. * * @param string $request_body * * @return $this */ public function setRequestBody($request_body) { $this->request_body = $request_body; return $this; } /** * The content of the HTTP `POST` request body of the webhook notification you received as a string. * * @return string */ public function getRequestBody() { return $this->request_body; } /** * Verifies a webhook signature. * * @param ApiContext $apiContext is the APIContext for this call. It can be used to pass dynamic configuration and credentials. * @param PayPalRestCall $restCall is the Rest Call Service that is used to make rest calls * @return VerifyWebhookSignatureResponse */ public function post($apiContext = null, $restCall = null) { $payLoad = $this->toJSON(); $json = self::executeCall( "/v1/notifications/verify-webhook-signature", "POST", $payLoad, null, $apiContext, $restCall ); $ret = new VerifyWebhookSignatureResponse(); $ret->fromJson($json); return $ret; } public function toJSON($options = 0) { if (!is_null($this->request_body)) { $valuesToEncode = $this->toArray(); unset($valuesToEncode['webhook_event']); unset($valuesToEncode['request_body']); $payLoad = "{"; foreach ($valuesToEncode as $field => $value) { $payLoad .= "\"$field\": \"$value\","; } $payLoad .= "\"webhook_event\": $this->request_body"; $payLoad .= "}"; return $payLoad; } else { $payLoad = parent::toJSON($options); return $payLoad; } } }
[-] PaymentTerm.php
[edit]
[-] Patch.php
[edit]
[-] AgreementTransaction.php
[edit]
[-] OverrideChargeModel.php
[edit]
[-] RefundDetail.php
[edit]
[-] PaymentExecution.php
[edit]
[-] CurrencyConversion.php
[edit]
[-] InvoiceItem.php
[edit]
[-] Terms.php
[edit]
[-] PaymentDetail.php
[edit]
[-] BillingInfo.php
[edit]
[-] CreditCardList.php
[edit]
[-] MerchantInfo.php
[edit]
[-] Links.php
[edit]
[-] Transactions.php
[edit]
[-] PaymentDefinition.php
[edit]
[+]
..
[-] PaymentSummary.php
[edit]
[-] OpenIdError.php
[edit]
[-] BillingAgreementToken.php
[edit]
[-] Sale.php
[edit]
[-] Item.php
[edit]
[-] Address.php
[edit]
[-] InvoiceNumber.php
[edit]
[-] Payee.php
[edit]
[-] TransactionBase.php
[edit]
[-] ExtendedBankAccount.php
[edit]
[-] AgreementStateDescriptor.php
[edit]
[-] RecipientBankingInstruction.php
[edit]
[-] WebProfile.php
[edit]
[-] Payout.php
[edit]
[-] FundingDetail.php
[edit]
[-] CreditFinancingOffered.php
[edit]
[-] PaymentCardToken.php
[edit]
[-] ProcessorResponse.php
[edit]
[-] OpenIdTokeninfo.php
[edit]
[-] PotentialPayerInfo.php
[edit]
[-] MerchantPreferences.php
[edit]
[-] InstallmentInfo.php
[edit]
[-] InvoiceSearchResponse.php
[edit]
[-] FmfDetails.php
[edit]
[-] Agreement.php
[edit]
[-] Incentive.php
[edit]
[-] OpenIdSession.php
[edit]
[-] Plan.php
[edit]
[-] Refund.php
[edit]
[-] BaseAddress.php
[edit]
[-] CreditCardToken.php
[edit]
[-] Amount.php
[edit]
[-] CreateProfileResponse.php
[edit]
[-] AgreementDetails.php
[edit]
[-] Order.php
[edit]
[-] CarrierAccount.php
[edit]
[-] FuturePayment.php
[edit]
[-] FileAttachment.php
[edit]
[-] Image.php
[edit]
[-] Details.php
[edit]
[-] RedirectUrls.php
[edit]
[-] RelatedResources.php
[edit]
[-] AlternatePayment.php
[edit]
[-] PrivateLabelCard.php
[edit]
[-] Tax.php
[edit]
[-] Phone.php
[edit]
[-] Measurement.php
[edit]
[-] RefundRequest.php
[edit]
[-] Payer.php
[edit]
[-] FundingSource.php
[edit]
[-] PayoutBatch.php
[edit]
[-] VerifyWebhookSignatureResponse.php
[edit]
[-] CarrierAccountToken.php
[edit]
[-] PayoutItem.php
[edit]
[-] Authorization.php
[edit]
[-] CreditCardHistory.php
[edit]
[-] WebhookEventTypeList.php
[edit]
[-] TemplateSettingsMetadata.php
[edit]
[-] Cost.php
[edit]
[-] PayoutItemDetails.php
[edit]
[-] NameValuePair.php
[edit]
[-] CancelNotification.php
[edit]
[-] WebhookEvent.php
[edit]
[-] ShippingInfo.php
[edit]
[-] FundingOption.php
[edit]
[-] ShippingAddress.php
[edit]
[-] HyperSchema.php
[edit]
[-] CartBase.php
[edit]
[-] PayerInfo.php
[edit]
[-] Notification.php
[edit]
[-] PaymentHistory.php
[edit]
[-] CustomAmount.php
[edit]
[-] WebhookList.php
[edit]
[-] Credit.php
[edit]
[-] PlanList.php
[edit]
[-] Metadata.php
[edit]
[-] ShippingCost.php
[edit]
[-] TemplateData.php
[edit]
[-] ChargeModel.php
[edit]
[-] Capture.php
[edit]
[-] Transaction.php
[edit]
[-] InputFields.php
[edit]
[-] OpenIdUserinfo.php
[edit]
[-] PatchRequest.php
[edit]
[-] DetailedRefund.php
[edit]
[-] PaymentCard.php
[edit]
[-] AgreementTransactions.php
[edit]
[-] Currency.php
[edit]
[-] Participant.php
[edit]
[-] PaymentOptions.php
[edit]
[-] VerifyWebhookSignature.php
[edit]
[-] BankAccountsList.php
[edit]
[-] Template.php
[edit]
[-] CountryCode.php
[edit]
[-] ErrorDetails.php
[edit]
[-] PaymentInstruction.php
[edit]
[-] TemplateSettings.php
[edit]
[-] Payment.php
[edit]
[-] Search.php
[edit]
[-] InstallmentOption.php
[edit]
[-] Invoice.php
[edit]
[-] BankAccount.php
[edit]
[-] FundingInstrument.php
[edit]
[-] FlowConfig.php
[edit]
[-] ItemList.php
[edit]
[-] Templates.php
[edit]
[-] BankToken.php
[edit]
[-] PayoutSenderBatchHeader.php
[edit]
[-] PayoutBatchHeader.php
[edit]
[-] Presentation.php
[edit]
[-] Billing.php
[edit]
[-] WebhookEventType.php
[edit]
[-] OpenIdAddress.php
[edit]
[-] InvoiceAddress.php
[edit]
[-] CreditCard.php
[edit]
[-] Webhook.php
[edit]
[-] ExternalFunding.php
[edit]
[-] WebhookEventList.php
[edit]
[-] Error.php
[edit]