#Iskaldr-cli
1 messages ยท Page 1 of 1 (latest)
hmm, let me look
I think there's a race condition unfortunately
the way the trigger works is it creates a customer, then an invoice item, then an invoice, which is supposed to pull in the pending invoice item, and then it tries to charge the invoice with a card that fails, to simulate the event. But here it somehow created the invoice without pulling in the invoice item(you see it's still pending on https://dashboard.stripe.com/test/customers/cus_MEOmqeLQ7AFGkP) , so the invoice was for $0 and there was no payment and thus no failure
that's really weird
Ah ok, but at least I now know, it is not because of me misusing the command. ๐
Are there any alternative ways, how I could trigger an invoice.payment_failed to test my local code?
if you try it again does it work? or was it a once off blip?
oh wait
it's a bug in the CLI, in the latest API version we changed the behaviour so that items are not pulled in by default and you have to explicitly pass a parameter to make them included (https://stripe.com/docs/api/invoices/create#create_invoice-pending_invoice_items_behavior)
so that's a bug in the CLI, we need to update the trigger fixture to work on the latest API version
you could also do --api-version=2020-08-27 on the stripe trigger call to force the old version as a quick fix to get the event you want.
Awesome thank you very much, will try the quick fix for now and keep my eyes open for the next CLI update. ๐
It is working with the quick fix, thank you very much!
One more question (please let me know if I should create a new Thread for that): is it possible to use stripe trigger invoice.payment_failed with an additional parameter so that the invoice will be for a subscription?