Comments (4)
bump. i think there is lack of coherence between the stripe docs and the template atm. from my understanding you can't set up trial_period_days
in Stripe anymore, and the functions in the starter use these values to calculate calculateTrialEndUnixTimestamp. can anyone help to clarify?
from nextjs-subscription-payments.
oh I see. Though that could be true, I tried setting up the stripe trial period and it did work and reflect in the DB. How recent was this change to stripe as I tried doing this 3 days after started this thread.
from nextjs-subscription-payments.
oh I see. Though that could be true, I tried setting up the stripe trial period and it did work and reflect in the DB. How recent was this change to stripe as I tried doing this 3 days after started this thread.
are you saying it works now? was it a missing stripe event or code base?
from nextjs-subscription-payments.
Here is a step by step guide for you. Hope it helps.
TO DO to add trial
- in admin.ts change TRIAL_PERIOD_DAYS to number of days
- push changes
- on price update (in Stripe) this should update the price with that value
- you can test it by adding new price or editting an existing one
- listen to webhooks for price.updated event
- to check if the trial_period_days on price has been updated console.log prices -> it should return trial_period_days: 7 (or any other number you set up)
- now you will work with the stripe/server.ts file. when creating stripe checkout session you will want to make sure the console.log that is already there (Trial end: ...) will console log correct UnixTimestamp (result of calculateTrialEndUnixTimestamp called later when setting params on recurring payment)
- it should return something like 'Trial end: 1714042027' when you click Subscribe on the price you added or edited before and in the stripe checkout page it should give you some info on the left about the trial being set up, for example "Tryout Basic: 7 days for free. Next 5,00 eur per month"
from nextjs-subscription-payments.
Related Issues (20)
- Cannot setup supabase local instance HOT 2
- Can't import shadcn button component HOT 2
- Vercel Deploy Button setup process broken HOT 1
- updateName doesn't update the name in account page HOT 15
- --turbo flag breaks dependencies HOT 2
- pnpm supabase:pull and pnpm supabase:push missing "db" HOT 1
- [help] How to import shadcn components in dark mode? HOT 2
- Slow Auth Loading
- Failing build HOT 1
- UserName is not Updating the users table, instead the Main Auth
- Vercel Deploy button - Infinite Completing Installation...
- Deprecating `auth-helpers` HOT 2
- 'Lifetime' feature on Pricing component does not work
- Magic link sign in doesn't actually sign in
- Are multiple calls to the same Supabase operation cached across pages and components?
- Turning this into a shadCn template HOT 2
- Add --silent flag to piped npx commands
- Server-rendered Navbar prevents static page prerendering HOT 8
- Question - Any reason for OAuth being only available on signin's and not signups? HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from nextjs-subscription-payments.