#fractalskwish

1 messages ยท Page 1 of 1 (latest)

severe ermineBOT
neat vessel
#

Hey there

#

When you say "end a trial Sub" do you mean cancel the sub?

#

Or do something else?

brittle orchid
#

Yeah, I'm thinking cancel the subscription before it becomes "past due"

neat vessel
brittle orchid
#

I basically don't want to attempt to charge them at the end of the trial if they still haven't added a payment method

#

yeah, i think I understand I can cancel them immediately, and I was thinking of doing this when I get the invoice.created event which happens right around when the trial subscription ends

neat vessel
#

Hmm you won't want to wait for that

brittle orchid
#

but then I'd also need to nullify that invoice before it's actually charged, I think

neat vessel
#

Are you using a send_invoice Sub or charge_automatically?

#

It sounds like charge_automatically, correct?

brittle orchid
#

yes, I think so, but not 100% if that's really what I want

neat vessel
#

Gotcha. So with charge_automatically the invoice is going to finalize immediately upon renewal

#

So you don't want to wait for the invoice.created

#

You likely want to just set cancel_at_period_end on your Subs

brittle orchid
#

ok, I think I need to read more before I can really understand what you're saying. fwiw, I do want other customer trials to be charged, but only if they have a payment method added by the time the trial ends

neat vessel
#

Right

#

So I think you create your Sub with cancel_at_period_end, then if PaymentMethod is collected you update the Sub to remove that

brittle orchid
#

cool, I'll ready more about cancel_at_period_end and test it out

neat vessel
#

Sounds good!

#

Let us know if we can help

brittle orchid
#

thank you!!

#

oh, just double checking the state of my subscription, it does say "'cancel_at_period_end': False"

#

but not sure if that changed at the trial period end, or was like that at the time of creation ๐Ÿ‘€

neat vessel
#

It defaults to false

#

So unless you set it explicitly then it will be false

brittle orchid
#

oh, sorry, I misread, so you're saying I should set it, which you're right, I'm probably not currently

neat vessel
#

Yep exactly

brittle orchid
#

perfect, thanks again!

#

so I think I now understand what you're saying, but initially, I'm a bit hessitant with this approach. If for some reason I fail to act on whatever event that tells me the customer added a payment, I will end up losing the customer's business. If I understand this correctly.

neat vessel
#

Yes that's correct. But why would you fail to action it?

#

Also, you could always set up a "backup" of sorts and check if they have a set PaymentMethod ~1 hour before the trial ends

brittle orchid
#

I guess it's more of a personal problem, I'm new at this company, and their backend handlers for routing webhook events is in a language I don't know yet (Kotlin hosted on AWS lambda)

neat vessel
#

Ah well yes you are going to need to write backend code here to do any of this ๐Ÿ˜…

brittle orchid
#

I kinda like the idea of if we fail to act on an event, the worst that will happen is the customer will get a failed billing message (which is what currently happens)

neat vessel
#

I wouldn't implement cancel_at_period_end unless you are confident in writing the code to handle the webhook for when a PaymentMethod is added and then updating the Sub to remove that cancellation

brittle orchid
#

if this is the best way to do it, I will strive to become more confident! but I guess I'm still at the point of making sure this is best way

#

what do you think about my first suggestion of watching for the first non-free invoice.created event, checking if customer/subscription has no billing method, and ending the subscription at that point, before the 1-hour period when stripe will attempt to proceess/charge the invoice?

#

(oh, and nullify the invoice too)

#

I guess I'm just longing for a feature like: I wish there was a subscription.end_at_trial_end_when_no_billing_method

delicate loom
#

Hi there. bismarck had to step out, so I'm taking over. Give me a bit to catch up on context

#

Yeah I think that approach should work

#

It's up to you

brittle orchid
#

ok, thank you!

#

if you take feature requests, I'd like a subscription setting like "end_at_trial_end_if_no_payment_method = True" ๐Ÿ™‚

delicate loom
#

We do take feature requests! No guarantees something like this would be implemented though

#

It would be up to the owning team (who'd have to prioritize, etc)

brittle orchid
#

of course, all I can do is ask ๐Ÿ™‚ maybe someone else would be happy it's implemented, if you guys think it's a good idea

delicate loom
#

For sure. Thanks!

brittle orchid
#

before I dig in any further on other options, do you think a subscription tier setup might give us what we are looking for? or maybe it's called subscription "phases"?

delicate loom
#

Ah I think you're referring to subscription schedules?

#

You just want to know if cancellation if a payment method isn't provided would be achieved easier with sub schedules?

brittle orchid
#

yes, I think so

#

I guess I'm just searching for a method that doesn't require me to act on events, and more of a pre-defined configuration/option at the time we create a new trial subscription

delicate loom
#

Yeah unfortunately there's no way to define that logic

#

Without having you act on events

brittle orchid
#

ok, cool, thank you again. just to confirm, in the method I'm probably going to attempt, I will need to both cancel the subscription AND find/nullify the non-free invoice at the trial end date

#

at least, this is my current understanding, and makes sense to me

delicate loom
brittle orchid
#

awesome, thank you!