Updated on 2026-08-14

This commit is contained in:
Tangem 2020-11-16 17:10:55 +03:00
parent 5968cf338f
commit 369ea273c2
13 changed files with 143 additions and 21 deletions

View file

@ -19,6 +19,7 @@ import com.tangem.tap.common.redux.navigation.NavigationAction
import com.tangem.tap.domain.PayIdManager
import com.tangem.tap.domain.TapError
import com.tangem.tap.domain.TopUpHelper
import com.tangem.tap.domain.config.ConfigurationValue
import com.tangem.tap.domain.extensions.toSendableAmounts
import com.tangem.tap.features.send.redux.PrepareSendScreen
import com.tangem.tap.features.wallet.models.toPendingTransactions
@ -253,9 +254,14 @@ private class TopUpMiddleware {
fun handle(action: WalletAction.TopUpAction) {
when (action) {
is WalletAction.TopUpAction.TopUp -> {
val configManager = store.state.globalState.configManager ?: return
val apiKey = configManager.getConfigValue(ConfigurationValue.moonPayApiKey)?.value ?: ""
val secretKey = configManager.getConfigValue(ConfigurationValue.moonPayApiSecretKey)?.value ?: ""
val url = TopUpHelper.getUrl(
store.state.walletState.currencyData.currencySymbol!!,
store.state.walletState.addressData!!.address
store.state.walletState.addressData!!.address,
apiKey,
secretKey
)
Timber.d(url)
store.dispatch(WalletAction.TopUpAction.Start(url, TopUpHelper.REDIRECT_URL))