Trigger annualDiscountPriceId on Stripe

Hey devs, i defined a annualDiscountPriceId but i dont know how can trigger it with the subscription.upgrade
plans: [
{
name: "Starter",
priceId: STARTER_PRICE_ID.default,
annualDiscountPriceId: STARTER_PRICE_ID.annual,
freeTrial: {
days: 7,
},
},
{
name: "Pro",
priceId: PRO_PRICE_ID.default,
annualDiscountPriceId: PRO_PRICE_ID.annual,
},
{
name: "Enterprise",
},
],
plans: [
{
name: "Starter",
priceId: STARTER_PRICE_ID.default,
annualDiscountPriceId: STARTER_PRICE_ID.annual,
freeTrial: {
days: 7,
},
},
{
name: "Pro",
priceId: PRO_PRICE_ID.default,
annualDiscountPriceId: PRO_PRICE_ID.annual,
},
{
name: "Enterprise",
},
],
Solution:
Something happened because now it returns the correct array with the subscription, closing issue.
Jump to solution
2 Replies
shadow
shadowOP2mo ago
Update: Verified that Bekaru pushed this change: https://github.com/better-auth/better-auth/commit/905210f2 However there is not reference of it in the docs, so this PR i made adds it: https://github.com/better-auth/better-auth/pull/1725 --- Now i am trying annual: true in the subscription.upgrade function, tried it and subscription was done in Stripe's Dashboard as you can see in the attached image. However the subscription is saved at Stripe's, the function auth.api.listActiveSubscriptions doesn't return the subscription, just an empty array. Looking forward for an solution.
No description
Solution
shadow
shadow2mo ago
Something happened because now it returns the correct array with the subscription, closing issue.

Did you find this page helpful?