🐛 Fixed Stripe checkout failing for accounts with Managed Payments enabled - #29715
Conversation
…abled Since late July 2026, Stripe has been provisioning some new accounts with Managed Payments (their merchant-of-record product) enabled by default for all Checkout Sessions. Managed Payments does not support Connect, so on those accounts every checkout attempt fails with "You specified a Stripe-Account header, but Managed Payments cannot be used with Connect" — members cannot subscribe at all, and the account-level default cannot always be disabled from the Stripe dashboard. Ghost never wants Managed Payments — it handles its own invoicing and connects via Stripe Connect — so we now explicitly disable it per session on every Checkout Session type (subscription, donation, gift, and setup). Verified against the live Stripe API that the parameter is accepted under the pinned 2020-08-27 API version and stripe-node 8.x, and that enabling it reproduces the reported failure exactly.
WalkthroughAdded a shared 🚥 Pre-merge checks | ✅ 4✅ Passed checks (4 passed)
✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
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. Comment |
|
| Command | Status | Duration | Result |
|---|---|---|---|
nx run ghost:test:ci:integration |
✅ Succeeded | 2m 47s | View ↗ |
nx run ghost:test:integration |
✅ Succeeded | 3m 22s | View ↗ |
nx run ghost:test:legacy |
✅ Succeeded | 2m 17s | View ↗ |
nx run ghost:test:e2e |
✅ Succeeded | 2m 47s | View ↗ |
nx run-many -t test:unit -p ghost |
✅ Succeeded | 28s | View ↗ |
nx run ghost-monorepo:lint:boundaries |
✅ Succeeded | 17s | View ↗ |
nx run-many -t lint -p ghost,ghost-monorepo |
✅ Succeeded | 16s | View ↗ |
nx run-many --target=build --projects=tag:publi... |
✅ Succeeded | <1s | View ↗ |
nx run @tryghost/admin:build |
✅ Succeeded | 3s | View ↗ |
💡 Verify your cache is correct by running tasks in a sandbox. Read docs ↗
☁️ Nx Cloud last updated this comment at 2026-08-03 09:13:30 UTC
There was a problem hiding this comment.
Actionable comments posted: 1
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In `@ghost/core/test/unit/server/services/stripe/stripe-api.test.js`:
- Around line 238-243: Update both Stripe session tests to use valid production
method arguments: in createCheckoutSetupSession, pass a customer object
containing id and email as the first argument; in createDonationCheckoutSession,
pass a single options object such as {priceId: 'priceId'}. Apply these changes
at ghost/core/test/unit/server/services/stripe/stripe-api.test.js lines 238-243
and 572-577.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: Path: .coderabbit.yaml
Review profile: CHILL
Plan: Pro Plus
Run ID: 4915ed75-edd4-48cf-990e-3dd00e25c882
📒 Files selected for processing (2)
ghost/core/core/server/services/stripe/stripe-api.jsghost/core/test/unit/server/services/stripe/stripe-api.test.js
no ref The setup-session test now passes a customer object and the donation test a single options object, matching the production method signatures instead of the loose shapes copied from neighbouring legacy tests.
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #29715 +/- ##
=======================================
Coverage 75.38% 75.38%
=======================================
Files 1607 1607
Lines 141658 141668 +10
Branches 17495 17496 +1
=======================================
+ Hits 106784 106797 +13
+ Misses 33806 33803 -3
Partials 1068 1068
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|

ref https://linear.app/ghost/issue/ONC-1928
ref https://ghost.slack.com/archives/CJBJ3MZFD/p1785434550639309
ref https://forum.ghost.org/t/stripe-checkout-session-fails-with-managed-payments-cannot-be-used-with-connect-on-self-hosted-ghost-6-52-1/63449/1
ref https://forum.ghost.org/t/paid-checkout-fails-for-both-the-monthly-and-annual-options/63465
Problem
Since late July 2026, Stripe has been provisioning some new accounts with Managed Payments (their merchant-of-record product) enabled by default for all Checkout Sessions. Managed Payments does not support Connect, so on those accounts every checkout attempt fails with a 400 from Stripe:
Members cannot start any paid subscription on affected sites. Affected site owners can't always opt out themselves: on default-on accounts the Stripe dashboard states Managed Payments "can only be disabled for individual sessions" and offers no account-level toggle.
Solution
Stripe checkout session creation now explicitly disables Managed Payments per session (
managed_payments: {enabled: false}) on all four Checkout Session types: subscription, donation, gift, and setup.Verified empirically against the live Stripe API using Connect-obtained test keys:
managed_payments[enabled]=falseis accepted under Ghost's pinned2020-08-27API version, on subscription-shaped (legacysubscription_data.items), payment-mode, and setup-mode session creation — so no API version bump or retry fallback is needed.enabled=true) on the same Connect key reproduces the reported error verbatim, confirming the failure mechanism.