# jetformbuilder/3.6.6/modules/gateways/paypal/api-actions/get-token.php

JetFormBuilder — Dynamic Blocks Form Builder, version 3.6.6. 40 lines.

- Page: https://pluginprobe.com/plugins/jetformbuilder/3.6.6/code/modules/gateways/paypal/api-actions/get-token.php
- Raw: https://pluginprobe.com/plugins/jetformbuilder/3.6.6/raw/modules/gateways/paypal/api-actions/get-token.php
- Modified: 2023-11-20T11:46:54+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/jetformbuilder/3.6.6/code/modules/gateways/paypal/api-actions/get-token.php#L10-L20`.

```php
<?php


namespace JFB_Modules\Gateways\Paypal\Api_Actions;

// If this file is called directly, abort.
if ( ! defined( 'WPINC' ) ) {
	die;
}

class Get_Token extends Base_Action {

	const SLUG = 'GET_ACCESS_TOKEN';

	public function action_slug() {
		return self::SLUG;
	}

	public function action_endpoint() {
		return 'v1/oauth2/token';
	}

	public function action_body() {
		return 'grant_type=client_credentials';
	}

	public function action_headers() {
		return array(
			'Accept' => 'application/json',
		);
	}

	public function set_credentials( $client_id, $secret ) {
		// phpcs:ignore WordPress.PHP.DiscouragedPHPFunctions
		$key = base64_encode( $client_id . ':' . $secret );

		return $this->set_basic_auth( $key );
	}
}

```
