diff --git a/TalerWallet1/Resources/Localizable.xcstrings b/TalerWallet1/Resources/Localizable.xcstrings index e283ca45..b7d2fade 100755 --- a/TalerWallet1/Resources/Localizable.xcstrings +++ b/TalerWallet1/Resources/Localizable.xcstrings @@ -2842,6 +2842,9 @@ } } }, + "After the merchant resolves the issue, resume this payment to retry with the same funds." : { + "comment" : "below the reason why a payment was paused" + }, "Alias Type:" : { "comment" : "Picker title", "localizations" : { @@ -19138,6 +19141,12 @@ } } }, + "The merchant cannot process this payment right now because a payment service transaction limit was reached." : { + "comment" : "payment paused by wallet-core: transaction limit at the merchant's exchange" + }, + "The merchant cannot process this payment right now due to legal requirements." : { + "comment" : "payment paused by wallet-core: the merchant's exchange refused the deposit (e.g. missing KYC)" + }, "The payment service is waiting for your wire-transfer." : { "localizations" : { "de" : { diff --git a/TalerWallet1/Views/Transactions/PaidTransactionDetailV.swift b/TalerWallet1/Views/Transactions/PaidTransactionDetailV.swift index 6a6b2152..11951d2f 100755 --- a/TalerWallet1/Views/Transactions/PaidTransactionDetailV.swift +++ b/TalerWallet1/Views/Transactions/PaidTransactionDetailV.swift @@ -93,6 +93,15 @@ struct PaidTransactionDetailV: View { .talerFont(.body) } } + if common.isSuspended, let code = common.error?.code, + code == 2186 || code == 2184 { // MERCHANT_POST_ORDERS_ID_PAY_EXCHANGE_LEGALLY_REFUSED / _TRANSACTION_LIMIT_VIOLATION + Text(code == 2186 + ? String(localized: "The merchant cannot process this payment right now due to legal requirements.") + : String(localized: "The merchant cannot process this payment right now because a payment service transaction limit was reached.")) + .talerFont(.title3) + Text("After the merchant resolves the issue, resume this payment to retry with the same funds.") + .talerFont(.body) + } if let failReason = common.failReason { if let hint = failReason.hint { Text(hint) diff --git a/TalerWallet1/Views/Transactions/TransactionSummaryList.swift b/TalerWallet1/Views/Transactions/TransactionSummaryList.swift index 74f04b65..218cb87a 100755 --- a/TalerWallet1/Views/Transactions/TransactionSummaryList.swift +++ b/TalerWallet1/Views/Transactions/TransactionSummaryList.swift @@ -228,8 +228,8 @@ struct TransactionSummaryList: View { } @ViewBuilder - func suspendResume(_ common: TransactionCommon) -> some View { - if talerTX.isSuspendable { + func suspendResume(_ common: TransactionCommon, resumeOnly: Bool = false) -> some View { + if talerTX.isSuspendable && !resumeOnly { TransactionButton(transactionId: common.transactionId, command: .suspend, warning: nil, @@ -317,7 +317,13 @@ struct TransactionSummaryList: View { Group { if common.type != .dummy && transactionId == common.transactionId { let list = List { - if developerMode && withActions { suspendResume(common) } + if developerMode && withActions { + suspendResume(common) + } else if talerTX.isResumable { + // wallet-core suspends some transactions by itself (e.g. a payment the + // merchant's exchange refused for legal reasons); Resume is the only way on + suspendResume(common, resumeOnly: true) + } if !isPayDialog { Section { HStack {