-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Feature/AND-113 update Swipelux onramp flow (#197)
* Update the Swipelux onramp flow Use the new customizable page allowing pre-setting the address and the token * Update OpenCcdOnrampSiteWithAccountUseCase * Update OpenCcdOnrampSiteWithAccountUseCase logic
- Loading branch information
1 parent
2055dea
commit f480a04
Showing
7 changed files
with
121 additions
and
30 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
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
45 changes: 45 additions & 0 deletions
45
app/src/main/java/com/concordium/wallet/ui/onramp/swipelux/SwipeluxSettingsHelper.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,45 @@ | ||
package com.concordium.wallet.ui.onramp.swipelux | ||
|
||
import com.concordium.wallet.App | ||
import java.net.URLEncoder | ||
import java.nio.charset.StandardCharsets | ||
|
||
object SwipeluxSettingsHelper { | ||
private const val BASE_URL = "https://track.swipelux.com" | ||
|
||
fun getWidgetSettings(walletAddress: String): String { | ||
|
||
val widgetConfig = WidgetConfig( | ||
apiKey = "6515da6d-a065-4676-a214-c83e5b18f5f3", //CCD API Key | ||
colors = Colors( | ||
main = "#48A2AE", | ||
background = "#182022", | ||
processing = "#FFA400", | ||
warning = "#ED0A34", | ||
success = "#58CB4E", | ||
link = "#F24F21" | ||
), | ||
defaultValues = DefaultValues( | ||
targetAddress = DefaultValue( | ||
value = walletAddress, | ||
editable = true | ||
), | ||
phone = DefaultValue( | ||
value = "", | ||
editable = true | ||
), | ||
email = DefaultValue( | ||
value = "", | ||
editable = true | ||
), | ||
fiatAmount = 100 | ||
) | ||
) | ||
|
||
val jsonString = App.appCore.gson.toJson(widgetConfig) | ||
val encodedString = URLEncoder.encode(jsonString, StandardCharsets.UTF_8.toString()) | ||
val url = "$BASE_URL/?specificSettings=${encodedString}" | ||
|
||
return url | ||
} | ||
} |
28 changes: 28 additions & 0 deletions
28
app/src/main/java/com/concordium/wallet/ui/onramp/swipelux/SwipeluxWidgetConfig.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,28 @@ | ||
package com.concordium.wallet.ui.onramp.swipelux | ||
|
||
data class WidgetConfig( | ||
val apiKey: String, | ||
val colors: Colors, | ||
val defaultValues: DefaultValues | ||
) | ||
|
||
data class Colors( | ||
val main: String, | ||
val background: String, | ||
val processing: String, | ||
val warning: String, | ||
val success: String, | ||
val link: String | ||
) | ||
|
||
data class DefaultValue( | ||
val value: String, | ||
val editable: Boolean | ||
) | ||
|
||
data class DefaultValues( | ||
val targetAddress: DefaultValue?, | ||
val phone: DefaultValue?, | ||
val email: DefaultValue?, | ||
val fiatAmount: Int? | ||
) |