-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
ForageConfig while, often consumed by UI components, is a standalone data structure making the .services package a more appropriate home. This also aligns things well with the Pos SDK because the ForageTerminalSDK, a service, consumes the ForageConfig. And, while UI may depend on services, services should never depend on UI facilities (else it ought to live in .ui!!) Signed-off-by: Devin Morgan <[email protected]>
- Loading branch information
1 parent
67cada7
commit 7a0a4df
Showing
15 changed files
with
40 additions
and
37 deletions.
There are no files selected for viewing
1 change: 0 additions & 1 deletion
1
forage-android/src/main/java/com/joinforage/forage/android/core/services/EnvConfig.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
26 changes: 26 additions & 0 deletions
26
forage-android/src/main/java/com/joinforage/forage/android/core/services/ForageConfig.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,26 @@ | ||
package com.joinforage.forage.android.core.services | ||
|
||
/** | ||
* The configuration details that Forage needs to create a functional [ForageElement]. | ||
* | ||
* Pass a [ForageConfig] instance in a call to | ||
* [setForageConfig][com.joinforage.forage.android.ui.ForageElement.setForageConfig] to | ||
* configure an Element. | ||
* | ||
* @property merchantId A unique Merchant ID that Forage provides during onboarding | ||
* onboarding preceded by "mid/". For example, `mid/123ab45c67`. | ||
* The Merchant ID can be found in the Forage [Sandbox](https://dashboard.sandbox.joinforage.app/login/) | ||
* or [Production](https://dashboard.joinforage.app/login/) Dashboard. | ||
* | ||
* @property sessionToken A short-lived token that authenticates front-end requests to Forage. | ||
* To create one, send a server-side `POST` request from your backend to the | ||
* [`/session_token/`](https://docs.joinforage.app/reference/create-session-token) endpoint. | ||
* | ||
* @constructor Creates an instance of the [ForageConfig] data class. | ||
*/ | ||
data class ForageConfig( | ||
val merchantId: String, | ||
val sessionToken: String | ||
) { | ||
internal val envConfig = EnvConfig.fromForageConfig(this) | ||
} |
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
2 changes: 2 additions & 0 deletions
2
...ndroid/src/main/java/com/joinforage/forage/android/core/ui/element/ForageConfigManager.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
27 changes: 1 addition & 26 deletions
27
forage-android/src/main/java/com/joinforage/forage/android/core/ui/element/ForageElement.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
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
2 changes: 1 addition & 1 deletion
2
forage-android/src/test/java/com/joinforage/forage/android/core/env/EnvConfigTest.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
2 changes: 1 addition & 1 deletion
2
forage-android/src/test/java/com/joinforage/forage/android/mock/MockLogger.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
2 changes: 1 addition & 1 deletion
2
forage-android/src/test/java/com/joinforage/forage/android/ui/ForageConfigManagerTest.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
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