feat: add quickpay daily spend limit - #1159
Open
ovitrif wants to merge 69 commits into
Open
Conversation
9 tasks
Greptile SummaryThis PR adds a persistent daily spending cap to QuickPay and coordinates reservation, dispatch, pending, and completion state across payment lifecycles.
Confidence Score: 5/5The PR appears safe to merge because no blocking failure remains within the eligible follow-up review scope. No blocking failure remains.
|
| Filename | Overview |
|---|---|
| app/src/main/java/to/bitkit/repositories/QuickPayRepo.kt | Introduces QuickPay sessions, payment dispatch coordination, persistent daily-cap reservations, completion settlement, and LDK reconciliation. |
| app/src/main/java/to/bitkit/viewmodels/AppViewModel.kt | Integrates daily-cap eligibility and QuickPay completion outcomes into Lightning request routing and settlement. |
| app/src/main/java/to/bitkit/repositories/PendingPaymentRepo.kt | Replaces buffered resolution delivery with hash-addressable resolution storage and explicit consumption. |
| app/src/main/java/to/bitkit/viewmodels/QuickPayViewModel.kt | Delegates QuickPay payment lifecycle management to QuickPayRepo and maps session events into UI state. |
| app/src/main/java/to/bitkit/ui/settings/quickPay/QuickPaySettingsScreen.kt | Adds the configurable daily-limit multiplier and resolved daily-limit presentation. |
| app/src/main/java/to/bitkit/ui/components/Slider.kt | Updates slider gesture handling, tap selection, and label-aware layout behavior. |
| app/src/main/java/to/bitkit/repositories/LightningRepo.kt | Adds a pre-dispatch callback and payment lookup support needed by QuickPay reservation and reconciliation. |
Flowchart
%%{init: {'theme': 'neutral'}}%%
flowchart TD
A[Decoded Lightning request] --> B{QuickPay enabled and per-tx eligible?}
B -- No --> C[Confirm payment]
B -- Yes --> D{Daily-cap reservation succeeds?}
D -- No --> C
D -- Yes --> E[Persist hash-bound reservation]
E --> F[Dispatch Lightning payment]
F --> G{Completion before timeout?}
G -- Success --> H[Keep daily spend and show success]
G -- Failure --> I[Release matching-day spend and show error]
G -- No --> J[Show pending]
J --> K[Later completion signal]
K --> H
K --> I
Reviews (4): Last reviewed commit: "fix: keep quickpay data during fallback ..." | 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
marked this pull request as ready for review
August 24, 2026 16:15
ovitrif
requested review from
ben-kaufman,
jvsena42 and
piotr-iohk
and removed request for
ben-kaufman,
jvsena42 and
piotr-iohk
August 24, 2026 16:48
ben-kaufman
reviewed
Aug 24, 2026
ben-kaufman
reviewed
Aug 24, 2026
ben-kaufman
reviewed
Aug 24, 2026
ben-kaufman
reviewed
Aug 24, 2026
ben-kaufman
reviewed
Aug 24, 2026
ben-kaufman
reviewed
Aug 24, 2026
ben-kaufman
reviewed
Aug 24, 2026
ovitrif
requested review from
ben-kaufman,
jvsena42 and
piotr-iohk
and removed request for
ben-kaufman,
jvsena42 and
piotr-iohk
August 25, 2026 11:24
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
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 daysignalCompletion; keep spend on success; release matching-day failure onlyQuickPayRepoowns sessions, in-flight ops, dispatch, and the daily-cap ledger.QuickPaySpendStoreis an internal class in the same file.Out of scope
Preview
Updated screenshot, integrating designer's feedback.
slider.mp4
1159-over-daily-cap-confirm-pin.mp4
QA Notes
Manual Tests
$copy updatesregression:Cold start / locked with PIN → scan stays deferred until unlock (fix: secure shop payments and locked links #1158), then follows the rules aboveAutomated Checks
QuickPayRepoTest.kt:reserveBoundsignalCompletionsuccess keeps spendsignalCompletionfailure rolls backsignalCompletionis idempotentQuickPayViewModelTest.kt:AppViewModelSendFlowTest.kt:signalCompletionPaymentFailedstill resolves PendingPendingPaymentRepoTest.kt:SendPendingViewModelTest.ktQuickPaySettingsScreenTest.kt