feat(billing): polar-sync creates the Migrate-with-Studio bundle and yearly products - #411
Merged
Merged
Conversation
…yearly products
A third sync step creates, per plan, the bundle product (year 1 at 20% off)
and the yearly list-price product the Polar plugin already reads through
the NUXT_POLAR_{STARTER,PRO}_{BUNDLE,YEARLY}_PRODUCT_ID env names.
Prices come from shared/utils/migrate-bundle.ts. Products are matched by a
new contentrain_variant tag (no tag means monthly, so the existing
products keep matching). Metered prices and meter credits are not
attached yet: a yearly period grants credits per billing cycle.
Member
Author
|
ONAY on 2742319 (local checks).
|
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.
What
pnpm polar:syncgets a third step that creates the four products Migrate with Studio sells through: per plan a bundle product (year 1 at 20% off) and a yearly list-price product. The Polar plugin already reads them viaNUXT_POLAR_{STARTER,PRO}_{BUNDLE,YEARLY}_PRODUCT_ID.shared/utils/migrate-bundle.ts(Starter $72 / $90, Pro $392 / $490), not a second copy.contentrain_variant; a product with no tag is monthly, so the existing Starter/Pro keep matching and are untouched.Evidence (sandbox)
--applyon sandbox only (NUXT_POLAR_SERVER=sandbox).createBundleCheckoutdoes for 49000 (Migrate fee) + 7200 (Starter year 1): amount 56200, total 56200, bundle product, yearly interval. Paying it is not done here.Reviewer: t6