#Syafiq Idrus

1 messages · Page 1 of 1 (latest)

brittle blazeBOT
tidal lark
#

hi! what's the question?

bold gyro
#

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

GitHub

A command-line tool for Stripe. Contribute to stripe/stripe-cli development by creating an account on GitHub.

tidal lark
#

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?

bold gyro
#
      "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

tidal lark
#

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

bold gyro
#

Ohhh

tidal lark
#

if you look there you can see that the test invoices you create are all getting offset by the customer's balance

bold gyro
#

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

tidal lark
#

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

bold gyro
#

What would be the best way to reset a customers balance?

tidal lark
#

you can edit it from that page I linked I think

bold gyro
#

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?

tidal lark
#

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

bold gyro
#

Noted

#

Just tried the fixture again, and it now returns the failed response

#

Thanks for the help!