gnunet-svn
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[taler-taler-ios] 02/03: cash 2 ecash


From: gnunet
Subject: [taler-taler-ios] 02/03: cash 2 ecash
Date: Wed, 08 Jan 2025 20:41:48 +0100

This is an automated email from the git hooks/post-receive script.

marc-stibane pushed a commit to branch master
in repository taler-ios.

commit e93a9767f092d5b6acb313385714d11e058a7bd9
Author: Marc Stibane <marc@taler.net>
AuthorDate: Wed Jan 8 20:39:25 2025 +0100

    cash 2 ecash
---
 TalerWallet1/Localizable.xcstrings                 | 24 ++++++++
 TalerWallet1/Model/Model+Withdraw.swift            |  4 +-
 .../WithdrawAcceptDone.swift                       |  6 +-
 .../WithdrawAcceptView.swift                       | 72 ++++++++++++----------
 4 files changed, 70 insertions(+), 36 deletions(-)

diff --git a/TalerWallet1/Localizable.xcstrings 
b/TalerWallet1/Localizable.xcstrings
index e36bd45..fdfa291 100755
--- a/TalerWallet1/Localizable.xcstrings
+++ b/TalerWallet1/Localizable.xcstrings
@@ -9888,6 +9888,7 @@
       }
     },
     "Summary" : {
+      "extractionState" : "stale",
       "localizations" : {
         "de" : {
           "stringUnit" : {
@@ -10105,6 +10106,28 @@
         }
       }
     },
+    "The amount will be determined by the Cash Acceptor." : {
+      "localizations" : {
+        "de" : {
+          "stringUnit" : {
+            "state" : "translated",
+            "value" : "Der Betrag wird vom Geldannahme-Gerät festgelegt."
+          }
+        },
+        "es" : {
+          "stringUnit" : {
+            "state" : "translated",
+            "value" : "El monto será determinado por el Aceptante de Efectivo."
+          }
+        },
+        "pl" : {
+          "stringUnit" : {
+            "state" : "needs_review",
+            "value" : "Kwota zostanie określona przez Akceptanta Gotówki."
+          }
+        }
+      }
+    },
     "The bank is waiting for your authorization." : {
       "localizations" : {
         "de" : {
@@ -13063,6 +13086,7 @@
       }
     },
     "Your bank's wire fee: %@" : {
+      "extractionState" : "stale",
       "localizations" : {
         "de" : {
           "stringUnit" : {
diff --git a/TalerWallet1/Model/Model+Withdraw.swift 
b/TalerWallet1/Model/Model+Withdraw.swift
index 7e88add..2a299ed 100644
--- a/TalerWallet1/Model/Model+Withdraw.swift
+++ b/TalerWallet1/Model/Model+Withdraw.swift
@@ -56,8 +56,8 @@ struct WithdrawUriInfoResponse: Decodable {
     var status: WithdrawalOperationStatus   // pending, selected, aborted, 
confirmed
     var confirmTransferUrl: String?
     var currency: String                    // use this if amount=nil
-    var amount: Amount?                     // if nil then ask User
-    var editableAmount: Bool
+    var amount: Amount?                     // if nil then either ask User 
(editableAmount=true), or it's cash2ecash (editableAmount=false)
+    var editableAmount: Bool                // if true then ask User
     var maxAmount: Amount?                  // limit how much the user may 
withdraw
     var wireFee: Amount?
     var defaultExchangeBaseUrl: String?     // if nil then use 
possibleExchanges
diff --git 
a/TalerWallet1/Views/Sheets/WithdrawBankIntegrated/WithdrawAcceptDone.swift 
b/TalerWallet1/Views/Sheets/WithdrawBankIntegrated/WithdrawAcceptDone.swift
index 9def20e..7962946 100644
--- a/TalerWallet1/Views/Sheets/WithdrawBankIntegrated/WithdrawAcceptDone.swift
+++ b/TalerWallet1/Views/Sheets/WithdrawBankIntegrated/WithdrawAcceptDone.swift
@@ -36,7 +36,11 @@ struct WithdrawAcceptDone: View {
             ) {
                 let confirmTransferUrl = result.confirmTransferUrl
                 symLog.log(confirmTransferUrl)
-                transactionId = result.transactionId
+                if amountToTransfer == nil {
+                    dismissTop(stack.push())
+                } else {
+                    transactionId = result.transactionId
+                }
             }
         }
     }
diff --git 
a/TalerWallet1/Views/Sheets/WithdrawBankIntegrated/WithdrawAcceptView.swift 
b/TalerWallet1/Views/Sheets/WithdrawBankIntegrated/WithdrawAcceptView.swift
index f0e2471..e0ba2a8 100644
--- a/TalerWallet1/Views/Sheets/WithdrawBankIntegrated/WithdrawAcceptView.swift
+++ b/TalerWallet1/Views/Sheets/WithdrawBankIntegrated/WithdrawAcceptView.swift
@@ -39,7 +39,7 @@ struct WithdrawAcceptView: View {
     @MainActor
     private func viewDidLoad() async {
         symLog.log(".task \(exchange?.id ?? "nil")")
-        if let exchange {
+        if !amountToTransfer.isZero, let exchange {
             if let details = try? await 
model.getWithdrawalDetailsForAmount(amountToTransfer,
                                                                    baseUrl: 
exchange.exchangeBaseUrl,
                                                                      scope: 
nil) { // TODO: scope
@@ -53,7 +53,7 @@ struct WithdrawAcceptView: View {
     }
 
     var body: some View {
-        if let exchange, let withdrawalDetails {
+        if let exchange {
             VStack {
                 let tosAccepted = exchange.tosStatus == .accepted
                 if !tosAccepted {
@@ -64,37 +64,43 @@ struct WithdrawAcceptView: View {
                            acceptAction: reloadExchange)
                 }
                 List {
-                    let raw = withdrawalDetails.amountRaw
-                    let effective = withdrawalDetails.amountEffective
-                    let currency = raw.currencyStr
-                    let fee = try! Amount.diff(raw, effective)
-                    let outColor = WalletColors().transactionColor(false)
-                    let inColor = WalletColors().transactionColor(true)
+                    if let withdrawalDetails {
+                        let raw = withdrawalDetails.amountRaw
+                        let effective = withdrawalDetails.amountEffective
+                        let currency = raw.currencyStr
+                        let fee = try! Amount.diff(raw, effective)
+                        let outColor = WalletColors().transactionColor(false)
+                        let inColor = WalletColors().transactionColor(true)
 
-                    ThreeAmountsSection(stack: stack.push(),
-                                        scope: scope,
-                                     topTitle: String(localized: "Chosen 
amount to withdraw:"),
-                                    topAbbrev: String(localized: "Withdraw:", 
comment: "Chosen amount to withdraw:"),
-                                    topAmount: raw,
-                                       noFees: exchange.noFees,
-                                          fee: fee,
-                                feeIsNegative: true,
-                                  bottomTitle: String(localized: "Amount to 
obtain:"),
-                                 bottomAbbrev: String(localized: "Obtain:", 
comment: "Amount to obtain:"),
-                                 bottomAmount: effective,
-                                        large: false,
-                                      pending: false,
-                                     incoming: true,
-                                      baseURL: exchange.exchangeBaseUrl,
-                                   txStateLcl: nil,        // 
common.txState.major.localizedState
-                                      summary: nil,
-                                     merchant: nil,
-                                     products: nil)
-                    if let wireFee {
-                        if !wireFee.isZero {
-                            let currencyInfo = controller.info(for: scope, 
controller.currencyTicker)
-                            let feeStr = wireFee.formatted(currencyInfo, 
isNegative: false)
-                            Text("Your bank's wire fee: \(feeStr)")
+                        ThreeAmountsSection(stack: stack.push(),
+                                            scope: scope,
+                                         topTitle: String(localized: "Chosen 
amount to withdraw:"),
+                                        topAbbrev: String(localized: 
"Withdraw:", comment: "Chosen amount to withdraw:"),
+                                        topAmount: raw,
+                                           noFees: exchange.noFees,
+                                              fee: fee,
+                                    feeIsNegative: true,
+                                      bottomTitle: String(localized: "Amount 
to obtain:"),
+                                     bottomAbbrev: String(localized: 
"Obtain:", comment: "Amount to obtain:"),
+                                     bottomAmount: effective,
+                                            large: false,
+                                          pending: false,
+                                         incoming: true,
+                                          baseURL: exchange.exchangeBaseUrl,
+                                       txStateLcl: nil,        // 
common.txState.major.localizedState
+                                          summary: nil,
+                                         merchant: nil,
+                                         products: nil)
+                        if let wireFee {
+                            if !wireFee.isZero {
+                                let currencyInfo = controller.info(for: scope, 
controller.currencyTicker)
+                                let feeStr = wireFee.formatted(currencyInfo, 
isNegative: false)
+                                Text("Your bank's wire fee: \(feeStr)")
+                            }
+                        }
+                    } else {
+                        Section {
+                            Text("The amount will be determined by the Cash 
Acceptor.")
                         }
                     }
                 }
@@ -106,7 +112,7 @@ struct WithdrawAcceptView: View {
 //                                                             scope: scope,
                                                    exchangeBaseUrl: 
exchange.exchangeBaseUrl,
                                                                url: url,
-                                                  amountToTransfer: 
amountToTransfer)
+                                                  amountToTransfer: 
amountToTransfer.isZero ? nil : amountToTransfer)
                         NavigationLink(destination: destination) {
                             Text("Confirm Withdrawal")      // 
SHEET_WITHDRAW_ACCEPT
                         }

-- 
To stop receiving notification emails like this one, please contact
gnunet@gnunet.org.



reply via email to

[Prev in Thread] Current Thread [Next in Thread]