diff --git a/src/Mpesa/Auth/Authenticator.php b/src/Mpesa/Auth/Authenticator.php index 96cad4e..1c99314 100755 --- a/src/Mpesa/Auth/Authenticator.php +++ b/src/Mpesa/Auth/Authenticator.php @@ -116,7 +116,8 @@ private function makeRequest($key, $secret) */ private function saveCredentials($key, $credentials) { - $ttl = Carbon::now()->addSeconds($credentials->expires_in)->subMinute(); + $ttlSeconds = (int) $credentials->expires_in; + $ttl = Carbon::now()->addSeconds($ttlSeconds)->subMinute(); $this->core->cache()->put($key, $credentials->access_token, $ttl); }