Changeset 11728 for sites/trunk/wordpress.org/public_html/wp-content/plugins/plugin-directory/clients/class-helpscout.php
- Timestamp:
- 04/01/2022 03:30:53 AM (3 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
sites/trunk/wordpress.org/public_html/wp-content/plugins/plugin-directory/clients/class-helpscout.php
r11726 r11728 9 9 class HelpScout { 10 10 const API_BASE = 'https://api.helpscout.net'; 11 12 /** 13 * The HTTP timeout for the HelpScout API. 14 */ 15 const TIMEOUT = 15; 11 16 12 17 public static function api( $url, $args = null, $method = 'GET' ) { … … 33 38 'Authorization' => self::get_auth_string(), 34 39 ], 40 'timeout' => self::TIMEOUT, 35 41 'body' => ( 'POST' === $method && $args ) ? $args : null, 36 42 ) … … 52 58 self::API_BASE . '/v2/oauth2/token', 53 59 array( 54 'body' => array( 60 'timeout' => self::TIMEOUT, 61 'body' => array( 55 62 'grant_type' => 'client_credentials', 56 63 'client_id' => HELPSCOUT_APP_ID, … … 72 79 set_site_transient( __CLASS__ . 'get_auth_token', [ 'exp' => time() + $expiry, 'token' => $token ], $expiry ); 73 80 74 return $token;81 return 'BEARER ' . $token; 75 82 } 76 83
Note: See TracChangeset
for help on using the changeset viewer.