-
Notifications
You must be signed in to change notification settings - Fork 551
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix: Fetch order expiry time from settings (#2109)
- Loading branch information
1 parent
1e35275
commit f0521a4
Showing
8 changed files
with
83 additions
and
23 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
23 changes: 23 additions & 0 deletions
23
app/src/main/java/org/fossasia/openevent/general/settings/Settings.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
package org.fossasia.openevent.general.settings | ||
|
||
import com.fasterxml.jackson.databind.PropertyNamingStrategy | ||
import com.fasterxml.jackson.databind.annotation.JsonNaming | ||
import com.github.jasminb.jsonapi.IntegerIdHandler | ||
import com.github.jasminb.jsonapi.annotations.Id | ||
import com.github.jasminb.jsonapi.annotations.Type | ||
|
||
@Type("setting") | ||
@JsonNaming(PropertyNamingStrategy.KebabCaseStrategy::class) | ||
data class Settings( | ||
@Id(IntegerIdHandler::class) | ||
val id: Int? = null, | ||
val appName: String? = null, | ||
val tagline: String? = null, | ||
val isPaypalActivated: Boolean = false, | ||
val isStripeActivated: Boolean = false, | ||
val isOmiseActivated: Boolean = false, | ||
val frontendUrl: String? = null, | ||
val cookiePolicy: String? = null, | ||
val cookiePolicyLink: String? = null, | ||
val orderExpiryTime: Int? = null | ||
) |
10 changes: 10 additions & 0 deletions
10
app/src/main/java/org/fossasia/openevent/general/settings/SettingsApi.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
package org.fossasia.openevent.general.settings | ||
|
||
import io.reactivex.Single | ||
import retrofit2.http.GET | ||
|
||
interface SettingsApi { | ||
|
||
@GET("settings") | ||
fun getSettings(): Single<Settings> | ||
} |
10 changes: 10 additions & 0 deletions
10
app/src/main/java/org/fossasia/openevent/general/settings/SettingsService.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
package org.fossasia.openevent.general.settings | ||
|
||
import io.reactivex.Single | ||
|
||
class SettingsService(val settingsApi: SettingsApi) { | ||
|
||
fun getSettings(): Single<Settings> { | ||
return settingsApi.getSettings() | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters