feat: support incoming paykit requests#1098
Conversation
Greptile SummaryThis PR adds support for incoming Paykit payment requests. The main changes are:
Confidence Score: 4/5The legacy backup restore path needs a compatibility fix before merging.
app/src/main/java/to/bitkit/repositories/PrivatePaykitRepo.kt
|
| Filename | Overview |
|---|---|
| app/src/main/java/to/bitkit/repositories/PrivatePaykitRepo.kt | Adds private resolution and consumed-version persistence, but the new backup envelope breaks restoration of legacy backups. |
| app/src/main/java/to/bitkit/repositories/PaykitPaymentRequestRepo.kt | Adds synchronized request intake, filtering, expiration, and acceptance. |
| app/src/main/java/to/bitkit/viewmodels/AppViewModel.kt | Connects request polling and presentation to the existing payment flow. |
| app/src/main/java/to/bitkit/services/PaykitSdkService.kt | Adapts the service to separate public and private Paykit APIs and advertises request support. |
Sequence Diagram
sequenceDiagram
participant Contact as Paykit Contact
participant SDK as Paykit SDK
participant Requests as Payment Request Repo
participant App as App View Model
participant Private as Private Paykit Repo
participant Wallet as Send Flow
Contact->>SDK: Publish payment request
Requests->>SDK: Receive and query requests
Requests-->>App: Emit actionable request
App->>Private: Resolve private payment details
Private->>SDK: Resolve after consumed version
SDK-->>Private: Endpoint and list version
Private-->>App: Open payment details
App-->>Wallet: Show confirmation
Wallet->>App: User approves
App->>Requests: Accept request
App->>Private: Persist consumed version
App->>Wallet: Submit payment
Reviews (1): Last reviewed commit: "feat: support incoming paykit requests" | Re-trigger Greptile
| paykitSdkService.clearState() | ||
| } else { | ||
| paykitSdkService.restoreBackupState(backup) | ||
| val decoded = json.decodeFromString<PrivatePaykitBackup>(backup) |
There was a problem hiding this comment.
Previous releases stored exportBackupState() as a raw string, but this line now decodes every non-null backup as PrivatePaykitBackup JSON. Restoring a backup created before this change therefore fails during decoding and never calls restoreBackupState(); the restore path needs to recognize and migrate the legacy format.
There was a problem hiding this comment.
No code change here: this raw backup format only exists in the unshipped parent Paykit work, so there are no production backups to migrate. Per the pre-release scope of this stack, we are intentionally not adding migration or backward-compatibility code.
5050c1e to
edb688f
Compare
9bae4d5 to
b27d8b5
Compare
b27d8b5 to
eda7df2
Compare
Description
This PR builds on #1084 to support incoming Paykit payment requests:
0.1.0-rc39and uses its separate public and private payment resolution APIs.Payment proofs and receipts remain out of scope.
References:
Preview
N/A — the existing payment UI is reused, and no media is attached.
QA Notes
Manual Tests
Automated Checks
PaykitPaymentRequestRepoTest.kt: request mapping, expiry, lifecycle, and acceptance.PrivatePaykitRepoTest.kt: separate resolution, consumed-list persistence, and prevention of private payment-detail reuse.AppViewModelSendFlowTest.kt: presentation, polling, approval order, expiry, and duplicate or pending consumption.