aboutsummaryrefslogtreecommitdiff
path: root/wallet
diff options
context:
space:
mode:
authorSebastian <sebasjm@gmail.com>2022-10-17 13:26:34 -0300
committerSebastian <sebasjm@gmail.com>2022-10-17 13:26:58 -0300
commitb752277fe5efba09a6d16599adaf4f95cb902c88 (patch)
tree4bc9e3dd239d5ee3070b84b376cd01f5f567d01a /wallet
parent2eb055b17d3f05649da4ee654a73db675e3ae458 (diff)
downloadtaler-android-b752277fe5efba09a6d16599adaf4f95cb902c88.tar.gz
taler-android-b752277fe5efba09a6d16599adaf4f95cb902c88.tar.bz2
taler-android-b752277fe5efba09a6d16599adaf4f95cb902c88.zip
adding summary to the invoice description
Diffstat (limited to 'wallet')
-rw-r--r--wallet/src/main/java/net/taler/wallet/peer/OutgoingPullFragment.kt4
-rw-r--r--wallet/src/main/java/net/taler/wallet/peer/OutgoingPullIntroComposable.kt6
-rw-r--r--wallet/src/main/java/net/taler/wallet/peer/PeerManager.kt4
3 files changed, 7 insertions, 7 deletions
diff --git a/wallet/src/main/java/net/taler/wallet/peer/OutgoingPullFragment.kt b/wallet/src/main/java/net/taler/wallet/peer/OutgoingPullFragment.kt
index b1593ff..24bedc4 100644
--- a/wallet/src/main/java/net/taler/wallet/peer/OutgoingPullFragment.kt
+++ b/wallet/src/main/java/net/taler/wallet/peer/OutgoingPullFragment.kt
@@ -80,7 +80,7 @@ class OutgoingPullFragment : Fragment() {
if (!requireActivity().isChangingConfigurations) peerManager.resetPullPayment()
}
- private fun onCreateInvoice(amount: Amount, exchange: ExchangeItem) {
- peerManager.initiatePullPayment(amount, exchange)
+ private fun onCreateInvoice(amount: Amount, summary: String, exchange: ExchangeItem) {
+ peerManager.initiatePullPayment(amount, summary, exchange)
}
}
diff --git a/wallet/src/main/java/net/taler/wallet/peer/OutgoingPullIntroComposable.kt b/wallet/src/main/java/net/taler/wallet/peer/OutgoingPullIntroComposable.kt
index a338836..d2091ee 100644
--- a/wallet/src/main/java/net/taler/wallet/peer/OutgoingPullIntroComposable.kt
+++ b/wallet/src/main/java/net/taler/wallet/peer/OutgoingPullIntroComposable.kt
@@ -53,7 +53,7 @@ import net.taler.wallet.exchanges.ExchangeItem
fun OutgoingPullIntroComposable(
amount: Amount,
exchangeState: State<ExchangeItem?>,
- onCreateInvoice: (amount: Amount, exchange: ExchangeItem) -> Unit,
+ onCreateInvoice: (amount: Amount, subject: String, exchange: ExchangeItem) -> Unit,
) {
val scrollState = rememberScrollState()
Column(
@@ -109,7 +109,7 @@ fun OutgoingPullIntroComposable(
modifier = Modifier.padding(16.dp),
enabled = subject.isNotBlank() && exchangeItem != null,
onClick = {
- onCreateInvoice(amount, exchangeItem ?: error("clickable without exchange"))
+ onCreateInvoice(amount, subject, exchangeItem ?: error("clickable without exchange"))
},
) {
Text(text = stringResource(R.string.receive_peer_create_button))
@@ -124,6 +124,6 @@ fun PreviewReceiveFundsIntro() {
@SuppressLint("UnrememberedMutableState")
val exchangeFlow =
mutableStateOf(ExchangeItem("https://example.org", "TESTKUDOS", emptyList()))
- OutgoingPullIntroComposable(Amount.fromDouble("TESTKUDOS", 42.23), exchangeFlow) { _, _ -> }
+ OutgoingPullIntroComposable(Amount.fromDouble("TESTKUDOS", 42.23), exchangeFlow) { _, _, _ -> }
}
}
diff --git a/wallet/src/main/java/net/taler/wallet/peer/PeerManager.kt b/wallet/src/main/java/net/taler/wallet/peer/PeerManager.kt
index b02b2b6..1e53e7c 100644
--- a/wallet/src/main/java/net/taler/wallet/peer/PeerManager.kt
+++ b/wallet/src/main/java/net/taler/wallet/peer/PeerManager.kt
@@ -46,14 +46,14 @@ class PeerManager(
private val _incomingPushState = MutableStateFlow<IncomingState>(IncomingChecking)
val incomingPushState: StateFlow<IncomingState> = _incomingPushState
- fun initiatePullPayment(amount: Amount, exchange: ExchangeItem) {
+ fun initiatePullPayment(amount: Amount, summary: String, exchange: ExchangeItem) {
_outgoingPullState.value = OutgoingCreating
scope.launch(Dispatchers.IO) {
api.request("initiatePeerPullPayment", InitiatePeerPullPaymentResponse.serializer()) {
put("exchangeBaseUrl", exchange.exchangeBaseUrl)
put("amount", amount.toJSONString())
put("partialContractTerms", JSONObject().apply {
- put("summary", "test")
+ put("summary", summary)
})
}.onSuccess {
val qrCode = QrCodeManager.makeQrCode(it.talerUri)