#ssbjsb_invoice-cash-balance

1 messages ยท Page 1 of 1 (latest)

gritty ferryBOT
#

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

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

cedar warren
mint onyx
#

Hello

#

Taking a look

cedar warren
#

Their cash balance is $30 short

#

This should create a invoice.payment_failed webhook event for the customer but I don't see it in the events log in the workbench.

mint onyx
#

Hmmm I don't think that is expected to lead to this webhook since no payment was attempted here... what indicates that webhook should fire in this case?

cedar warren
#

We handle manually reconciling the invoice when that webhook event is triggered. But it is not triggered in this case.

Does it take time to trigger?

#

With Bank transfers, Stripe automatically tries to pay the invoice with the cash balance. If the cash balance is short, Stripe triggers a invoice.payment_failed event.
I tested this in the Stripe test mode last month and saw the webhook event getting triggered.

mint onyx
#

Hmm do you happen to have that example from last month?

#

Are you sure you didn't try to pay the Invoice in that case manually via using the /pay endpoint or confirming the PaymentIntent?

gritty ferryBOT
cedar warren
#

I am trying to find the test customers I used

#

They all seem to be cancelled and a lot of the data is missing

magic heart
#

Hi ๐Ÿ‘‹

I"m taking over as my colleague had to go

cedar warren
magic heart
#

That's a subscription but yes this works

#

What do you mean by "A lot of data is missing"?

cedar warren
#

Didn't realize that was a subscription and not a customer

#

I don't see the customer in test mode

#

I see invoices and subscriptions related to that customer

#

I can perform a test right now if needed

#

But last month when I was testing, Let's say the invoice amount is $1000 and I fund the cash balance in test mode with $950, with bank transfers, Stripe was trying to pay the invoice and creating a invoice.payment_failed webhook event.

magic heart
#

The customer is cus_RLWVQd81g9ooOP

cedar warren
#

We ingest that webhook event and we have logic to manually reconcile invoices when the cash balance is short.

magic heart
#

Why should I look at this customer? What am I looking for?

cedar warren
#

Check the workbench

You will see the invoice.payment_failed event

#

This is the event ID: evt_0QMxcC5QM0nABsUHZSMvGyyY

#

This is the event for me funding the customer with $900: evt_0QL8QE5QM0nABsUHx9YK6XcZ

magic heart
#

Check the workbench

I cannot check "workbench", that is your account and your dashboard

#

I see and invoice.payment_failed event that is unfortunately beyond our data retention window so I don't have much details on the "why" it happened

#

Ah, okay

cedar warren
#

The invoice was for $1029.53 and the customer had 900 in cash balance. Stripe triggered the invoice.payment_failed event with ID evt_0QMxcC5QM0nABsUHZSMvGyyY

I issued two credit notes.
1 with ID evt_0QSTtB5QM0nABsUH9XMPJYOb
2 with ID evt_0QSTw35QM0nABsUHfuTOwMAf

To match the customer cash balance. And then the invoice got automatically paid

magic heart
cedar warren
#

So what does Stripe do when the customer cash balance is short?

#

Does it try to pay the invoice and fails or does it not do that?

magic heart
#

It does not attempt payment

cedar warren
#

Okay

cedar warren
#

There was the customer_cash_balance_transaction.created event with the type funded created when the customer would add cash balance

I am checking my test customer and I don't see the type funded property in the event body.
Has that changed from Stripe's end?

magic heart
cedar warren
#

I see what I need in the live account

magic heart
#

Do you have a request ID for a request where a cash balance was update in Test mode?

cedar warren
#

I have one in the live account

#

Event ID: evt_0Qbkw85QM0nABsUHBP5KY4wO

You can see the type property in the event body. It says funded

magic heart
#

Okay

#

Actually I don't see a property for funded

#

All I see is

object: {
    object: "cash_balance",
    available: {
      usd: XXXXXX
    },
    customer: "cus_XXXXXXX",
    livemode: true,
    settings: {
      reconciliation_mode: "automatic",
      using_merchant_default: true
    }
  }
#

Also this event isn't a customer_cash_balance_transaction.created, it's a cash_balance.funds_available