* Determine whether a connection is expired.
public function is_expired(): bool {
return ( $this->renew_at - time() ) < HOUR_IN_SECONDS;
* Determine whether a connection currency is matched with WPForms currency.
public function is_currency_matched(): bool {
return $this->currency === strtoupper( wpforms_get_currency() );
* Determine whether a connection is valid.
public function is_valid(): bool {
return $this->get_status() === self::STATUS_VALID;
* Determine whether a connection is ready for save.
public function is_saveable(): bool {
return $this->is_configured() && ! $this->is_expired() && $this->is_encrypted();
* Determine whether a connection is ready for use.
public function is_usable(): bool {
return $this->is_configured() && $this->is_valid() && $this->is_currency_matched();