#mrobjectoriented_unexpected

1 messages ยท Page 1 of 1 (latest)

lucid minnowBOT
#

๐Ÿ‘‹ 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/1288937842868879360

๐Ÿ“ Have more to share? Add more details, code, screenshots, videos, etc. below.

Below are links to other discussions we've had with you in the past week in case you want to review that information. If your question is related to one of these previous discussions, please provide a comprehensive summary of the current state and what you need help with now. We help many users simultaneously, so a summary allows us to resolve your issue as soon as possible.

coarse stirrupBOT
sterile panther
#

Hi there ๐Ÿ‘‹ it looks like the last part of your question got cut off or didn't fit in our form, can you help me understand what behavior you're seeing and what you would like to see instead?

drowsy kraken
#

ah

#

We are configuring our subscriptions and we have monthly and annual plans. Right now if a customer switches from annual to monthly it credits them for the first month but it charges them in full for the second. As an example, our annual plan is $96 and monthly is $10. Right now a user pays the $96 and decides they actually want monthly billing they would be able to move to monthly for free, but they should receive $86 in additional 'Stripe credits' that are applied for the next 8+ months until they run out of credits. We are confused why the credits are applied for month 1, but then stops there?

#

https://dashboard.stripe.com/test/subscriptions/sub_1Q3N4ACahU6XTxIICKGmLj3F here is a customer i just did. to explain i did "Gold Plus (Staging)" with trial and simulated a month so i paid $96 for "Gold Plus". i then switched to "Gold (Staging)" for free. then simulated another month and you'll see it charged $10.

sterile panther
#

Does that Customer have a credit balance on them? Customer credit balances aren't applied to Invoices until the Invoice is finalized, and it looks like the new Invoice is still in a draft state currently.

drowsy kraken
#

I will try to fast forward a bit further

sterile panther
#

I'm also taking a closer look at this from side to see if I can spot exactly what happened, but it takes a bit of time to step through how all the Invoices behaved and what that would have caused future Invoices to do.

drowsy kraken
#

I fast forwarded and I still see the same result

sterile panther
#

Yeah, I'm trying to piece together exactly what happened here. The $96 Invoice seemed to have used most of the Customer's balance (not sure where that came from yet). Then the next Invoice credited them $85.74, and now I need to try to spot where that balance went since it seemed to be empty before the next Inovice was created.

#

I'm taking a look on my side still, but did you advance the test clock's time in such a way that both the $96 and -$85.74 Invoice were generated during the same advancement of the test clock?

#

I think it's looking like the balance was created and applied backwards somehow, like the later Invoice for the downgrade created the balance first, which was then consumed by the yearly Invoice. Still looking though.

#

Can you walk me through what steps you took to see this?

I'm seeing that the Invoices were created about a day apart (with regards to the time in the test clock), but that they were finalized at the same second. My suspicion is that last part caused a race condition and the Invoices actually finalized in reverse order of how they were created. Causing the balance from the later Invoice to be applied to the former.

I think this is something specific to the use of test clocks. I suspect if you advance the test clock more slowly, so each Invoice is processed independently, you won't see this behavior.

drowsy kraken
#

it works now @sterile panther, instead of advancing 1 month i advanced 6 weeks every time