MP_Addon_ConstantContact::get_client()
Get Constant contact client.
Contents
Description Description
Get refresh token. Get access token.
Return Return
(string)
Source Source
File: calculator-constant-contact-add-on/inc/MP_Addon_ConstantContact.php
public function get_client() {
if ( empty( get_option( MortgagePlatform::$prefix . 'constant_contact_access_token' ) ) ) {
$this->get_token( $this->get_constant_contact_refresh_token() );
} else {
$access_token = $this->get_constant_contact_access_token();
$expires_in = $access_token['expires_in'] ?? '';
$now = time() + 300;
if ( $expires_in <= $now ) {
$this->update_token();
}
}
}
Changelog Changelog
| Version | Description |
|---|---|
| 1.0.0 | Introduced. |