| 1 |
<?php |
| 2 |
|
| 3 |
namespace Give\PaymentGateways\PayPalCommerce\PayPalCheckoutSdk\Requests; |
| 4 |
|
| 5 |
use PayPalHttp\HttpRequest; |
| 6 |
|
| 7 |
/** |
| 8 |
* Class CreateWebhook |
| 9 |
* |
| 10 |
* This class use as request to create a webhook. |
| 11 |
* |
| 12 |
* @since 4.1.0 Add PayPal-Partner-Attribution-Id header |
| 13 |
* @since 2.32.0 |
| 14 |
*/ |
| 15 |
class CreateWebhook extends HttpRequest |
| 16 |
{ |
| 17 |
public function __construct(array $requestBody) |
| 18 |
{ |
| 19 |
parent::__construct('/v1/notifications/webhooks', 'POST'); |
| 20 |
|
| 21 |
$this->headers["Content-Type"] = "application/json"; |
| 22 |
$this->headers["PayPal-Partner-Attribution-Id"] = give('PAYPAL_COMMERCE_ATTRIBUTION_ID'); |
| 23 |
$this->body = wp_json_encode($requestBody); |
| 24 |
} |
| 25 |
} |
| 26 |
|