Skip to content

feat: add Paykit subscriptions - #685

Open
ben-kaufman wants to merge 3 commits into
codex/paykit-payment-proofsfrom
codex/paykit-subscriptions
Open

feat: add Paykit subscriptions#685
ben-kaufman wants to merge 3 commits into
codex/paykit-payment-proofsfrom
codex/paykit-subscriptions

Conversation

@ben-kaufman

@ben-kaufman ben-kaufman commented Aug 26, 2026

Copy link
Copy Markdown
Contributor

Description

Adds the payer side of Paykit subscriptions, stacked on #683.

  • Receives private subscription proposals and lets the payer review and confirm them.
  • Requires an immediately due first period to be paid before showing the subscribed success state; failed or uncertain payments remain due and can be retried.
  • Turns each unpaid billing period into the existing incoming payment-request flow, including automatic presentation, the bell queue, and the Payments tab.
  • Schedules local due-payment notifications and opens the corresponding request when the notification is selected.
  • Adds the Figma-aligned Subscriptions and Payments tabs, subscription detail/status views, cancellation, empty states, and fixed/open-ended summaries.
  • Associates payment proofs with their exact billing period so recurring periods remain independent while retaining private-only resolution and fresh Private Payment List requirements.
  • Keeps subscribe-and-pay inside one continuously presented sheet, including initial-payment failure and retry, without the modal dismissal/reappearance gap.
  • Retains the settled payment rail in completed request and subscription history so Lightning feedback is purple and on-chain feedback is orange, including success confetti.

This PR intentionally covers payer-side receipt only. Subscription creation, Discover, automatic payment without confirmation, and renewal are not included because they are outside this MVP or are not currently exposed by Paykit.

Dependencies:

Linked Issues/Tasks

Screenshot / Video

Final iOS and cross-platform proof recordings were completed locally; they are not attached to the PR.

QA Notes

Manual Tests

  • Receive an immediate-start private subscription proposal and verify review → payment → success stays in one continuously presented sheet.
  • Exercise failed and uncertain initial payments and verify retry stays in the same sheet while the first period remains due.
  • Complete Lightning and on-chain subscription payments and verify purple/orange success confetti and matching completed-payment icons.
  • Receive a future-start proposal, trigger its due notification, and open the exact billing-period payment.
  • Dismiss and reopen a due request from the bell queue and Payments tab, then pay it with fresh private payment details.
  • Review active, expired, fixed-term, and open-ended subscription details and cancel an active subscription.

Automated Checks

  • 97 focused PaykitPaymentRequestServiceTests and PaykitPaymentProofServiceTests
  • E2E regtest Debug build for an arm64 iOS simulator
  • Exact build installed and cold-launched on an iOS simulator
  • SwiftFormat validation for all 13 changed Swift files
  • Localization validation
  • git diff --check

@greptile-apps

greptile-apps Bot commented Aug 26, 2026

Copy link
Copy Markdown

Greptile Summary

Adds payer-side Paykit subscriptions, recurring billing-period requests, notification routing, and payment-proof association.

  • Introduces subscription proposal, overview, detail, cancellation, and initial-payment UI.
  • Extends Paykit request synchronization and persistence with recurring periods, due notifications, and retry state.
  • Integrates subscription payments into the existing private send and payment-proof flows.

Confidence Score: 3/5

This PR should not merge until persisted proofs remain readable across upgrades and on-chain reconciliation prevents one transaction from proving multiple requests.

Existing pending-proof records can permanently block proof reconciliation after upgrade, while address-and-amount-only transaction matching can associate one payment with multiple billing periods.

Files Needing Attention: Bitkit/Services/PaykitPaymentProofService.swift

Important Files Changed

Filename Overview
Bitkit/Services/PaykitPaymentProofService.swift Adds period-specific and delayed on-chain proof handling, but breaks decoding of existing persisted proofs and can reuse one txid across requests.
Bitkit/Services/PaykitPaymentRequestService.swift Expands request synchronization and manager state for recurring subscriptions, presentation, dismissal, cancellation, and notifications.
Bitkit/Services/PaykitSubscription.swift Defines subscription recurrence, billing periods, persisted state, and notification scheduling.
Bitkit/Views/Subscriptions/SubscriptionsView.swift Adds the subscription proposal, overview, detail, success, and cancellation interfaces.
Bitkit/Views/Wallets/Send/SendConfirmationView.swift Integrates initial subscription payments and uncertain on-chain outcomes into the shared send flow.
Bitkit/AppScene.swift Coordinates subscription notification routing, proposal presentation, and delayed on-chain attribution.

Sequence Diagram

sequenceDiagram
  participant Provider
  participant Paykit
  participant Manager as Request Manager
  participant UI as Subscription UI
  participant Send as Send Flow
  participant Proof as Proof Service
  Provider->>Paykit: Private subscription proposal
  Paykit->>Manager: Synchronize proposal
  Manager->>UI: Present review
  UI->>Manager: Accept subscription
  Manager->>Paykit: Accept request
  Manager->>Send: Open due billing period
  Send->>Proof: Prepare and mark payment started
  Send->>Proof: Complete payment
  Proof->>Paykit: Submit period-specific proof
  Proof-->>UI: Resolve success or retain retry state
Loading

Reviews (1): Last reviewed commit: "feat: add Paykit subscription payments" | Re-trigger Greptile

Comment thread Bitkit/Services/PaykitPaymentProofService.swift
Comment thread Bitkit/Services/PaykitPaymentProofService.swift
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant