taler-ios

iOS apps for GNU Taler (wallet)
Log | Files | Refs | README | LICENSE

commit 3851a423a6ce53fac17e9bb698bbb47ac5da8bf6
parent 5d01074f0a281232957a600288d5941ba6f12fbb
Author: Marc Stibane <marc@taler.net>
Date:   Sun,  9 Aug 2026 22:06:24 +0200

Only pay automatically if paymentPossible AND amountRaw.isZero (only use token, no money)

Diffstat:
MTalerWallet1/Views/Transactions/PaymentTransactionView.swift | 19+++++++++++++------
1 file changed, 13 insertions(+), 6 deletions(-)

diff --git a/TalerWallet1/Views/Transactions/PaymentTransactionView.swift b/TalerWallet1/Views/Transactions/PaymentTransactionView.swift @@ -115,15 +115,22 @@ struct PaymentTransactionView: View { // Pay Automatically - usually with a subscription token if let selectedAutomatic = selectIndex(automaticIndex, of: choices) { if selectedAutomatic == automaticIndex { - // TODO: check if automatic choice does NOT have an amount - // we definitely don't want to pay MONEY automatically, only tokens - payNow = true + // check if automatic choice does NOT have an amount + let choiceTriple = choices[selectedAutomatic] + let selectionDetail = choiceTriple.0 + if selectionDetail.status == .paymentPossible { + // we currently don't want to pay MONEY automatically, only tokens + // TODO: make the maximum value a user default + if selectionDetail.amountRaw.isZero { + payNow = true + } + } return } else if let defaultChoiceIndex { if selectedAutomatic == defaultChoiceIndex { return } - // else fall thru and select defaultChoiceIndex - } else { - return // there is no default - keep selectedAutomatic + // else fall thru and select defaultChoiceIndex + } else { // there is no default - keep selectedAutomatic + return } } }