Skip to content

Gated gift subscriptions on paid members enabled#28298

Merged
sagzy merged 1 commit into
mainfrom
gift-subscriptions/gate-by-stripe-and-members-enabled
Jun 1, 2026
Merged

Gated gift subscriptions on paid members enabled#28298
sagzy merged 1 commit into
mainfrom
gift-subscriptions/gate-by-stripe-and-members-enabled

Conversation

@sagzy
Copy link
Copy Markdown
Contributor

@sagzy sagzy commented Jun 1, 2026

closes https://linear.app/ghost/issue/BER-3693

  • Gift subscriptions were available if Stripe is connected
  • With this change, we also check whether memberships are enabled. Gating for gift subscriptions is now: Stripe connected + members enabled (signup access is not set to none)

@coderabbitai
Copy link
Copy Markdown
Contributor

coderabbitai Bot commented Jun 1, 2026

Review Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

Run ID: 3ef88001-971b-4b9e-8bda-b5f9ddb08d6a

📥 Commits

Reviewing files that changed from the base of the PR and between dacccc4 and 7dc3c77.

📒 Files selected for processing (5)
  • apps/admin-x-settings/src/components/settings/membership/membership-settings.tsx
  • apps/admin-x-settings/src/components/settings/membership/portal/portal-links.tsx
  • apps/admin-x-settings/src/components/sidebar.tsx
  • ghost/core/core/server/services/members/members-api/controllers/router-controller.js
  • ghost/core/test/unit/server/services/members/members-api/controllers/router-controller.test.js
🚧 Files skipped from review as they are similar to previous changes (4)
  • ghost/core/core/server/services/members/members-api/controllers/router-controller.js
  • apps/admin-x-settings/src/components/settings/membership/membership-settings.tsx
  • apps/admin-x-settings/src/components/settings/membership/portal/portal-links.tsx
  • apps/admin-x-settings/src/components/sidebar.tsx

Walkthrough

This PR switches gift-subscription gating from Stripe-configuration checks to the paid_members_enabled setting across admin UI and server code. MembershipSettings, portal links, and sidebar now read paid_members_enabled to show gift-subscription keywords, portal links, and navigation. RouterController._createGiftCheckoutSession now verifies settingsHelpers.arePaidMembersEnabled() before proceeding, and unit tests are updated to cover the disabled case.

Possibly related PRs

  • TryGhost/Ghost#28292: Updates stripe-api.createGiftCheckoutSession to enable invoice_creation for gift checkout sessions, affecting the same gift subscription checkout flow that this PR guards.
  • TryGhost/Ghost#27982: Original PR introducing the "Gift subscriptions" membership UI section and sidebar navigation gated on Stripe; this PR changes that gating to use paid_members_enabled instead.
  • TryGhost/Ghost#27965: Modifies gift checkout handling (accepting and forwarding customerEmail) in the checkout/controller/payment/Stripe flow, which interacts with the same gift checkout path guarded here.

Suggested labels

preview

Suggested reviewers

  • minimaluminium
🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Title check ✅ Passed The title 'Gated gift subscriptions on paid members enabled' accurately and clearly summarizes the primary change in the pull request.
Description check ✅ Passed The description is directly related to the changeset, explaining the gating logic change for gift subscriptions and referencing the issue being closed.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch gift-subscriptions/gate-by-stripe-and-members-enabled

Warning

There were issues while running some tools. Please review the errors and either fix the tool's configuration or disable the tool if it's a critical failure.

🔧 ast-grep (0.43.0)
ghost/core/test/unit/server/services/members/members-api/controllers/router-controller.test.js

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@sagzy sagzy enabled auto-merge (squash) June 1, 2026 14:57
Copy link
Copy Markdown

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Choose a reason for hiding this comment

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

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: dacccc4390

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

@sagzy sagzy force-pushed the gift-subscriptions/gate-by-stripe-and-members-enabled branch from dacccc4 to 863db30 Compare June 1, 2026 15:03
closes https://linear.app/ghost/issue/BER-3693

- Gift subscriptions were available if Stripe is connected
- With this change, we also check whether memberships are enabled. Gating for gift subscriptions is now: Stripe connected + members enabled (signup access is not set to none)
@sagzy sagzy force-pushed the gift-subscriptions/gate-by-stripe-and-members-enabled branch from 863db30 to 7dc3c77 Compare June 1, 2026 15:03
@sagzy sagzy disabled auto-merge June 1, 2026 15:06
@sagzy sagzy enabled auto-merge (squash) June 1, 2026 15:08
@sagzy sagzy merged commit 1123fff into main Jun 1, 2026
50 checks passed
@sagzy sagzy deleted the gift-subscriptions/gate-by-stripe-and-members-enabled branch June 1, 2026 15:26
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