fix: add quickpay daily spend limit - #1159
Open
ovitrif wants to merge 25 commits into
Open
Conversation
9 tasks
Greptile SummaryThe PR adds a persisted, configurable daily spending cap for PIN-free QuickPay and routes over-cap payments through the normal confirmation flow.
Confidence Score: 5/5The PR appears safe to merge because no blocking failure remains in the eligible follow-up review scope. No blocking failure remains.
|
| Filename | Overview |
|---|---|
| app/src/main/java/to/bitkit/repositories/QuickPayRepo.kt | Introduces persisted calendar-day spend accounting, cap checks, and hash-bound reservation lifecycle operations. |
| app/src/main/java/to/bitkit/viewmodels/QuickPayViewModel.kt | Integrates spend reservation with payment submission and success, pending, failure, and confirmation-fallback outcomes. |
| app/src/main/java/to/bitkit/viewmodels/AppViewModel.kt | Delegates QuickPay eligibility to the repository and reconciles reservations from asynchronous payment events. |
| app/src/main/java/to/bitkit/ui/components/Slider.kt | Reworks the discrete slider to include labels in layout bounds and support current-value animation, accessibility semantics, and RTL input. |
| app/src/main/java/to/bitkit/ui/settings/quickPay/QuickPaySettingsScreen.kt | Adds the daily-limit multiplier control and resolved daily-dollar copy to the scrollable QuickPay settings screen. |
| app/src/main/java/to/bitkit/data/CacheStore.kt | Adds serialized QuickPay day-spend and payment-reservation state with backward-compatible defaults. |
| app/src/main/java/to/bitkit/data/SettingsStore.kt | Persists the configurable QuickPay daily-limit multiplier with a default value of five. |
Sequence Diagram
sequenceDiagram
participant User
participant App as AppViewModel
participant QP as QuickPayViewModel
participant Repo as QuickPayRepo
participant Store as CacheStore
participant LN as LightningRepo
User->>App: Scan Lightning payment
App->>Repo: canApply(amount)
alt Under transaction threshold and daily cap
App->>QP: Open QuickPay
QP->>Repo: tryReserve(amount)
Repo->>Store: Persist daily spend
QP->>LN: payInvoice(invoice)
Repo->>Store: Bind reservation to payment hash
alt Payment succeeds
QP->>Repo: clear(hash)
QP-->>User: Show success
else Payment remains pending
QP-->>User: Show pending
else Payment fails
QP->>Repo: release(hash)
Repo->>Store: Restore reserved spend
QP-->>User: Show failure
end
else Over threshold or daily cap
App-->>User: Open Confirm flow
end
Reviews (2): Last reviewed commit: "fix: keep quickpay events and spend in s..." | Re-trigger Greptile
ovitrif
force-pushed
the
fix/require-payment-pin-for-quickpay
branch
from
August 15, 2026 18:28
0807618 to
2e4a4c0
Compare
ovitrif
force-pushed
the
cursor/fix-shop-quickpay-auth-86ae
branch
from
August 15, 2026 18:28
32b59a5 to
49ab192
Compare
ovitrif
force-pushed
the
fix/require-payment-pin-for-quickpay
branch
from
August 15, 2026 23:03
2e4a4c0 to
7b9ea19
Compare
4 tasks
ovitrif
force-pushed
the
fix/require-payment-pin-for-quickpay
branch
from
August 18, 2026 09:24
7b9ea19 to
f10f4e2
Compare
This was referenced Aug 18, 2026
ovitrif
force-pushed
the
fix/require-payment-pin-for-quickpay
branch
from
August 18, 2026 14:44
e4a57bd to
4761c75
Compare
This comment was marked as resolved.
This comment was marked as resolved.
# Conflicts: # app/src/main/java/to/bitkit/repositories/PendingPaymentRepo.kt # app/src/main/java/to/bitkit/ui/screens/wallets/send/SendPendingScreen.kt # app/src/main/java/to/bitkit/viewmodels/AppViewModel.kt # app/src/main/java/to/bitkit/viewmodels/QuickPayViewModel.kt # app/src/test/java/to/bitkit/viewmodels/AppViewModelSendFlowTest.kt
This comment was marked as resolved.
This comment was marked as resolved.
Collaborator
Author
Was planning to tag @aldertnl here, but I also added comment with screenshots to Figma 👍🏻 . |
jvsena42
reviewed
Aug 19, 2026
Collaborator
Author
|
Drafted to fix the issues surfaced in the latest iOS review round. |
ovitrif
marked this pull request as draft
August 19, 2026 13:58
ovitrif
marked this pull request as ready for review
August 19, 2026 22:04
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Closes #1168
Builds on merged #1158 (base is
master).iOS port:
QuickPay stays PIN-free under limits (the point of QuickPay). A hard payment-PIN skip would remove that behavior, so this PR bounds auto-pay with a daily spend multiplier instead. Payments above the daily cap open Confirm, where PIN for payments still applies. Lock-time deferral remains in #1158.
Description
1,3,5,10,50; default5)threshold × multiplierin USD cents; spend rolls forward on the local calendar daypayInvoice; remember the reservation before pending-track; keep on Success/Pending, release on confirmed failurePreview
slider.mp4
1159-over-daily-cap-confirm-pin.mp4
QA Notes
AppViewModelSendFlowTest.kt,CacheStoreTest.kt,QuickPayViewModelTest.kt$copy updates