#danboyle8637_api
1 messages ¡ Page 1 of 1 (latest)
đ Welcome to your new thread!
â˛ď¸ We'll be here soon! Typically we respond in a few minutes, but sometimes we might take a bit longer if the server is busy or if you have a particularly tricky question.
âąď¸ We close idle threads, which makes them read-only. Once a thread is closed it won't be reopened, but you can always 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/1374144250517913652
đ Have more to share? Add more details, code, screenshots, videos, etc. below.
Hi there
Hey!
Hm, I was going to recommend using Subscription Schedules but Checkout Sessions don't support Schedules.
I think using Subscriptions for this might be overcomplicating this
You can create a Checkout Session in setup mode instead to collect payment details and include verbiage to your customers that you will charge them in 7 days unless they cancel. When day 7 arrives, you can make an off-session PaymentIntent to charge them for the product using the card they saved. If they payment declines, you can remove access to the product
How do you plan on handling trial cancellations?
in that scenario does hte off-session payment intent happen automatically or would I have to setup some type of endpoint or listen for a webhook?
to handle trial cancellations... I was just going to cancel the future payment and revoke access to the product. And in this case delete them entirely from my app (at least that's what I'm thinking at this point)
You'd have to set up some logic on your end that listens to checkout.session.completed events, then sets some timer on this before creating and confirming a PaymentIntent server side
Hm, you probably want to keep some sort of record on your end with email addresses at a minimum to ensure there's no trial abuse
I was thinking of doing something like create a subsciption with the trial. After the first payment listen for checkout.session.completed where I can get their customer id and then cancel the subscription immediately in my webhook so they won't have to pay again.
Yep, that works too!
You'd still need to have some logic on your end to listen for that successful payment and cancel before the next invoice is created so as not to overcharge customers
is cancelling the subscription the right thing to do or pausing?
I do have a webhook that is always listening so I should be able to match each customer up
Canceling. Pausing Subscriptions should only be used if you plan on granting access for free for a period of time. Pausing Subscriptions will still create draft Invoices as the billing cycles progress.
okay cool... thanks I'll have to set this up... and the best event to listen for is invoice.created or something close to that?
invoice.paid
Not exactly. invoice.created will alert you of a new Invoice though that Invoice will be in draft state at first
Yep, invoice.paid is perfect. You can also listen for customer.subscription.updated which should be triggered on Subscription cycles
oh cool... those are both in my webhook already so I can add the logic pretty easily
I recommend playing around with this using test clocks if you haven't already: https://docs.stripe.com/billing/testing/test-clocks
oh sweet... yeah that should help a lot... thanks
can you put in a feature request to make it easier to add a trial on a product?
when using Checkout Sessions that is
I think the issue here is the cancellation you want to trigger after x period of days though, right?
yeah just want to get the first payment and that's it
In that case, I can put in a feature request to have Checkout Sessions support Schedules
but I want their credit card on file becuase I don't want complete freebie seekers signing up
Schedules would allow you to work with iterations where you can automatically cancel a Subscription after 1 iteration of a certain price, if that makes sense
that's be awesome... yeah that does. I think that's using phases right?
yep!
cool... thanks so much for the help today I apprecaite it!
Sure thing!
have a good rest of the day
Ditto
fyi i'm taking over for roadrunner as they have to run. i'll keep the thread open for a little longer in case any more questions come up!
I should be good... should I wait to give a rating?