Skip to content

[Billing Plans]: Add Public BillingPlanType.rawValue#6795

Merged
fire-at-will merged 6 commits into
billing-plans-devfrom
billing-plan-type-value
May 15, 2026
Merged

[Billing Plans]: Add Public BillingPlanType.rawValue#6795
fire-at-will merged 6 commits into
billing-plans-devfrom
billing-plan-type-value

Conversation

@fire-at-will

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

Copy link
Copy Markdown
Contributor

Description

Adds public BillingPlanType.rawValue property. Helpful for keeping track of the constant values internally, and will likely help make our lives easier when we port to the hybrids.


Note

Low Risk
Low risk: adds a public string accessor and updates a few internal call sites/tests; purchase flow behavior is unchanged aside from logging/identifier string formatting.

Overview
Adds a public BillingPlanType.rawValue (Swift + Objective-C) and updates billing-plan constants to be value-backed rather than anonymous instances.

Updates StoreKit billing-plan mapping and purchase-time logging to use BillingPlanType.rawValue (and makes TestStoreProduct IDs derive the plan suffix from the same value), plus adds/extends API and unit tests and refreshes generated .swiftinterface files accordingly.

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

@fire-at-will fire-at-will requested a review from a team as a code owner May 14, 2026 17:58
@fire-at-will fire-at-will changed the base branch from main to billing-plans-dev May 14, 2026 17:58

@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 1 potential issue.

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 2183d35. Configure here.

@fire-at-will fire-at-will changed the title [Billing Plans]: Add BillingPlanType.value [Billing Plans]: Add Public BillingPlanType.rawValue May 14, 2026
let subscriptionInfo = sk2Product.subscription, // Don't apply billing plans to OTPs
let sk2BillingPlanType = billingPlanType?.skBillingPlanType {
let billingPlanType,
let sk2BillingPlanType = billingPlanType.skBillingPlanType {

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

we dont need sk2BillingPlanType anymore do we?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

I think we do!

We need the sk2BillingPlanType instance variable here for a few reasons:

  1. To ensure that the StoreKit product has a pricing term with the provided billing plan. We can directly compare sk2BillingPlanType to the values in the StoreKit product since they're of the same type. This is done here on line 800: if eligibleBillingPlanTypes.contains(sk2BillingPlanType)
  2. We need the sk2BillingPlanType to insert it into the purchase options, since we can't insert our BillingPlanType directly into the purchase options. This is done here on line 804: options.insert(.billingPlanType(sk2BillingPlanType))

The BillingPlanType.skBillingPlanType property is internal, so it's not publicly available through our APIs 👍

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

I parsed this line completely wrong, disregard my message 😄

@fire-at-will fire-at-will merged commit 60c1d3c into billing-plans-dev May 15, 2026
42 of 43 checks passed
@fire-at-will fire-at-will deleted the billing-plan-type-value branch May 15, 2026 16:05
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants