#mxc42_best-practices

1 messages ¡ Page 1 of 1 (latest)

winged knollBOT
#

👋 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/1241108579855896758

📝 Have more to share? Add more details, code, screenshots, videos, etc. below.

ruby wasp
#

I've tried create_prorations and none when changing anchor, but both charge

#

I've also tried the free trial, but that doesn't seem to be quite what I'm looking for

drifting bronze
#

The prorations are for crediting for the current period that you are shortening by reseting the billing cycle

#

I imagine you're resetting to now?

ruby wasp
#

yeah, now

ruby wasp
#

I'd like to basically skip the current period

drifting bronze
#

Unless you switch to a free price or a trial, this doesn't really make sense, becuase setting the anchor to now is effectively forcing a billing cycle to reset/rollover, leading to an invoice for the current price

#

What are you trying to achieve as an end result?

#

Can you explain the situation more broadly?

ruby wasp
#

So currently we charge customer when they make a reservation

#

Which is what we want to continue doing

#

but we want the next payment to occur 30 days after they physically pick up the rental

#

so the first cycle would basically be time between reservation and pickup plus the subscription interval

#

and then it gets a little more tricky because the product in question is a electric scooter that has a set time of authorization before it shuts off

#

which is right now dictated by the subscriptions next invoice time plus a buffer

drifting bronze
#

Using trial_end + disable prorations for this might be most appropriate, because you can trigger that at "pickup" and set the next invoice time for whatever you like

#

You could also achieve this with a Subscription Schedule, but that feels heavy handed for the use case

ruby wasp
#

so for trial_end, would the initial subscription creation / invoice need any changes?

#

or I just use it at pickup time without changing anything else?

#

i guess i'll go test a bit with it

drifting bronze
#

assuming you invoice the full amount of the first period at time of booking, and pickup happens before the end of the first period, then yea thats all you need

#
trial_end=timestamp of next invoice to pay
proration_behavior=none

and you update the sub at pickup

ruby wasp
#

That doesn't seem to change the billing cycle at all though, does it?

#

say they reserved on May 15, and picked up on May 17, I want the next invoice to be June 17

drifting bronze
#

it does, when the trial ends it will reset the anchor

ruby wasp
#

oh I see

drifting bronze
#

(and will be free until then)

ruby wasp
#

so timestamp of next invoice to pay should be pickup time + 30 days?

drifting bronze
#

Yep! some timestmap on Jun 17 in your example

ruby wasp
#

ok sweet, thanks

#

would it be better to do "pickup time + 30 days" or "current_period_end + (pickup time - current_period_start)"?

#

are monthly cycles always 30 days or is it set by day of month?

#

is i guess the question

drifting bronze
#

It depends! If we narrow the scope of your question to single month billing cycles then yes, its the same day of the month except when thats not possible (eg, same day doesnt exist in the month).