#Stormriderstudio

1 messages ยท Page 1 of 1 (latest)

undone tundraBOT
grim pond
#

You're triggering the event via CLI right now?

open belfry
#

yes

grim pond
#

Are you providing some --override flag to generate a client_reference_id on the Checkout Session?

open belfry
#

no, all I'm doing right now is triggering a payment intent success, without a checkout session, which is probably why there's no way to link it to one. I guess the more general question is how does a payment intent link to a checkout session? I'm setting the checkout session client reference id as the order number in the database, so when the payment intent lands I can update the order status from pending to paid. Hope that makes sense

#

or am I triggering on the wrong thing, wanting to catch a successful payment from a checkout session?

grim pond
#

So you would set the client_reference_id on the Checkout Session object. The Checkout Session object should also have a payment_intent property to get the Payment Intent ID. I think you can trigger both of those through the CLI, but let me circle back on that in a couple minutes

open belfry
#

okay, I think I may know where I'm going wrong here. Reading too make docs pages at once. Should I be capturing checkout.session.completed rather than payment_intent.succeeded?

#

take all the time you need, I'm probably doing something daft or not understanding the flow properly. ๐Ÿ™‚

grim pond
#

Reading too make docs pages at once.
Few understand this sentiment more than me and my colleagues ๐Ÿ˜…

Here's the CLI trigger command to run in order to have a client_reference_id on the Checkout Session object:
stripe trigger checkout.session.completed --override checkout_session:client_reference_id=someID

open belfry
#

brilliant. and if create a checkout session with my script, fill out the form with a test card, will that trigger the session.completed and send it to my listener?

#

and one final question. does checkout.session.completed mean the funds are approved or just that the form was filled in. i.e. can I mark it as paid when that event comes in or should I wait for another authorisation? (I know there's some payment forms that are delayed but for general card transactions)

grim pond
#

brilliant. and if create a checkout session with my script, fill out the form with a test card, will that trigger the session.completed and send it to my listener?
Yup!

#

and one final question. does checkout.session.completed mean the funds are approved or just that the form was filled in. i.e. can I mark it as paid when that event comes in or should I wait for another authorisation? (I know there's some payment forms that are delayed but for general card transactions)
For card transactions, you can rely on checkout.session.completed for fulfillment. It will fire if and only if a payment was successful. Obviously delayed payment methods have their own Checkout events and you know about those already.

open belfry
#

yep, I've got the right page open for those, just wanted to make sure checkout.session.completed was an actual end point for general use.
You're once again a star. I'll leave you for the night now, it's damn near midnight here

grim pond
#

Whew! Yeah, much too late for reading Stripe docs. Hope you have a good one