#m4tt-cli-trigger
1 messages ยท Page 1 of 1 (latest)
also, is there any way to make the event actually be related to a real (albeit test) payment?
Hi again ๐ the reason you see multiple things happen when you trigger an event such as payment_intent.succeeded is because the CLI is actually stepping through all the necessary steps to simulate that event.
So using payment_intent.succeeded
- A Payment Intent needs to be created
- The underlying Charge for the Payment Intent is completed
- Then the Payment Intent transitions into a
succeededstate.
So you should actually see the Payment Intent from that event in your account now.
ok cool thats what i figured.. hence the second question!
did you see the second question @frigid rain ?
also, is there any way to make the event actually be related to a real (albeit test) payment?
No, there isn't a way to tell the CLI to use existing objects for its flows. It will always create new objects.
ah ok, so i guess i need to use ngrok to test "real" webhooks?
Sorry, not sure I'm following.
If you're using stripe listen then the CLI will listen for any events that occur on your account (based on the flags/options you use) and can then forward those to a local endpoint. So you can just go through your test flow and the CLI should pick up on the events that are generated.
ohhhh
apologies, i didnt realise stripe cli can be used for listening to actual events, i thought it was only used for triggering
No worries! Just in case you haven't seen it, you can see more about the listen command here:
https://stripe.com/docs/cli/listen
amazing, thank you
whats the difference between payment_intent.succeeded and charge.succeeded ?
Primarily the object that is returned in the event body. They're essentially triggered by the same thing, when a Charge succeeds then the Payment Intent that it is associated with also succeeds.
Payment Intents just use an underlying Charge to complete the payment.
๐