Period fields not populated after stripe subscription
Hello,
period_start
and period_end
fields in the subscription object are not populated after a user subscribes via subscription.upgrade
.
Stripe : 17.7.0
Better-auth : 1.2.77 Replies
Heya, I experience the same issue. But I see an update error on prisma, saying:
Do you also see an error from your ORM or something?
I also checked BA's code where they populate these fields (in
packages/stripe/src/hooks.ts
line 44):
There they reference the fields current_period_end
and current_period_start
, but when I retrieve the subscription myself I cannot find these fields in the subscription object.
In my stripe plugin I added an event hook to check the subscription myself like this:
And it logs this subscription object:
(shortened some things, because the message would have been too long and I dont have discord nitro)
Do we have to populate any metadata or something? 🤔
@Ping Sorry for the ping, but its breaking the subscription flow a bit 🙈
Can you confirm whether this is a bug or if we r missing any configurations? If it's a bug I can create an issue in github when necessarywhat version is your stripe?
18.0.0
Ooh i see it now. They have breaking changes in v18 🙈
That explains a lotIt will be fixed soon, but for now, yeah just downgrade to 17.7.0
Perfect, thanks a lot for checking in!
For anyone reading this, stripe api v18.0.0 is used in BA version
v1.2.8-beta.2
! 🥳I am waiting the next beta for the priceId field 🙂
Solution
Good in v1.2.8-beta.3 : Solved