# give/4.15.5/src/PaymentGateways/PayPalCommerce/PayPalCheckoutSdk/Requests/UpdateWebhook.php

GiveWP – Donation Plugin and Fundraising Platform, version 4.15.5. 30 lines.

- Page: https://pluginprobe.com/plugins/give/4.15.5/code/src/PaymentGateways/PayPalCommerce/PayPalCheckoutSdk/Requests/UpdateWebhook.php
- Raw: https://pluginprobe.com/plugins/give/4.15.5/raw/src/PaymentGateways/PayPalCommerce/PayPalCheckoutSdk/Requests/UpdateWebhook.php
- Modified: 2025-04-16T13:25:04+00:00

Line numbers below start at 1. Link to a line or a range by appending a fragment to the
page URL, for example `https://pluginprobe.com/plugins/give/4.15.5/code/src/PaymentGateways/PayPalCommerce/PayPalCheckoutSdk/Requests/UpdateWebhook.php#L10-L20`.

```php
<?php

namespace Give\PaymentGateways\PayPalCommerce\PayPalCheckoutSdk\Requests;

use PayPalHttp\HttpRequest;

/**
 * Class UpdateWebhook.
 *
 * @since 4.1.0 Add PayPal-Partner-Attribution-Id header
 * @since 2.32.0
 */
class UpdateWebhook extends HttpRequest
{
    /**
     * @since 2.32.0
     *
     * @param string $webhookId Webhook ID.
     * @param array $requestBody Request body.
     */
    public function __construct(string $webhookId, array $requestBody)
    {
        parent::__construct("/v1/notifications/webhooks/$webhookId", 'PATCH');

        $this->headers['Content-Type'] = 'application/json';
        $this->headers["PayPal-Partner-Attribution-Id"] = give('PAYPAL_COMMERCE_ATTRIBUTION_ID');
        $this->body = wp_json_encode($requestBody);
    }
}

```
