#jeff-sexton_unexpected

1 messages Β· Page 1 of 1 (latest)

timid mothBOT
#

πŸ‘‹ 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/1438668818003132577

πŸ“ 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.

versed portal
#

Hi πŸ‘‹ . Just following up on this thread from yesterday

#
  1. Is there a reference/link you could send me to the "known bug" we were investigating yesterday?
#
  1. Is there any estimate on when it might be addressed?
#

I need the above to close the loop on my investigation for the issue we were having with a customer.

#

I also wanted to share a workaround I successfully used to get the customer's subscription into the correct state without needing to wait for the next subscription invoice. In this case, that's more than 2 months away so it wasn't acceptable to leave the customer in a "past_due" state until that time.

#

In the thread yesterday, we identified that the bug does not occur if the latest invoice is voided as the last operation. I assume this is because Stripe ignores voided invoices when updating subscription status when an invoice is being voided but only looks at the latest invoice regardless of its void status when a payment succeeds for an older invoice.

#

The workaround I used was to temporarily make a change to the customer's subscription that generated a new invoice and then immediately voiding it an reversing the temporary changes.

#

This triggered a subscription status update that ignored both voided invoices and resulted in the correct subscription state of active

paper gazelle
#

Hello again! Just catching up on where you got with my colleague yesterday

versed portal
#

No problem! Thanks!

paper gazelle
#

