#danboyle8637_api

1 messages ¡ Page 1 of 1 (latest)

wintry kilnBOT
#

👋 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.

river kestrel
#

Hi there

lethal talon
#

Hey!

river kestrel
#

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?

lethal talon
#

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)

river kestrel
#

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

lethal talon
#

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.

river kestrel
#

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

lethal talon
#

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

river kestrel
#

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.

lethal talon
#

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

river kestrel
#

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

lethal talon
#

oh cool... those are both in my webhook already so I can add the logic pretty easily

river kestrel
lethal talon
#

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

river kestrel
#

I think the issue here is the cancellation you want to trigger after x period of days though, right?

lethal talon
#

yeah just want to get the first payment and that's it

wintry kilnBOT
river kestrel
#

In that case, I can put in a feature request to have Checkout Sessions support Schedules

lethal talon
#

but I want their credit card on file becuase I don't want complete freebie seekers signing up

river kestrel
#

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

lethal talon
#

that's be awesome... yeah that does. I think that's using phases right?

river kestrel
#

yep!

lethal talon
#

cool... thanks so much for the help today I apprecaite it!

river kestrel
#

Sure thing!

lethal talon
#

have a good rest of the day

river kestrel
#

Ditto

solid skiff
#

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!

lethal talon
#

I should be good... should I wait to give a rating?