From 64aae5408863813a17a503ac006288ce4f20ced3 Mon Sep 17 00:00:00 2001 From: dani Date: Thu, 15 Aug 2024 15:48:01 +0300 Subject: [PATCH] refactor(merchant-sdk): Removed unused code from `Session` EC-74 --- .../sdk/api/authorization/model/Session.kt | 20 ------------------- 1 file changed, 20 deletions(-) diff --git a/merchant-sdk/sdk/src/main/java/net/gini/android/merchant/sdk/api/authorization/model/Session.kt b/merchant-sdk/sdk/src/main/java/net/gini/android/merchant/sdk/api/authorization/model/Session.kt index e3a85b61a..08adf3be5 100644 --- a/merchant-sdk/sdk/src/main/java/net/gini/android/merchant/sdk/api/authorization/model/Session.kt +++ b/merchant-sdk/sdk/src/main/java/net/gini/android/merchant/sdk/api/authorization/model/Session.kt @@ -1,6 +1,5 @@ package net.gini.android.merchant.sdk.api.authorization.model -import net.gini.android.core.api.authorization.apimodels.SessionToken import java.util.Date class Session( @@ -11,23 +10,4 @@ class Session( ) { /** The expiration date of the access token. */ val expirationDate: Date = Date(expirationDate.time) - - /** - * Uses the current locale's time to check whether or not this session has already expired. - * - * @return Whether or not the session has already expired. - */ - fun hasExpired(): Boolean { - val now = Date() - return now.after(expirationDate) - } - - companion object { - fun fromAPIResponse(apiResponse: SessionToken): Session { - val accessToken = apiResponse.accessToken - val now = Date() - val expirationTime = now.time + apiResponse.expiresIn * 1000 - return Session(accessToken, Date(expirationTime)) - } - } } \ No newline at end of file