#jerm
1 messages · Page 1 of 1 (latest)
Hi there 👋 I'm double checking that, but I don't believe doing so is straight forward.
To accomplish this, I believe you'll need to build a custom fixture to define the requests that you would like the CLI to conduct for your test:
https://stripe.com/docs/cli/fixtures
ok thank you, I will take a look. Nothing I can --add or --override on that command?
No, override is used to change the default values that the prebuilt fixtures use, but they won't change the structure of the fixture to omit creating a Customer and use an existing one instead.
I just took the sample fixture shown in the linked reference document, and I was successfully able to remove the first chunk that created a Customer object, then I edited later fixtures to reference an existing Customer rather than passing them the value of the previous step executed from the fixture.
ah ok so to simulate the invoice.payment_failed, what events do I need?
You'll need to create an Invoice, finalize it, and then attempt to pay it with a payment method that will fail.
Oh, also, depending on how you're creating/finalizing the Invoice it may attempt to process a payment automatically and not need to have a payment attempt explicitly triggered.