stack/apps/e2e
BilalG1 b2f8b96d41
one time payments (#865)
<!--

Make sure you've read the CONTRIBUTING.md guidelines:
https://github.com/stack-auth/stack-auth/blob/dev/CONTRIBUTING.md

-->

<!-- ELLIPSIS_HIDDEN -->


----

> [!IMPORTANT]
> Add support for one-time payments alongside subscriptions, including
database, API, and test updates.
> 
>   - **Behavior**:
>     - Support for one-time purchases added alongside subscriptions.
> - Purchase sessions now accept a quantity parameter for both normal
and test-mode flows.
> - Dashboard checkout auto-selects payment or subscription mode based
on price.
>   - **Database**:
>     - New `OneTimePurchase` table created in `migration.sql`.
> - `PurchaseCreationSource` enum replaces `SubscriptionCreationSource`
in `schema.prisma`.
>   - **API**:
> - `processStripeWebhookEvent()` in `route.tsx` handles one-time
purchase webhooks.
> - `purchase-session/route.tsx` and
`test-mode-purchase-session/route.tsx` updated for one-time purchases.
>   - **Tests**:
> - E2E tests added for one-time payments, stackability, and webhook
handling in `purchase-session.test.ts` and `stripe-webhooks.test.ts`.
> 
> <sup>This description was created by </sup>[<img alt="Ellipsis"
src="https://img.shields.io/badge/Ellipsis-blue?color=175173">](https://www.ellipsis.dev?ref=stack-auth%2Fstack-auth&utm_source=github&utm_medium=referral)<sup>
for 726ebe2328. You can
[customize](https://app.ellipsis.dev/stack-auth/settings/summaries) this
summary. It will automatically update as commits are pushed.</sup>

----


<!-- ELLIPSIS_HIDDEN -->

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

* **New Features**
* One-time purchases persisted and supported end-to-end; purchase
sessions accept quantity (default 1). Dashboard checkout auto-selects
payment vs subscription mode.

* **Bug Fixes**
* Centralized Stripe webhook handling with deduplication for retried
payment intents. Improved conflict resolution when switching offers
within groups; add-on and group rules enforced.

* **Tests**
* Expanded E2E and unit tests covering one-time flows, stackability,
test-mode paths, and webhook scenarios.
<!-- end of auto-generated comment: release notes by coderabbit.ai -->

---------

Co-authored-by: Konstantin Wohlwend <n2d4xc@gmail.com>
2025-09-12 17:14:09 -07:00
..
tests one time payments (#865) 2025-09-12 17:14:09 -07:00
.env Auto migration (#526) 2025-07-24 02:38:37 +02:00
.env.development Auto migration (#526) 2025-07-24 02:38:37 +02:00
.eslintrc.cjs tsup for stack-shared (#647) 2025-04-28 21:26:52 -07:00
CHANGELOG.md chore: update package versions 2025-09-12 16:55:16 -07:00
LICENSE Create users & auth endpoints in backend (#85) 2024-07-01 22:42:08 -07:00
package.json chore: update package versions 2025-09-12 16:55:16 -07:00
tsconfig.json In-source unit tests (#429) 2025-02-14 11:47:52 -08:00
vitest.config.ts Endpoints branching (#659) 2025-04-30 15:39:47 -07:00