Setting up Convert to Credit
LucraClient().setConvertToCreditProvider(object : LucraConvertToCreditProvider {
override suspend fun getCreditAmount(withdrawalDollarAmount: Double): LucraConvertToCreditWithdrawMethod {
//cashAmount is the amount the end user is attempting to withdrawal through the Withdraw Screen
val convertedAmount = withdrawalDollarAmount * 3
return LucraConvertToCreditWithdrawMethod(
id = "Unique id",
conversionTerms = "No Fee | Instant transfer",
title = "Game Credits",
amount = withdrawalDollarAmount,
convertedAmount = convertedAmount,
iconUrl = "https://a-path-to-a-icon.com",
convertedAmountDisplay = "$convertedAmount credits",
shortDescription = "This is a short description for the end user.",
longDescription = "This is a longer, more descriptive version of a message you want the end user to see about.",
//You can provide metadata about the conversion to be saved on your server
metaData = mapOf("key" to "value"),
//See image below for UI Example
theme = WithdrawCardTheme(
cardColor = "#5A1668",
cardTextColor = "#FFFFFF",
pillColor = "#5A1668",
pillTextColor = "#FFFFFF",
)
)
}
})Last updated
