#edutomesco
1 messages · Page 1 of 1 (latest)
accpetance test
test e2e
is there any library tool for simulate webhooks triggers
You can use the Stripe CLI to trigger events: https://stripe.com/docs/cli/trigger
so I need to fire from the code manually
one more question how can I create custom webhooks to execute from CLI
because for example I want to execute a session.checkout.completed but returning a subscription and the by default CLI trigger event doesn't return that
They pass me a documentation but I didn't get exactly how to create this json fixture
You want to trigger a checkout.session.completed with the CLI, but for a subscription instead of a payment?
exactly
Like you mentioned, one option is to create your own fixture. You can learn more about this here: https://stripe.com/docs/cli/fixtures
can you send an example with one that fires a checkout.completed for subscription?
I mean this fixture is to execute an api request right?
doesn't fire the webhook
Hey! Taking over for my colleague. Let me catch up.
Fixtures use a JSON file to issue a series of API requests. This can be useful when generating sample data, executing specific flows, or testing API behavior, which may result some webhook events
If you want to trigger a sample event checkout.completed, you can use trigger stripe cli command:
https://stripe.com/docs/cli/trigger
something like this :
stripe trigger checkout.completed
yes but I want to custom this checkout.completed to return a subscription_id so by default it didn't how can I manage?
can you follow me the steps if I want to test that
I think it's quite complicated to create a custom fixture. You can follow this guide in order to create a combination that may fit your requirements:
https://github.com/stripe/stripe-cli/wiki/fixtures-command
But I suggest you to simply create a Checkout Session in test mode and monitore the resulting webhook event:
https://stripe.com/docs/billing/subscriptions/build-subscriptions?ui=checkout