Skip to content

Purchasing products with billing plans#6772

Merged
fire-at-will merged 48 commits into
billing-plans-devfrom
purchasing-products-with-billing-plans
May 14, 2026
Merged

Purchasing products with billing plans#6772
fire-at-will merged 48 commits into
billing-plans-devfrom
purchasing-products-with-billing-plans

Conversation

@fire-at-will

@fire-at-will fire-at-will commented May 12, 2026

Copy link
Copy Markdown
Contributor

Description

Adds support for purchasing products with billing plans!

Testing

  • Added unit tests where we were able to
  • Unable to include integration tests for now due to StoreKit product fetching bug in Xcode 26.4+.

Note

Medium Risk
Touches the StoreKit 2 purchase flow by conditionally adding a new .billingPlanType purchase option and throwing when a plan is ineligible, which can change purchase outcomes on iOS 26.4+ devices. Guarded by OS/compiler availability but still impacts a critical revenue path.

Overview
Adds StoreKit 2 support for purchasing subscription products using Apple billing plans (installments) on iOS/macOS/tvOS/watchOS/visionOS 26.4+.

PurchasesOrchestrator now plumbs a BillingPlanType through the SK2 purchase path, conditionally applies .billingPlanType when the plan is present and eligible (based on subscription.pricingTerms), and fails fast with productNotAvailableForPurchaseError() when the user isn’t eligible. Logging was extended with new messages for applying a plan vs. rejecting an ineligible plan, and BillingPlanType gained a mapping back to StoreKit’s BillingPlanType; tests and the SwiftUI purchase tester were updated accordingly.

Reviewed by Cursor Bugbot for commit 04adb9a. Bugbot is set up for automated code reviews on this repo. Configure here.

@fire-at-will fire-at-will added the pr:feat A new feature label May 12, 2026
Comment thread Sources/Purchasing/Purchases/PurchasesOrchestrator.swift Outdated
Base automatically changed from fetching-products-with-billing-plans to billing-plans-dev May 13, 2026 20:37
@fire-at-will fire-at-will changed the title [WIP]: Purchasing products [WIP]: Purchasing products with billing plans May 13, 2026
@fire-at-will fire-at-will marked this pull request as ready for review May 13, 2026 21:24
@fire-at-will fire-at-will requested a review from a team as a code owner May 13, 2026 21:24
Comment thread Sources/Purchasing/Purchases/PurchasesOrchestrator.swift Outdated

@cursor cursor Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Cursor Bugbot has reviewed your changes and found 2 potential issues.

Fix All in Cursor

❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, have a team admin enable autofix in the Cursor dashboard.

Reviewed by Cursor Bugbot for commit f8a3e38. Configure here.

Comment thread Sources/Purchasing/Purchases/PurchasesOrchestrator.swift Outdated
@fire-at-will fire-at-will changed the title [WIP]: Purchasing products with billing plans [Billing Plans]: Purchasing products with billing plans May 13, 2026
@fire-at-will fire-at-will requested a review from tonidero May 13, 2026 22:10
@fire-at-will fire-at-will changed the title [Billing Plans]: Purchasing products with billing plans Purchasing products with billing plans May 14, 2026
@fire-at-will

Copy link
Copy Markdown
Contributor Author

After a discussion with @MarkVillacampa in Slack, we decided not to apply upFront billing plan to products that don't explicitly specify it. He also gave verbal approval for the PR, so I'll go ahead and merge this into the dev branch when CI finishes.

@fire-at-will fire-at-will merged commit 0ed02df into billing-plans-dev May 14, 2026
42 of 43 checks passed
@fire-at-will fire-at-will deleted the purchasing-products-with-billing-plans branch May 14, 2026 16:10
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

pr:feat A new feature

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants