fix: harden Paykit request handling - #684
Open
ben-kaufman wants to merge 2 commits into
Open
Conversation
8 tasks
Greptile SummaryThis PR hardens incoming Paykit contact-payment handling by isolating malformed receiver markers and validating request amounts against the balance before entering the send flow.
Confidence Score: 5/5The PR appears safe to merge, with the changed preflight checks aligned to the amount ultimately paid and malformed markers safely isolated from valid contacts. Private Paykit endpoints are intentionally amountless, the incoming request amount is injected into payment execution and checked again during confirmation, and valid receiver paths continue through publication while malformed paths remain rejected and logged.
|
| Filename | Overview |
|---|---|
| Bitkit/Services/PrivatePaykitService+Contacts.swift | Stops a malformed receiver marker from becoming the aggregate publication error while retaining logging and processing valid receiver paths. |
| Bitkit/ViewModels/AppViewModel.swift | Uses the incoming request amount for initial Lightning and on-chain affordability checks, matching the amount later injected into payment execution. |
| changelog.d/next/paykit-request-qa.fixed.md | Accurately documents the malformed-marker isolation and insufficient-balance handling fixes. |
Flowchart
%%{init: {'theme': 'neutral'}}%%
flowchart TD
A[Incoming Paykit request] --> B[Resolve private amountless endpoint]
B --> C[Decode Lightning, on-chain, or unified target]
C --> D[Read amount from incoming request]
D --> E{Preferred route has sufficient balance?}
E -->|Yes| F[Open shared send flow]
E -->|No, unified request| G{On-chain balance sufficient?}
G -->|Yes| F
G -->|No| H[Show insufficient balance message]
E -->|No, single route| H
F --> I[Inject request amount]
I --> J[Confirm exact request amount]
J --> K[Pay]
Reviews (1): Last reviewed commit: "fix: harden Paykit contact payments" | Re-trigger Greptile
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.
This PR hardens incoming Paykit contact-payment handling after QA on the cross-platform payment-request flow.
Description
No Paykit SDK or binding change is required. Companion Android fix: synonymdev/bitkit-android#1172
Linked Issues/Tasks
Screenshot / Video
N/A — this corrects error handling in the existing payment-request flow.
QA Notes
Manual Tests
Automated Checks
PrivatePaykitServiceTests: 15 tests passed on an iPhone 16 simulator.git diff --checkpassed.