#Zomofo
1 messages ยท Page 1 of 1 (latest)
Sure, that's just how it works. The trigger command will create a new Checkout Session under the hood, it'll be completely different to the session you created yourself via the API
That's the fixture that event trigger uses. You can see it's created API objects itself, so you can't expect the same ID as the session you're creating
Well you would use the --override flag with the trigger command to pass in the metadata fields you want in the event payload:
stripe trigger checkout.session.completed --override checkout_session:metadata.foo=bar
Yes
I pass unique data when I create checkout session, do I have to pass it every time when I invoke stripe trigger?
;o
copy, paste to test it locally?
If you're creating a Checkout Session directly, why not just use stripe listen and forward those events?
No need to trigger anything then
hmmm I dont understand
I create checkout session in such way
const stripeSession = stripe.checkout.sessions.create({
payment_method_types: ['card', 'blik', 'p24'],
line_items: lineItems,
You can tell the CLI to forward events that occur on your account, such as checkout.session.completed, that are triggered via API requests
There's no need to manually trigger events, via stripe trigger, if you're also making the API request
Just do stripe listen --forward-to:http://xxx
Then create the Checkout Session, visit the payment page (via url), complete the session and the associated checkout.session.completed event will fire and the CLI will forward it to your local endpoint
hmmm ok I am checking xD
probably it works ๐
so it is enough to run stripe listen
and all events will invoke
AND THIS IS GOOOD
!!!
thanks for help, it seems to work
thank you so much
could you wish me good luck with my application? I want to be millionare
You can limit the events that it listens for if you wish: https://stripe.com/docs/cli/listen#listen-events
--events , yes?
it woorks ๐