#n8k_webhooks
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/1367204988547367142
๐ Have more to share? Add more details, code, screenshots, videos, etc. below.
This is the content of my fixture file with test data:
{
"_meta": { "template_version": 0 },
"fixtures": [
{
"name": "early_fraud_warning.created",
"path": "/v1/events",
"method": "post",
"params": {
"type": "radar.early_fraud_warning.created",
"data": {
"object": {
"id": "issfrw_test_123",
"object": "early_fraud_warning",
"charge": "ch_test_charge",
"fraud_type": "unauthorized_use_of_card",
"livemode": false,
"payment_intent": "pi_test_intent"
}
}
}
}
]
}
Hi, it does not look like that is supported via the CLI. We document our supported events here: https://docs.stripe.com/cli/trigger#trigger-event
Yeah, but I was hoping to follow this approach
not all events are supported via Fixtures but let me confirm if this does
ty!
It does not look like it, and I see https://github.com/stripe/stripe-cli/issues/310
Alternatibely, you can use https://docs.stripe.com/testing?testing-method=card-numbers#disputes this card: 4000000000005423 to trigger that event
Hmm I did see that GH issue and upvoted it, but this looks like it is related to prebuilt events not custom fixtures?
Yes, that is for a prebuilt event. I attempted to trigger the event but could not using fixtures
Okay do you have a good place for me to read on custom fixtures? I may be misunderstanding them
This, https://docs.stripe.com/cli/fixtures is what I'm using
I think I see - if I want to create them custom i need to find the url path to just create it in the api?
Hi there ๐ jumping in as my teammate needs to step away. I also don't think this is something that you can test via fixtures, as fixtures are used to change the API calls that the CLI makes, but early fraud warnings aren't triggered by making requests to our API. Instead they're generated when we receive input from issuers, so there isn't an endpoint in our API for creating those that you can call.
I do think that using the 5423 test card is the best path for testing these early fraud warnings.
Ahh
this makes sense
Okay so I basically just need to validate this locally by turning off signature verification and just believing my local webhook
And then I can use the special card for non-local testing
Not necessarily, you can still use the CLI to listen for these types of Events, and use it to forward them to a local endpoint that you're running for testing purposes. The CLI will generate a signing secret when you run stripe listen that can be used to keep signature validation in place for the localhost testing.
Just you won't use stripe trigger to generate the Event.
So even using one of those prebuilt on stripe test payment pages for testing coudl forward to my local via the stripe listen?
That would be great
like with a payment link
Yup, we have a step in one of our webhook guides showing this here:
https://docs.stripe.com/webhooks#test-webhook
The gist is, that when you run stripe listen you use the --forward-to option (and --forward-connect-to if you're also testing Events for a Connect integration) to tell the CLI where it should send Events to once it receives them:
https://docs.stripe.com/cli/listen#listen-forward-to
The CLI will automatically handle signature verification with our service, so Events won't be sent more than once, but it will also generate a signing secret when you run stripe listen that you can use to test signature verification on your local endpoint (the Event is essentially re-signed for you once it hits your machine). My attached screenshot is showing how that signing secret is printed after you run that command to start the listener.
Great this worked! ty!
This is perfect - thank you ๐ Feel free to close this one!
๐ฅณ Yay! Glad to hear that did the trick