Skip to content

feat: add Paykit subscriptions - #685

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

feat: add Paykit subscriptions#685
ben-kaufman wants to merge 2 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.

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 coverage:

  1. Receive an immediate-start private subscription proposal, review it, confirm it, pay the first period, and verify that Subscribed appears only after payment succeeds.
  2. Exercise failed and uncertain initial payments and verify that the first period remains due with a retry path.
  3. Receive a future-start proposal, verify its active state, trigger its due notification, and open the associated payment flow.
  4. Dismiss a due subscription request, reopen it from the bell queue and Payments tab, and complete payment.
  5. Review active, expired, fixed-term, and open-ended subscription details and cancel an active subscription.
  6. Pay a later period and verify that it uses fresh private payment details without trying another endpoint from a consumed list or falling back to public details.

Automated and static checks:

  • PaykitPaymentRequestServiceTests
  • PaykitPaymentProofServiceTests
  • arm64 iOS simulator Debug build
  • changed-file SwiftFormat validation
  • 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