#naitik-b_code

1 messages ¡ Page 1 of 1 (latest)

rain locustBOT
#

👋 Welcome to your new thread!

⏲️ We'll be here soon! We typically respond in a few minutes, but in some cases we might need a bit more time (e.g., server's busy, you've got a complex question, etc.).

⏱️ We close idle threads, which makes them read-only. Once a thread is closed it won't be reopened, but you can start a new thread if you have another question.

🔗 This thread will always be available, even after it's closed. You can find it again using Discord's search, or you can save this link: https://discord.com/channels/841573134531821608/1257756592045035580

📝 Have more to share? Add details, code, screenshots, videos, etc. below.

covert coyote
storm widget
#

const session = await stripeClient.checkout.sessions.create({
customer: customer.id,
payment_method_types: ["card"],
metadata: {
uid: user.uid,
name: plan.title,
period: plan.period,
trial_period_days: plan?.isFreeTrial ? 60 : 1,
},
subscription_data: {
trial_period_days: plan?.isFreeTrial ? 60 : 1,
},
line_items: [
{
price:"price_1PY9jZK7XQviQzOvdJsK2iVW",
quantity: 1,
},
],
mode: "subscription",
success_url: ${baseUrl}/dashboard?session_id={CHECKOUT_SESSION_ID}&customerId=${customer.id},
cancel_url: ${baseUrl}/pricing-plan,
});

this is my code for create subscription using checkout

If I want to update my existing subscription what chages I have to do?

covert coyote
#

Please see my resposne above.

storm widget
#

Oh yes got it thanks

#

one more doubts I have

#

Suppose a user has selected a 30-day free trial subscription. If the user updates their subscription during the free trial period, the remaining days of the free trial will be canceled automatically?

covert coyote
#

Why do you think that? What kind of update? Can you provide more details?

storm widget
#

We have three plans available:

Silver: $5
Gold: $10
Platinum: $15
All plans include a 30-day free trial.

I initially selected the Silver plan using Stripe Checkout, added my card information, and submitted it. Currently, I'm enjoying the free trial. However, after 5 days, I changed my mind and would like to upgrade my subscription to the Platinum plan. What happens to the remaining 25 days of my free trial?

covert coyote
#

Have you tried it in test mode?

storm widget
#

Yes

covert coyote
#

Did you do it with the Customer Portal or did you upgrade some other way?