give
/
src
/
PaymentGateways
/
PayPalCommerce
/
PayPalCheckoutSdk
/
Requests
/
VerifyWebhookSignature.php
CreateWebhook.php
1 year ago
DeleteWebhook.php
1 year ago
GenerateClientToken.php
1 year ago
GetAccessToken.php
1 year ago
UpdateWebhook.php
1 year ago
VerifyWebhookSignature.php
1 year ago
VerifyWebhookSignature.php
27 lines
| 1 | <?php |
| 2 | namespace Give\PaymentGateways\PayPalCommerce\PayPalCheckoutSdk\Requests; |
| 3 | |
| 4 | use PayPalHttp\HttpRequest; |
| 5 | |
| 6 | /** |
| 7 | * Class VerifyWebhookSignature |
| 8 | * |
| 9 | * @since 4.1.0 Add PayPal-Partner-Attribution-Id header |
| 10 | * @since 2.30.0 |
| 11 | */ |
| 12 | class VerifyWebhookSignature extends HttpRequest |
| 13 | { |
| 14 | /** |
| 15 | * @since 2.30.0 |
| 16 | * @param array $requestBody Request body. |
| 17 | */ |
| 18 | public function __construct(array $requestBody) |
| 19 | { |
| 20 | parent::__construct('/v1/notifications/verify-webhook-signature', 'POST'); |
| 21 | |
| 22 | $this->headers["Content-Type"] = "application/json"; |
| 23 | $this->headers["PayPal-Partner-Attribution-Id"] = give('PAYPAL_COMMERCE_ATTRIBUTION_ID'); |
| 24 | $this->body = wp_json_encode($requestBody); |
| 25 | } |
| 26 | } |
| 27 |