Account_API::save_access_and_expiration( $id, $response )
{@inheritDoc}
Source
File: src/Tribe/Meetings/Zoom/Account_API.php
public function save_access_and_expiration( $id, array $response ) {
if ( ! (
isset( $response['body'] )
&& ( false !== $d = json_decode( $response['body'], true ) )
&& isset( $d['access_token'], $d['refresh_token'], $d['expires_in'] )
)
) {
do_action( 'tribe_log', 'error', __CLASS__, [
'action' => __METHOD__,
'code' => wp_remote_retrieve_response_code( $response ),
'message' => 'Response body missing or malformed',
] );
return false;
}
$access_token = $d['access_token'];
$refresh_token = $d['refresh_token'];
$expiration = $this->get_exiration_time_stamp( $d['expires_in'] );
$this->set_account_access_by_id( $id, $access_token, $refresh_token, $expiration );
return true;
}