[PR #5602] [MERGED] fix(stripe): remove TS error suppression updating getCheckoutSessionParams #6109

Closed
opened 2026-03-13 12:48:02 -05:00 by GiteaMirror · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/better-auth/better-auth/pull/5602
Author: @mohebifar
Created: 10/26/2025
Status: Merged
Merged: 10/27/2025
Merged by: @himself65

Base: canaryHead: fix/stripe-getcheckoutsessionparams-types


📝 Commits (1)

  • fa29f5c fix(stripe): remove TS error suppression updating getCheckoutSessionParams

📊 Changes

2 files changed (+2 additions, -1 deletions)

View changed files

📝 packages/stripe/src/index.ts (+0 -1)
📝 packages/stripe/src/types.ts (+2 -0)

📄 Description

In getCheckoutSessionParams, I needed to read the request JSON via ctx.body. Currently, the function receives ctx.request as the second argument, but that’s not compatible with the defined type. Using Request directly doesn’t help either, since the body has already been consumed by the time this runs. The most practical solution is to use the entire ctx object, however, that causes type mismatches.

This PR just corrects the typing.


Summary by cubic

Aligns getCheckoutSessionParams types with runtime usage so ctx and req are correctly typed and ctx.body can be read. Removes a TS suppression and improves type safety.

  • Bug Fixes

    • Updated SubscriptionOptions.getCheckoutSessionParams to accept (data, req, ctx) with req: GenericEndpointContext["request"].
    • Call site now passes ctx.request and ctx; removed @ts-expect-error.
  • Migration

    • If you implement getCheckoutSessionParams, add the new req argument before ctx.

🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/better-auth/better-auth/pull/5602 **Author:** [@mohebifar](https://github.com/mohebifar) **Created:** 10/26/2025 **Status:** ✅ Merged **Merged:** 10/27/2025 **Merged by:** [@himself65](https://github.com/himself65) **Base:** `canary` ← **Head:** `fix/stripe-getcheckoutsessionparams-types` --- ### 📝 Commits (1) - [`fa29f5c`](https://github.com/better-auth/better-auth/commit/fa29f5ca94c62f22d21de65007d7d0a749fd2af7) fix(stripe): remove TS error suppression updating getCheckoutSessionParams ### 📊 Changes **2 files changed** (+2 additions, -1 deletions) <details> <summary>View changed files</summary> 📝 `packages/stripe/src/index.ts` (+0 -1) 📝 `packages/stripe/src/types.ts` (+2 -0) </details> ### 📄 Description In `getCheckoutSessionParams`, I needed to read the request JSON via `ctx.body`. Currently, the function receives `ctx.request` as the second argument, but that’s not compatible with the defined type. Using `Request` directly doesn’t help either, since the body has already been consumed by the time this runs. The most practical solution is to use the entire `ctx` object, however, that causes type mismatches. This PR just corrects the typing. <!-- This is an auto-generated description by cubic. --> --- ## Summary by cubic Aligns getCheckoutSessionParams types with runtime usage so ctx and req are correctly typed and ctx.body can be read. Removes a TS suppression and improves type safety. - **Bug Fixes** - Updated SubscriptionOptions.getCheckoutSessionParams to accept (data, req, ctx) with req: GenericEndpointContext["request"]. - Call site now passes ctx.request and ctx; removed @ts-expect-error. - **Migration** - If you implement getCheckoutSessionParams, add the new req argument before ctx. <!-- End of auto-generated description by cubic. --> --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
GiteaMirror added the pull-request label 2026-03-13 12:48:02 -05:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: github-starred/better-auth#6109