#idhruv - Scheduled cancelation proration

1 messages ยท Page 1 of 1 (latest)

stuck parcelBOT
slate citrus
#

๐Ÿ‘‹

#

Are you setting end_behavior: cancel?

obtuse walrus
#

let me check plz

#

thanks

slate citrus
#

Looks like you have that set to release

#

So that's why

#

If you change that to cancel then the underlying Sub will cancel when the Schedule ends

obtuse walrus
#

end_behavior: 'release',

#

i am setting this while creating subsch

slate citrus
#

Right

#

Change that to cancel

obtuse walrus
#

omg, you sure that will work? coz i read somewhere that it should be set to release

slate citrus
#

Well you should always be testing your integration end-to-end before you go live

#

But yes, I'm sure it will cancel the Sub at the end of the Schedule

#

And ensure it is the behavior you want

obtuse walrus
#

exactly, i had used test clocks multiple times before and it did work with release too i remember

#

so i am quiet confused why the sub is still running on our user's end

#

okay i will first change this to cancel

slate citrus
#

Feel free to provide an example where it canceled the Sub using release and I'd be happy to look.

obtuse walrus
#

i had tested it few months back but alright i will test again with cancel and release both

slate citrus
#

๐Ÿ‘

obtuse walrus
#

thansk

slate citrus
#

Sure!

obtuse walrus
#

is there anything else apart from this i need to configure?

#

let subscriptionObj:any = { customer: userData.stripeCustomerId.toString(), start_date: fromDateSec, // start_date: 'now', end_behavior: 'release', default_settings: { application_fee_percent: adminPercentWithTax, collection_method: "charge_automatically", default_payment_method: payload.cardId, transfer_data: { destination: hostStripeAccId?.stripeAccountId } }, metadata: {'bookingId': String(bookingArr[i]?._id)}, phases: [ { items: [ { price: price.id, quantity: 1, } ], iterations: monthlyIterations, proration_behavior: 'none' }, ] }

#

my subsch object. can you please check if this is enough for the purpose of this question?

slate citrus
#

No that's incorrect. You have end_behavior: 'release', in that

#

You want end_behavior: cancel

obtuse walrus
#

yes yes, i did that. apart from that is there anything more?

slate citrus
#

The rest looks fine as far as I can tell. I don't know your exact use-case but yes this will create a Subscription that will cancel after the number of iterations that you set which seems like what you want

obtuse walrus
#

cool

#

thanks

#

our use case is simple, users can book monthly space by opting out to 2 months to 12 months of subscription, wherein we charge them every month a specified amount

#

out of this 10% goes to us, and rest goes to connected account who hosted space for this user

#

we also have other options to book space hourly/daily and for this we charge the amount in one go for which subscription is not needed

slate citrus
#

Gotcha

#

The above is correct then for a 2 month Sub if you set iterations: 2 and end_behavior: cancel

obtuse walrus
#

okay I tested it

#

it works but charge is not happening monthly

#

instead it only cuts once for entire cycle of 2 months

#

sub_1Ls8RCGdNldKu1zmTfxuaS6h test clock result

gilded plaza
#

Hi there ๐Ÿ‘‹ taking over for @slate citrus

Give me a few minutes to get caught up.

obtuse walrus
#

yes

#

did you found anything?

gilded plaza
#

What was happening when iterations were set to 1?

obtuse walrus
#

that i have not tried but i'd assume that it will only run for one month

#

when i set it to 2 it correctly considers 2 months

#

but charges only once, as i changed end_behaviour to cancel

#

i want it to charge every month until 2 months or N months run out and subscription cancels itself

#

i am also setting up price and recurring interval set to month, this is then used to send while creating subscription schedule

gilded plaza
#

Hmmm, that's odd. I'm trying to make sense of what might be causing that. Just wanted to let you know that I'm still digging

#

I'll circle back in a few

obtuse walrus
#

ohklk

#

please leave the message even if i am not here, i badly need a sleep

gilded plaza
#

Sure thing, will do

gilded plaza
#

Alright, circling back to close the loop here. This looks like a bug when using a backdated start date + proration_behavior: none within the phase. We're putting together some clean repros and surfacing the issue to the product team

obtuse walrus
#

backdated start date?

#

sorry, i am still debugging

#

sub_sched_1Ls9rbGdNldKu1zm1CDdKXHx i am again getting date related problems

delicate orbit
#

Hey there, just an update that we're still digging into this. I'm stepping in for two shoes but will let you know when we have more info.