diff --git a/apps/flipcash/core/src/main/res/values/strings.xml b/apps/flipcash/core/src/main/res/values/strings.xml
index 9c75fc51d7..96e9174d55 100644
--- a/apps/flipcash/core/src/main/res/values/strings.xml
+++ b/apps/flipcash/core/src/main/res/values/strings.xml
@@ -291,6 +291,7 @@
Insufficient Balance
Add more money to create a currency
Add more money, or enter a smaller amount
+ Add more money, or select a different Community Currency
Add money to give cash
Add money to buy currencies
Add money to send cash
diff --git a/apps/flipcash/features/messenger/src/main/kotlin/com/flipcash/app/messenger/internal/payment/StartChattingPayer.kt b/apps/flipcash/features/messenger/src/main/kotlin/com/flipcash/app/messenger/internal/payment/StartChattingPayer.kt
index ec99841edb..7cb66bcc1e 100644
--- a/apps/flipcash/features/messenger/src/main/kotlin/com/flipcash/app/messenger/internal/payment/StartChattingPayer.kt
+++ b/apps/flipcash/features/messenger/src/main/kotlin/com/flipcash/app/messenger/internal/payment/StartChattingPayer.kt
@@ -1,5 +1,6 @@
package com.flipcash.app.messenger.internal.payment
+import androidx.annotation.StringRes
import com.flipcash.analytics.AddMoneySource
import com.flipcash.analytics.State as AnalyticsState
import com.flipcash.analytics.events.AddMoneyEvents
@@ -53,7 +54,10 @@ internal interface StartChattingPayer {
suspend fun mayProceed(onAddMoney: () -> Unit, onDiscoverCurrencies: () -> Unit): Boolean
/** Over balance, with something in the account. [onAddMoney] is the alert's action. */
- fun presentInsufficientBalance(onAddMoney: () -> Unit)
+ fun presentInsufficientBalance(
+ onAddMoney: () -> Unit,
+ @StringRes message: Int = R.string.description_insufficientBalanceToUse,
+ )
/** The deposit screen to open for an "Add Money" action, or null when there is none to open. */
suspend fun depositRoute(): AppRoute?
@@ -113,10 +117,10 @@ internal class DefaultStartChattingPayer @Inject constructor(
return false
}
- override fun presentInsufficientBalance(onAddMoney: () -> Unit) {
+ override fun presentInsufficientBalance(onAddMoney: () -> Unit, @StringRes message: Int) {
BottomBarManager.showInfo(
title = resources.getString(R.string.title_insufficientBalance),
- message = resources.getString(R.string.description_insufficientBalanceToUse),
+ message = resources.getString(message),
actions = listOf(
BottomBarAction(text = resources.getString(R.string.action_addMoney)) { onAddMoney() },
),
diff --git a/apps/flipcash/features/messenger/src/main/kotlin/com/flipcash/app/messenger/internal/request/RequestPayFlow.kt b/apps/flipcash/features/messenger/src/main/kotlin/com/flipcash/app/messenger/internal/request/RequestPayFlow.kt
index e2f1356e8b..1c3c05c481 100644
--- a/apps/flipcash/features/messenger/src/main/kotlin/com/flipcash/app/messenger/internal/request/RequestPayFlow.kt
+++ b/apps/flipcash/features/messenger/src/main/kotlin/com/flipcash/app/messenger/internal/request/RequestPayFlow.kt
@@ -172,7 +172,11 @@ internal class RequestPayFlow(
}
private fun present(block: PayBlock) = when (block) {
- PayBlock.OverBalance -> payer.presentInsufficientBalance(onAddMoney = ::presentDeposit)
+ PayBlock.OverBalance -> payer.presentInsufficientBalance(
+ onAddMoney = ::presentDeposit,
+ // A share is a fixed amount, so the way out is another currency, not a smaller amount.
+ message = R.string.description_insufficientBalanceToPayRequest,
+ )
PayBlock.OverSendLimit -> BottomBarManager.showAlert(
resources.getString(R.string.error_title_sendLimitReached),
resources.getString(R.string.error_description_sendLimitReached),
diff --git a/apps/flipcash/features/messenger/src/test/kotlin/com/flipcash/app/messenger/internal/request/RequestDetailsInsufficientFundsTest.kt b/apps/flipcash/features/messenger/src/test/kotlin/com/flipcash/app/messenger/internal/request/RequestDetailsInsufficientFundsTest.kt
index 211a408307..c2fb9c337a 100644
--- a/apps/flipcash/features/messenger/src/test/kotlin/com/flipcash/app/messenger/internal/request/RequestDetailsInsufficientFundsTest.kt
+++ b/apps/flipcash/features/messenger/src/test/kotlin/com/flipcash/app/messenger/internal/request/RequestDetailsInsufficientFundsTest.kt
@@ -113,7 +113,7 @@ class RequestDetailsInsufficientFundsTest {
vm.payTapped()
assertEquals(true, vm.pay.value.open)
- verify(exactly = 0) { payer.presentInsufficientBalance(any()) }
+ verify(exactly = 0) { payer.presentInsufficientBalance(any(), any()) }
}
@Test
@@ -123,7 +123,7 @@ class RequestDetailsInsufficientFundsTest {
vm.payTapped()
assertEquals(true, vm.pay.value.open)
- verify(exactly = 0) { payer.presentInsufficientBalance(any()) }
+ verify(exactly = 0) { payer.presentInsufficientBalance(any(), any()) }
}
@Test
@@ -137,7 +137,7 @@ class RequestDetailsInsufficientFundsTest {
vm.confirmPay()
assertEquals(true, vm.pay.value.open)
- verify(exactly = 1) { payer.presentInsufficientBalance(any()) }
+ verify(exactly = 1) { payer.presentInsufficientBalance(any(), any()) }
}
@Test
diff --git a/apps/flipcash/features/messenger/src/test/kotlin/com/flipcash/app/messenger/internal/request/RequestPayFlowTest.kt b/apps/flipcash/features/messenger/src/test/kotlin/com/flipcash/app/messenger/internal/request/RequestPayFlowTest.kt
index 2244f31248..06709d6845 100644
--- a/apps/flipcash/features/messenger/src/test/kotlin/com/flipcash/app/messenger/internal/request/RequestPayFlowTest.kt
+++ b/apps/flipcash/features/messenger/src/test/kotlin/com/flipcash/app/messenger/internal/request/RequestPayFlowTest.kt
@@ -102,7 +102,7 @@ class RequestPayFlowTest {
f.start(listOf(2))
assertEquals(true, f.state.value.open)
- verify(exactly = 0) { payer.presentInsufficientBalance(any()) }
+ verify(exactly = 0) { payer.presentInsufficientBalance(any(), any()) }
}
@Test
@@ -114,7 +114,7 @@ class RequestPayFlowTest {
f.confirm()
assertEquals(true, f.state.value.open)
- verify(exactly = 1) { payer.presentInsufficientBalance(any()) }
+ verify(exactly = 1) { payer.presentInsufficientBalance(any(), any()) }
coVerify(exactly = 0) { payments.pay(any(), any(), any()) }
}