stack/packages/stack-shared/src
Aman Ganapathy 0e85b05c3d
[Fix]: Payments App Sundry Fixes (#1455)
### Summary of Changes
You can now edit items on a product view.
The "Make free" button is less obtuse, and it clearly tells you what
it's going to do.
Additionally, we found out while working on this PR that you cannot
create a `paymentIntent` on stripe that is < 0.5$. So, you can't create
an OTP for a "free" product. We add safeguards to protect against that.
Also, 0 dollar subscriptions don't create a subscription invoice.
Additionally, the old code relied on being able to fetch the stripe
client secret, which would be null for a 0 dollar subscription so we
create a carve out.



<!-- This is an auto-generated comment: release notes by coderabbit.ai
-->
## Summary by CodeRabbit

* **New Features**
* Better free-product checkout handling: $0 subscriptions return an
empty success response without a payment client secret; non-free
subscriptions include client secret when needed.
* UI: “Make free” flow, “Free · {amount}” with price ID, per-price
checkout error indicators/tooltips, and an alert for products with
invalid prices.
  * Client- and server-side Stripe one-time minimum checks.

* **Bug Fixes**
* Included-item dialog now resets form state when opened to avoid stale
values.

* **Documentation**
* OpenAPI: clarified client_secret may be omitted when no customer
confirmation is required.

* **Tests**
  * Added end-to-end tests covering $0 purchase-session flows.

<!-- review_stack_entry_start -->

[![Review Change
Stack](https://storage.googleapis.com/coderabbit_public_assets/review-stack-in-coderabbit-ui.svg)](https://app.coderabbit.ai/change-stack/hexclave/stack-auth/pull/1455?utm_source=github_walkthrough&utm_medium=github&utm_campaign=change_stack)

<!-- review_stack_entry_end -->
<!-- end of auto-generated comment: release notes by coderabbit.ai -->
2026-05-20 19:33:14 -07:00
..
ai fix/kim john ung prompt (#1446) 2026-05-19 19:09:31 -07:00
apps Data-grid overhaul + session-replays / team-payments dashboard surfaces (#1424) 2026-05-15 14:16:47 -07:00
config Update GitHub URL 2026-05-19 10:27:53 -07:00
helpers [Feat] Hexclave AI integration: skill, MCP SKILL.md route, docs (#1434) 2026-05-15 14:30:23 -07:00
hooks Payments UX update (#863) 2025-08-27 17:28:01 -07:00
interface fix/kim john ung prompt (#1446) 2026-05-19 19:09:31 -07:00
payments [Fix]: Payments App Sundry Fixes (#1455) 2026-05-20 19:33:14 -07:00
utils Remote dev envs (#1435) 2026-05-19 15:54:18 -07:00
config-authoring.test.ts New setup (#1413) 2026-05-06 12:03:06 -07:00
config-authoring.ts New setup (#1413) 2026-05-06 12:03:06 -07:00
config-rendering.ts Remote dev envs (#1435) 2026-05-19 15:54:18 -07:00
crud.tsx Config DB (#568) 2025-04-10 19:38:25 +02:00
global.d.ts Replace required() of yup schemas with defined() 2024-11-18 20:08:55 +01:00
index.ts [docs][dashboard][stack-shared] Update docs to new apps (#996) 2025-11-12 15:45:30 -06:00
known-errors.tsx payments: rework refund flow to three-knob API (#1429) 2026-05-15 19:29:21 -07:00
local-emulator.ts stack-cli: explicit --cloud-project-id / --config-file across exec, config, project (#1422) 2026-05-14 17:20:40 -07:00
plans.ts [Refactor][Feat] Implement Plan Limits for Hard-and-Soft Item Caps (#1215) 2026-05-04 18:25:13 -07:00
schema-fields.ts [Refactor] [Fix] Remove default prod creation (#1350) 2026-05-15 10:38:33 -07:00
sessions.ts Remote dev envs (#1435) 2026-05-19 15:54:18 -07:00
stack-config-file.ts Remote dev envs (#1435) 2026-05-19 15:54:18 -07:00