|
|
|
|
@ -58,14 +58,6 @@ $customerName = '';
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* Get session details from the API. Sets customer number, connection ID and customer name.
|
|
|
|
|
*
|
|
|
|
|
* @param $vars
|
|
|
|
|
* @param $accessToken
|
|
|
|
|
* @param $customerNumber
|
|
|
|
|
* @param $connectionId
|
|
|
|
|
* @param $customerName
|
|
|
|
|
* @return void
|
|
|
|
|
* @throws Exception
|
|
|
|
|
*/
|
|
|
|
|
function getCustomerDetails($vars, $accessToken, &$customerNumber, &$connectionId, &$customerName) {
|
|
|
|
|
$curl = curl_init();
|
|
|
|
|
@ -92,14 +84,6 @@ function getCustomerDetails($vars, $accessToken, &$customerNumber, &$connectionI
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* Get the customer's current hour of power settings.
|
|
|
|
|
*
|
|
|
|
|
* @param $vars
|
|
|
|
|
* @param $accessToken
|
|
|
|
|
* @param $customerNumber
|
|
|
|
|
* @param $connectionId
|
|
|
|
|
* @param $selectedHour
|
|
|
|
|
* @return void
|
|
|
|
|
* @throws Exception
|
|
|
|
|
*/
|
|
|
|
|
function getCurrentHour($vars, $accessToken, $customerNumber, $connectionId, &$selectedHour) {
|
|
|
|
|
$curl = curl_init();
|
|
|
|
|
@ -124,14 +108,6 @@ function getCurrentHour($vars, $accessToken, $customerNumber, $connectionId, &$s
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* Set new hour of power preference for a customer connection.
|
|
|
|
|
*
|
|
|
|
|
* @param $vars
|
|
|
|
|
* @param $accessToken
|
|
|
|
|
* @param $customerNumber
|
|
|
|
|
* @param $connectionId
|
|
|
|
|
* @param $selectedHour
|
|
|
|
|
* @return void
|
|
|
|
|
* @throws Exception
|
|
|
|
|
*/
|
|
|
|
|
function setCurrentHour($vars, $accessToken, $customerNumber, $connectionId, &$selectedHour) {
|
|
|
|
|
$post = [
|
|
|
|
|
@ -160,11 +136,6 @@ function setCurrentHour($vars, $accessToken, $customerNumber, $connectionId, &$s
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* Get access and refresh tokens for a customer from their login code and cookie them.
|
|
|
|
|
*
|
|
|
|
|
* @param $vars
|
|
|
|
|
* @param $code
|
|
|
|
|
* @return void
|
|
|
|
|
* @throws Exception
|
|
|
|
|
*/
|
|
|
|
|
function authorizeWithCode($vars, $code) {
|
|
|
|
|
$post = [
|
|
|
|
|
@ -201,11 +172,6 @@ function authorizeWithCode($vars, $code) {
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* Refresh a customer's access token from their refresh token.
|
|
|
|
|
*
|
|
|
|
|
* @param $vars
|
|
|
|
|
* @param $refreshToken
|
|
|
|
|
* @return void
|
|
|
|
|
* @throws Exception
|
|
|
|
|
*/
|
|
|
|
|
function refreshToken($vars, $refreshToken) {
|
|
|
|
|
$post = [
|
|
|
|
|
|