[PR #4716] [MERGED] fix(stripe): onCustomerCreate should be called even if update user isn't returned #5545

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

📋 Pull Request Information

Original PR: https://github.com/better-auth/better-auth/pull/4716
Author: @Bekacru
Created: 9/17/2025
Status: Merged
Merged: 9/17/2025
Merged by: @himself65

Base: canaryHead: fix/stripe-oncustomercreate


📝 Commits (1)

  • b9b260a fix(stripe): onCustomerCreate should be called even if update user isn't returned

📊 Changes

3 files changed (+14 additions, -15 deletions)

View changed files

📝 packages/better-auth/src/db/internal-adapter.ts (+1 -0)
📝 packages/stripe/src/index.ts (+12 -14)
📝 packages/stripe/src/types.ts (+1 -1)

📄 Description

Summary by cubic

Guarantees Stripe onCustomerCreate runs after customer creation, even if updateUser returns nothing. The callback now receives the user with stripeCustomerId included.

  • Bug Fixes
    • Always invoke onCustomerCreate after creating a Stripe customer; no longer blocked by updateUser’s return value.
    • Pass user with stripeCustomerId to the callback and update types to User & { stripeCustomerId: string }.

🔄 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/4716 **Author:** [@Bekacru](https://github.com/Bekacru) **Created:** 9/17/2025 **Status:** ✅ Merged **Merged:** 9/17/2025 **Merged by:** [@himself65](https://github.com/himself65) **Base:** `canary` ← **Head:** `fix/stripe-oncustomercreate` --- ### 📝 Commits (1) - [`b9b260a`](https://github.com/better-auth/better-auth/commit/b9b260a66432eab503043453922c00af94607013) fix(stripe): onCustomerCreate should be called even if update user isn't returned ### 📊 Changes **3 files changed** (+14 additions, -15 deletions) <details> <summary>View changed files</summary> 📝 `packages/better-auth/src/db/internal-adapter.ts` (+1 -0) 📝 `packages/stripe/src/index.ts` (+12 -14) 📝 `packages/stripe/src/types.ts` (+1 -1) </details> ### 📄 Description <!-- This is an auto-generated description by cubic. --> ## Summary by cubic Guarantees Stripe onCustomerCreate runs after customer creation, even if updateUser returns nothing. The callback now receives the user with stripeCustomerId included. - **Bug Fixes** - Always invoke onCustomerCreate after creating a Stripe customer; no longer blocked by updateUser’s return value. - Pass user with stripeCustomerId to the callback and update types to User & { stripeCustomerId: string }. <!-- 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:26:46 -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#5545