#kliti
1 messages · Page 1 of 1 (latest)
hi! what's the question exactly?
I have a saas business and I want to add a lifetime plan. I created a one time payment product on stripe dashboard but how can I add a 3 days trial in it?
hmm, you can't, a one time payment is not a subscription/recurring payment so it doesn't have a trial period
not sure I follow exactly what you're looking for. Can you describe the customer experience(when do they sign up, when do they enter their card details, what do they pay, when do they pay it)?
First they sign up to my website and login. After the login, they are redirected to the profile page, where I added a button that creates a checkout session to buy the one time product
makes sense. And that's it? not other future payments?
For the lifetime plan (which is a one time payment product) this is it. However, for the subscription, I have built to have a 3 days trial
For the one time product, I was thinking of using the setup mode, but I do not know how to set it up correctly.
I don't really understand. Why is there a trial period for this one time lifetime plan?
hey are redirected to the profile page, where I added a button that creates a checkout session to buy the one time product
like do you want them to only enter their card information at that point, and get charged 3 days later? I don't understand it
Yes
that seems really weird to me, why not just charge them directly while they are there? why deal with the complexity and risk of declines/having to contact them again by waiting 3 days
there are a couple of ways to implement it anyway
one is as you say, use Setup Mode https://stripe.com/docs/payments/save-and-reuse?platform=checkout You'd have to set up something in your server to charge the saved payment method 3 days later(https://stripe.com/docs/payments/save-and-reuse?platform=web#charge-saved-payment-method), you might e.g start a cron job when handling the successful Checkout webhook
Okay, thank you, Let me check the 2 articles and see if I can implement them
I have 2 questions regarding the webhook:
- What events do I use in the webhook to make the client buy the product automatically after the trial period ends?
- Does Stripe calculates the trial period or do I have to create the trial period?
1 checkout.session.completed tells you the customer finished entering their card. After that, that's it from Stripe's side, you'd have to build something to remember to call our API in 3 days to charge the saved card
2 there's no such thing as a trial period here in our eyes, it's your own logic
the other way to do this is implement it as a subscription
like create a subscription normally, with subscription_data[trial_period_days] in the CheckoutSession API as usual. Then after the trial ends (invoice.paid event), you could do something like cancel the subscription or move it to a Price that is for $0.
there's no great option here that is not going to require some manual custom code, but there are possibilities!
So the event that needs to be triggered after 3 days is checkout.session.completed?
So with this method, I can just I can cancel the subscription and change the price inside of this event?
no
there is no event we send you after 3 days
we send you checkout.session.completed when "After the login, they are redirected to the profile page, where I added a button that creates a checkout session to buy the one time product", at the time they finish entering the details. After that, its' on you to build something in your system to remember to call our API in 3 days to charge the saved card
not sure what you mean by 'inside of this event'. But you can detect from a webhook when the trial is over (https://stripe.com/docs/billing/subscriptions/webhooks#active-subscriptions)and trigger some code to call the API to cancel/update the sub yes
Let me explain what I meant with this.
I can use 2 subscription products with price $o and the other one with $50.
When the customer first clicks the button to subscribe to the 50$ price.
Then inside the invoice.paid event, I can update the price.
You can update the subscription to add/replace items in the subscription following events of your choosing, yes, but that won't affect the invoice that was already paid, it will affect future invoices.
Do you understand now or can I help with something else?
I can create the checkout session with Setup Mode, and can I trigger the webhook manually and which event should I use for that?
You can use Checkout setup mode, yes, but this doesn't create a subscription, just a saved payment method.
You don't "trigger" webhooks in live mode, those are emitted when payments and other things happen to notify you. In test mode you can trigger test events to work on your integration.
Can you briefly explain the final flow you're trying to achieve? eg:
1/ Customer clicks "subscribe"
2/ Customer completes Checkout process
3/ Customer is in state...
4/ Customer does X...
5/ I want to change the subscription...
I understood the subscribe method, but my question was for the Setup Mode on the One-Time Payment Product.
I can just build a cron system on my API, which after the customer registers to my website, and completes the checkout session with the Setup Mode, After 3 days the status on my API changes from trial to not-paid for example. And then after 3 days a button will be shown to buy the product and the status of the customer on my API is goind to change to paid.
my question was for the Setup Mode on the One-Time Payment Product.
To be very clear, there is no payment inmode=setupit only saved payment method details. You need to request any future payment or subscription creation, if needed.
status on my API changes from trial to not-paid for example
You referring to your own systems, not anything to do with Stripe? If so, sure, you can trigger your own systems any way you like.
after 3 days a button will be shown to buy the product
Again, if you mean in your system, sure.
the status of the customer on my API is goind to change to paid.
What is this referring to? Is this your own or something you are expecting in Stripe? You have created a subscription yet (that you mentioned) and Customers aren't "paid".
For the cron I am referring to my own API.
I have a SaaS business and i am adding a New plan called Lifetime Plan which is a One-Time Payment Product. However in that plan I am adding a 3 days trial.
OK, as a concept in your system that's fine. And in that 3 day window your customers can options pay the one-time lifetime price?
Yes
Ok, sure. So that' fine. And for a lifetime product like that I wouldn't use a subscription.
I'd do a one-time payment via payment intent, then record in my own system and the stripe customer metadata that the customer has paid for lifetime access
Yes, I am going to do that, Thank you for your help