From 84baefd4fa063ed087d73d0cc83f7f20f3cbd128 Mon Sep 17 00:00:00 2001 From: Brandon McAnsh Date: Thu, 29 Oct 2026 12:40:26 -0400 Subject: [PATCH 1/5] fix(requests): show insufficient funds when a token can't cover the share Session.price caps the amount at the token balance, so the balance check before sending always passed. Paying a $1 share from $0.72 of Launch It sent $0.72 and the server rejected it ("payment must pay the share exactly"), which showed Couldn't Send. The check now uses the uncapped share from enteredFiat(for:rate:), as GiveViewModel does, so the swipe shows the insufficient funds dialog. The capped amount is still what gets sent. --- .../Core/Screens/PaymentRequest/PaymentRequestPayment.swift | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/Flipcash/Core/Screens/PaymentRequest/PaymentRequestPayment.swift b/Flipcash/Core/Screens/PaymentRequest/PaymentRequestPayment.swift index 605071e20..b761b0f46 100644 --- a/Flipcash/Core/Screens/PaymentRequest/PaymentRequestPayment.swift +++ b/Flipcash/Core/Screens/PaymentRequest/PaymentRequestPayment.swift @@ -152,8 +152,9 @@ final class PaymentRequestPayment { return .failed } - // Backstop: the balance can drop between the pre-check and the swipe. - switch session.hasSufficientFunds(for: amount) { + // Gate on the uncapped share: `amount` is capped at the balance, so it always passes. + let uncapped = selectedBalance.enteredFiat(for: fiat.value, rate: pin.rate) ?? amount + switch session.hasSufficientFunds(for: uncapped) { case .insufficient(let shortfall): showInsufficientFunds(shortfall: shortfall) return .failed From 9ec365fe10e2be8fc03f3b19a35658ac3acc0106 Mon Sep 17 00:00:00 2001 From: Brandon McAnsh Date: Thu, 29 Oct 2026 12:43:16 -0400 Subject: [PATCH 2/5] fix(requests): suggest another currency when a share can't be covered A request share is a fixed amount, so "try again with a lower amount" had no way to act on it. The subtitle now points at paying with a different currency. --- .../Core/Screens/PaymentRequest/PaymentRequestPayment.swift | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Flipcash/Core/Screens/PaymentRequest/PaymentRequestPayment.swift b/Flipcash/Core/Screens/PaymentRequest/PaymentRequestPayment.swift index b761b0f46..ac59b0eca 100644 --- a/Flipcash/Core/Screens/PaymentRequest/PaymentRequestPayment.swift +++ b/Flipcash/Core/Screens/PaymentRequest/PaymentRequestPayment.swift @@ -219,8 +219,8 @@ final class PaymentRequestPayment { private func showInsufficientFunds(shortfall: ExchangedFiat?) { let title = shortfall.map { "You're \($0.nativeAmount.formatted()) Short" } ?? "You Need More Cash" let subtitle = shortfall == nil - ? "Please add more cash, or try again with a lower amount" - : "Add more cash, or try again with a lower amount" + ? "Please add more cash, or pay with a different currency" + : "Add more cash, or pay with a different currency" session.dialogItem = .error(title: title, subtitle: subtitle) { .destructive("Add More Cash") { [weak self] in self?.depositMint = self?.selectedBalance?.stored.mint From ce38bb1f09bfe1e9c6e8781d04139d27083d3b35 Mon Sep 17 00:00:00 2001 From: Brandon McAnsh Date: Thu, 29 Oct 2026 12:45:29 -0400 Subject: [PATCH 3/5] fix(requests): point at selecting a different Community Currency --- .../xcshareddata/swiftpm/Package.resolved | 10 +++++----- .../Screens/PaymentRequest/PaymentRequestPayment.swift | 4 ++-- 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/Code.xcodeproj/project.xcworkspace/xcshareddata/swiftpm/Package.resolved b/Code.xcodeproj/project.xcworkspace/xcshareddata/swiftpm/Package.resolved index 54b6f3957..06040ef0d 100644 --- a/Code.xcodeproj/project.xcworkspace/xcshareddata/swiftpm/Package.resolved +++ b/Code.xcodeproj/project.xcworkspace/xcshareddata/swiftpm/Package.resolved @@ -1,5 +1,5 @@ { - "originHash" : "0949e333ed9deff2d24a867708577c820b601cd4655fa62ed4d469a4d88f6147", + "originHash" : "f17a20c394cb2f9ff4303f14ce7697f1acc08d81d8439e2b02f2289ea87dc0aa", "pins" : [ { "identity" : "abseil-cpp-binary", @@ -357,8 +357,8 @@ "kind" : "remoteSourceControl", "location" : "https://github.com/apple/swift-nio-http2.git", "state" : { - "revision" : "61d1b44f6e4e118792be1cff88ee2bc0267c6f9a", - "version" : "1.44.0" + "revision" : "0f3e54e29c944c2e835ad52159da7d9e1c94ac69", + "version" : "1.46.0" } }, { @@ -411,8 +411,8 @@ "kind" : "remoteSourceControl", "location" : "https://github.com/apple/swift-system.git", "state" : { - "revision" : "7c6ad0fc39d0763e0b699210e4124afd5041c5df", - "version" : "1.6.4" + "revision" : "869129b7bf4ecc57b97d0193ad29690ca2134750", + "version" : "1.8.1" } }, { diff --git a/Flipcash/Core/Screens/PaymentRequest/PaymentRequestPayment.swift b/Flipcash/Core/Screens/PaymentRequest/PaymentRequestPayment.swift index ac59b0eca..d726df249 100644 --- a/Flipcash/Core/Screens/PaymentRequest/PaymentRequestPayment.swift +++ b/Flipcash/Core/Screens/PaymentRequest/PaymentRequestPayment.swift @@ -219,8 +219,8 @@ final class PaymentRequestPayment { private func showInsufficientFunds(shortfall: ExchangedFiat?) { let title = shortfall.map { "You're \($0.nativeAmount.formatted()) Short" } ?? "You Need More Cash" let subtitle = shortfall == nil - ? "Please add more cash, or pay with a different currency" - : "Add more cash, or pay with a different currency" + ? "Please add more cash, or select a different Community Currency" + : "Add more cash, or select a different Community Currency" session.dialogItem = .error(title: title, subtitle: subtitle) { .destructive("Add More Cash") { [weak self] in self?.depositMint = self?.selectedBalance?.stored.mint From 0a52648788551ec7811478f63b8fc0308550e134 Mon Sep 17 00:00:00 2001 From: Brandon McAnsh Date: Thu, 29 Oct 2026 12:45:55 -0400 Subject: [PATCH 4/5] chore: drop an unrelated Package.resolved change --- .../xcshareddata/swiftpm/Package.resolved | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/Code.xcodeproj/project.xcworkspace/xcshareddata/swiftpm/Package.resolved b/Code.xcodeproj/project.xcworkspace/xcshareddata/swiftpm/Package.resolved index 06040ef0d..54b6f3957 100644 --- a/Code.xcodeproj/project.xcworkspace/xcshareddata/swiftpm/Package.resolved +++ b/Code.xcodeproj/project.xcworkspace/xcshareddata/swiftpm/Package.resolved @@ -1,5 +1,5 @@ { - "originHash" : "f17a20c394cb2f9ff4303f14ce7697f1acc08d81d8439e2b02f2289ea87dc0aa", + "originHash" : "0949e333ed9deff2d24a867708577c820b601cd4655fa62ed4d469a4d88f6147", "pins" : [ { "identity" : "abseil-cpp-binary", @@ -357,8 +357,8 @@ "kind" : "remoteSourceControl", "location" : "https://github.com/apple/swift-nio-http2.git", "state" : { - "revision" : "0f3e54e29c944c2e835ad52159da7d9e1c94ac69", - "version" : "1.46.0" + "revision" : "61d1b44f6e4e118792be1cff88ee2bc0267c6f9a", + "version" : "1.44.0" } }, { @@ -411,8 +411,8 @@ "kind" : "remoteSourceControl", "location" : "https://github.com/apple/swift-system.git", "state" : { - "revision" : "869129b7bf4ecc57b97d0193ad29690ca2134750", - "version" : "1.8.1" + "revision" : "7c6ad0fc39d0763e0b699210e4124afd5041c5df", + "version" : "1.6.4" } }, { From 72f366379118bab0f8152e50ba752bf7d144a87b Mon Sep 17 00:00:00 2001 From: Brandon McAnsh Date: Thu, 29 Oct 2026 12:47:15 -0400 Subject: [PATCH 5/5] chore(deps): commit the Package.resolved an Xcode build on main produces Resolving on main moves swift-nio-http2 1.44.0 -> 1.46.0 and swift-system 1.6.4 -> 1.8.1 and changes originHash, so the checked-in file was out of date with the manifests. --- .../xcshareddata/swiftpm/Package.resolved | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/Code.xcodeproj/project.xcworkspace/xcshareddata/swiftpm/Package.resolved b/Code.xcodeproj/project.xcworkspace/xcshareddata/swiftpm/Package.resolved index 54b6f3957..06040ef0d 100644 --- a/Code.xcodeproj/project.xcworkspace/xcshareddata/swiftpm/Package.resolved +++ b/Code.xcodeproj/project.xcworkspace/xcshareddata/swiftpm/Package.resolved @@ -1,5 +1,5 @@ { - "originHash" : "0949e333ed9deff2d24a867708577c820b601cd4655fa62ed4d469a4d88f6147", + "originHash" : "f17a20c394cb2f9ff4303f14ce7697f1acc08d81d8439e2b02f2289ea87dc0aa", "pins" : [ { "identity" : "abseil-cpp-binary", @@ -357,8 +357,8 @@ "kind" : "remoteSourceControl", "location" : "https://github.com/apple/swift-nio-http2.git", "state" : { - "revision" : "61d1b44f6e4e118792be1cff88ee2bc0267c6f9a", - "version" : "1.44.0" + "revision" : "0f3e54e29c944c2e835ad52159da7d9e1c94ac69", + "version" : "1.46.0" } }, { @@ -411,8 +411,8 @@ "kind" : "remoteSourceControl", "location" : "https://github.com/apple/swift-system.git", "state" : { - "revision" : "7c6ad0fc39d0763e0b699210e4124afd5041c5df", - "version" : "1.6.4" + "revision" : "869129b7bf4ecc57b97d0193ad29690ca2134750", + "version" : "1.8.1" } }, {