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)
- Question - Any reason for OAuth being only available on signin's and not signups? HOT 2
- Issue with payment plans showing up HOT 1
- Deploy error HOT 3
- Some issues with initial deploy, but after making my own workarounds, everything is fine.
- Persistent warning in console: "Using the user object as returned from supabase.auth.getSession()... could be insecure"
- Error: React Hook "useRouter" is called conditionally. React Hooks must be called in the exact same order in every component render. HOT 1
- Is tanstack query a meaningful edition for this template.
- [Stripe Webhook] Not update latest status of the subscription object HOT 2
- await checkoutWithStripe(price, currentPath) not working on localhost
- Webhook for production mode HOT 1
- Lack of guidance for local dev: connecting to remote supabase
- Stripe user not deleted on auth user delete
- Enhancement: Update support for latest Supabase SSR build
- Question: Passing supabase to query functions? HOT 1
- Stripe webhooks failing (status 400) HOT 6
- createServerClient deprecated? HOT 1
- failed to load 'https://deno.land/std/http/status.ts' Invalid peer certificate: UnknownIssuer
- Browser Client Returns Null User.
- name/email changes are not synchronized between supabase and stripe HOT 2
- Setting up local issues
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.