#ssbjsb_invoice-cash-balance
1 messages ยท Page 1 of 1 (latest)
๐ 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.
- ssbjsb_unexpected, 17 hours ago, 30 messages
- ssbjsb_api, 20 hours ago, 10 messages
Hi this is the customer: https://dashboard.stripe.com/customers/cus_OZnpZFWgWd3qCj
Sign in to the Stripe Dashboard to manage business payments and operations in your account. Manage payments and refunds, respond to disputes and more.
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.
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?
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.
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?
I am trying to find the test customers I used
They all seem to be cancelled and a lot of the data is missing
Hi ๐
I"m taking over as my colleague had to go
We have a retention period of 90 days for test mode subscriptions (well 90 days to cancel and then delete 30 days after that). https://support.stripe.com/questions/test-mode-subscription-data-retention
Something you did last month should still be present unless you were using Test Clocks and you deleted the test clock
This is the test customer https://dashboard.stripe.com/test/subscriptions/sub_0QSpXo5QM0nABsUHWfDRboe3
A lot of the data is missing
Sign in to the Stripe Dashboard to manage business payments and operations in your account. Manage payments and refunds, respond to disputes and more.
That's a subscription but yes this works
What do you mean by "A lot of data is missing"?
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.
The customer is cus_RLWVQd81g9ooOP
We ingest that webhook event and we have logic to manually reconcile invoices when the cash balance is short.
Checkout this customer: https://dashboard.stripe.com/test/customers/cus_RB35tIYUaWhcW4
Sign in to the Stripe Dashboard to manage business payments and operations in your account. Manage payments and refunds, respond to disputes and more.
Why should I look at this customer? What am I looking for?
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
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
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
That event was triggered, as my colleague suggested, by a manual request from your server to pay the invoice, which failed
https://dashboard.stripe.com/test/logs/req_o79dCM4fziiLnq
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?
It does not attempt payment
Okay
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?
This event is still fired whenever a cash_balance transaction occurs. https://docs.stripe.com/api/events/types#event_types-customer_cash_balance_transaction.created
I see what I need in the live account
Do you have a request ID for a request where a cash balance was update in Test mode?
I have one in the live account
Event ID: evt_0Qbkw85QM0nABsUHBP5KY4wO
You can see the type property in the event body. It says funded
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