[Billing Plans]: Add Public BillingPlanType.rawValue#6795
Merged
Conversation
There was a problem hiding this comment.
Cursor Bugbot has reviewed your changes and found 1 potential issue.
❌ 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.
| let subscriptionInfo = sk2Product.subscription, // Don't apply billing plans to OTPs | ||
| let sk2BillingPlanType = billingPlanType?.skBillingPlanType { | ||
| let billingPlanType, | ||
| let sk2BillingPlanType = billingPlanType.skBillingPlanType { |
Member
There was a problem hiding this comment.
we dont need sk2BillingPlanType anymore do we?
Contributor
Author
There was a problem hiding this comment.
I think we do!
We need the sk2BillingPlanType instance variable here for a few reasons:
- To ensure that the StoreKit product has a pricing term with the provided billing plan. We can directly compare
sk2BillingPlanTypeto the values in the StoreKit product since they're of the same type. This is done here on line 800:if eligibleBillingPlanTypes.contains(sk2BillingPlanType) - We need the
sk2BillingPlanTypeto insert it into the purchase options, since we can't insert ourBillingPlanTypedirectly 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 👍
Member
There was a problem hiding this comment.
I parsed this line completely wrong, disregard my message 😄
MarkVillacampa
approved these changes
May 15, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.

Description
Adds public
BillingPlanType.rawValueproperty. 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 makesTestStoreProductIDs derive the plan suffix from the same value), plus adds/extends API and unit tests and refreshes generated.swiftinterfacefiles accordingly.Reviewed by Cursor Bugbot for commit 803ed11. Bugbot is set up for automated code reviews on this repo. Configure here.