Hubspot_Helpers::get_client()


Return Return

(array) $tokens


Source Source

File: src/integrations/hubspot/helpers/hubspot-helpers.php

	public function get_client() {

		$tokens = get_option( '_automator_hubspot_settings', array() );

		if ( empty( $tokens['access_token'] ) || empty( $tokens['refresh_token'] ) ) {
			throw new \Exception( __( "HubSpot is not connected", 'uncanny-automator' ) );
		}

		$tokens = $this->maybe_refresh_token( $tokens );

		return $tokens;
	}