#Syafiq Idrus
1 messages · Page 1 of 1 (latest)
hi! what's the question?
Im trying to use the custom fixture taken from this repo which triggers an invoice.payment_failed event
https://github.com/stripe/stripe-cli/blob/master/pkg/fixtures/triggers/invoice.payment_failed.json
However when looking at the events thats being created in the cli, none of the events actually trigger the failed event. I instead received a paid event
it's supposed to generate a failure but sometimes that won't work depending on circumstances, such as your API version I think. Can you share your account ID acct_xxx or some ID of a cus_xxx Customer or other object on your account so I can check?
The last fixture has added expected_error_type:"card_error"
However when looking at the cli documentation https://stripe.com/docs/cli/fixtures i dont see any expected_error_type
"name": "customer",
"path": "/v1/customers/cus_NCLw148NwAIbj1",
"method": "get"
},```
This is the first fixture that im calling in
Which replaces the first fixture in the example
That is the only difference
yeah that breaks it though
because that customer has a balance of I think negative $68
so the invoice doesn't actually need to be paid, so it doesn't generate any failure
Ohhh
if you look there you can see that the test invoices you create are all getting offset by the customer's balance
I see it
In that case, are there any specific errors that i can use to bypass this?
Id simply like the invoice to fail using this customer
not really, since that customer is not ever going to need a payment. I suppose you could delete all their attached payment methods but I think that will give you a different error, so it's not a very represtantive test
easiest thing is to just use a new customer, or reset/clear that customer's balance
What would be the best way to reset a customers balance?
I see it, theres an adjust button
So from my understanding, if the customer has any balance in the account, provided that they can afford the total amount, the invoice will always succeed?
if they have a negative balance, yes
the balance is applied to any invoices for that customer, and if the amount after applying can be 0, then there's no payment
https://stripe.com/docs/billing/customer/balance are the docs