CreateWebhook.php
2 years ago
DeleteWebhook.php
2 years ago
GenerateClientToken.php
2 years ago
GetAccessToken.php
2 years ago
UpdateWebhook.php
2 years ago
VerifyWebhookSignature.php
3 years ago
GetAccessToken.php
30 lines
| 1 | <?php |
| 2 | |
| 3 | namespace Give\PaymentGateways\PayPalCommerce\PayPalCheckoutSdk\Requests; |
| 4 | |
| 5 | use PayPalHttp\HttpRequest; |
| 6 | |
| 7 | /** |
| 8 | * Class GetAccessTokenWithClientCredentials |
| 9 | * |
| 10 | * @since 2.32.0 |
| 11 | */ |
| 12 | class GetAccessToken extends HttpRequest |
| 13 | { |
| 14 | /** |
| 15 | * @since 2.32.0 |
| 16 | * |
| 17 | * @param array $requestBody Request body. |
| 18 | * @param array $headers Headers to be added to the request. |
| 19 | */ |
| 20 | public function __construct(array $requestBody, array $headers) |
| 21 | { |
| 22 | parent::__construct('/v1/oauth2/token', 'POST'); |
| 23 | |
| 24 | $this->headers = wp_parse_args($headers, $this->headers); |
| 25 | |
| 26 | $this->headers["Content-Type"] = "application/x-www-form-urlencoded"; |
| 27 | $this->body = $requestBody; |
| 28 | } |
| 29 | } |
| 30 |