okay, what orakaro said ( and the note they'd left for me ) said "known issue" - which is to say that we don't consider it a bug

#

which is semantics but the point I'm trying for is that we don't expect the Subscription to transition to active again until another Invoice is generated and paid but we acknowledge that it is a sort of rough edge

#

looking at your examples again to make sure we don't need to take it up with the Subscriptions folks

timid mothBOT
hard mulch
#

Hi @versed portal I'm taking over this thread. Give me a sec to catch up/

versed portal
#

Sure no problem.

hard mulch
#

So I ran the subscription_pay_then_void.sh script, the subscription's final status is incomplete_expired, not past_due. Is this the correct script that I shall use?

versed portal
#

Hmm. No. It should end up in past_due

#

Let me check on my end

#

Oh! Also, subscription_pay_then_void.sh is an example of how to avoid the "bug". The issue we ran into was when the latest invoice is voided before correcting the payment error on an older invoice

#

i.e. subscription_void_then_pay.sh should end up in a past_due state which technically does not reflect reality because the customer actually doesn't owe us anything at that point

#

I actually expect subscription_pay_then_void.sh to end up in an active state

hard mulch
#

The subscription will transition to incomplete_expired if the first invoice is not paid in 23 hours. Since subscription_pay_then_void.sh voids the latest invoice of the subscription, the subscription will transition to incomplete_expired immeidately since the first invoice can't be paid at all.

#

Let me run the subscription_void_then_pay.sh. one sec

versed portal
#

On my end, when I run subscription_pay_then_void.sh I end up in the Subscription State of active

Related Data from this run:

Resources Created:
Customer: cus_TQ16nx5LP3504K
Subscription: sub_1STB4HDAWTp2PXOwBhg1DIyL (Quantity: 2)
First Invoice: in_1STB4QDAWTp2PXOw08brG7fp [PAID]
Second Invoice: in_1STB4WDAWTp2PXOw8ogZPUdf [VOIDED]

View in Stripe Dashboard:
Subscription: https://dashboard.stripe.com/test/subscriptions/sub_1STB4HDAWTp2PXOwBhg1DIyL
Customer: https://dashboard.stripe.com/test/customers/cus_TQ16nx5LP3504K
First Invoice: https://dashboard.stripe.com/test/invoices/in_1STB4QDAWTp2PXOw08brG7fp
Second Invoice: https://dashboard.stripe.com/test/invoices/in_1STB4WDAWTp2PXOw8ogZPUdf

#

When I run subscription_void_then_pay.sh I end up in the Subscription State of past_due

Resources Created:
Customer: cus_TQ15j7YJcCJZeM
Subscription: sub_1STB32DAWTp2PXOw7i0iYxKT (Quantity: 2)
First Invoice: in_1STB3DDAWTp2PXOw6TQqq8Y4 [PAID]
Second Invoice: in_1STB3JDAWTp2PXOw9jGRd6Yu [VOIDED]

View in Stripe Dashboard:
Subscription: https://dashboard.stripe.com/test/subscriptions/sub_1STB32DAWTp2PXOw7i0iYxKT
Customer: https://dashboard.stripe.com/test/customers/cus_TQ15j7YJcCJZeM
First Invoice: https://dashboard.stripe.com/test/invoices/in_1STB3DDAWTp2PXOw6TQqq8Y4
Second Invoice: https://dashboard.stripe.com/test/invoices/in_1STB3JDAWTp2PXOw9jGRd6Yu

hard mulch
#

So I ran the void_then_pay script and the resulting subscription is also incomplete_expired. Based on comments on the script it seems like it will void the first invoice and pay the second, but there's only invoice according to the output.

  Customer:            cus_TQ18aaK20jKqGU
  Subscription:        sub_1STB6iKmcV1mkkRSku9yz96i (Quantity: 2)
  First Invoice:       in_1STB6iKmcV1mkkRSz6nAjWEu [PAID]
  Second Invoice:      in_1STB6iKmcV1mkkRSz6nAjWEu [VOIDED]
#

Let me take a look at your example

versed portal
#

Yes, agreed.

#

Depending on how you look at it, Stripe sometimes ignores Voided invoices when determining status and other times does not. This is the core of the inconsistency highlighted

hard mulch
#

But uncollectable is different from voided

versed portal
#

The fact is, I could have a stripe subscription that has no outstanding payments due sitting in a state of past_due for as long as it takes for another invoice to be generated.

#

It might not be a big deal for a high activity customer or one with a short subscription cycle but an annual subscription could be incorrectly indicating past_due for almost a full year,

#

Maybe incorrectly is the wrong word. "inconsistently"?

#

Basically past_due as a status doesn't make a lot of sense in this scenario

hard mulch
#

Ok, let me try to clarify what made you think the behavior is inconsitent.

#

Is it this statement -> " Stripe ignores voided invoices when determining subscription status and uses the most recent non-voided invoice instead."

#

As subscription's latest invoice in_1STB3JDAWTp2PXOw9jGRd6Yu was voided, but the previous invoice in_1STB3DDAWTp2PXOw6TQqq8Y4 was paid, and that's you expected the subscription sub_1STB32DAWTp2PXOw7i0iYxKT remains active. Is my understanding correct?

versed portal
#

That's correct.

#

Regardless of the wording of the documentation, a state of "past due" also just doesn't make sense for a subscription in this scenario.

#

What is due?

#

There are no outstanding payments required so what is past due?

#

The inconsistency of the end state for the two different orders of operations in the scenario is also part of it.

#

If I pay the second to last invoice first and then void the latest invoice second, the subscription ends up "active".

#

On the other hand, if I void the latest invoice first and then pay the second to last invoice second, we end up in "past due".

#

In both cases the end status of all payments and invoices is the same. The customer is fully paid up and there are no outstanding payments.

#

But the way stripe has evaluated the subscription status is completely different.

hard mulch
#

Just want to clarify about "If I pay the second to last invoice first and then void the latest invoice second, the subscription ends up "active"."

Do you mean you paid the second invoice (aka latest) first and then void the first invoice?

versed portal
#

No. On each of the examples there are three invoices in total.

#
  1. Initial subscription payment - paid before the scenario
#
  1. Subscription modification to add a license - payment initially fails but is later successfully paid for
#
  1. An additional subscription modification to add another license that was created in error and the customer does not want - in the end result we don't want these changes to apply to the subscription, we don't want to charge the customer for it and we will void the invoice
#

So in pay and then void where we end up in active, we correct payment info and successfully charge #2. After that we void #3

#

In void and then pay where we end up in past due, we first void #3 and then we correct the payment info and successfully charge #2

#

The later order of operations makes sense from a customer support perspective. We clean up the unwanted changes and invoices before trying to charge the customer for what they actually want

#

The problem is that we end up in a past due state

#

Instead of active

#

Sorry for any formatting errors, I'm actually on public transit home from the office πŸ˜…

hard mulch
#

I see, thanks for the explanation, that's much clear now.

#

I'll feed back this to the product team and see how can we improve or fix such inconsistency. I'm going to send you a link through DM, you can use this to reach out to Stripe support and they will create a support case if you want to follow up on the progress.

timid mothBOT
#

Hello @versed portal, we have sent you a direct message, please check it at https://discord.com/channels/@me/1438711344189673604

  • πŸ”—The message has instructions on how to open a direct support case with our Developer Support team, in order to help you more effectively.
versed portal
#

Perfect. Thank you!

#

Will the support case have this context?

hard mulch
#

Yes and you can tell support that you've already talked to the Stripe engineer on discord, and they'll redirect the support case to us.

versed portal
#

Awesome!

#

I'll open the support ticket tomorrow morning