#SnowRunescape
1 messages ยท Page 1 of 1 (latest)
Hi ๐
Can you provide a link to specific doc you are referring to?
or... when I create a payment link with Session::create, which stripe reference should I keep? as the unique id of the transaction?
Payment Link are different things that Checkout Sessions. If you are using Session::create then you are creating a Checkout session.
What is the purpose of the ID in your system?
so when I receive the webhook, I know which transaction
Complete reference documentation for the Stripe API. Includes code snippets and examples for our Python, Java, PHP, Node.js, Go, Ruby, and .NET libraries.
The Checkout Session, once completed, will have the Payment Intent ID associated with it.
Which webhook event are you listening to?
That field only exists on the Checkout Session. It is not present in the Charge
How can I validate if it was paid and at the same time receive this parameter?
charge.succeeded is a long way from the Checkout Session. The way these records get created is like this:
Checkout Session -> Payment Intent -> Charge
Sorry it's still not clear what you are trying to do. If the data you need lives on the Checkout Session why don't you listen to the checkout.session.completed event?
I don't know very well the events that exist, I'll check if this one meets
Do you have an example Checkout Session I could take a look at?
Once completed, the Checkout Session will contain a link to the Payment Intent that successfully processed the payment.
this pi_3N2mucD7SFXQ82v60r11o08I ?
That is the Id for the Payment Intent. It succeeded showing you received the the funds. It also includes the ID of the related Charge.
latest_charge: "ch_3N2mucD7SFXQ82v60vNSs5Zy",
So you can use this to verify that you were successfully paid
yes, but this transaction represents which transaction within my system?
I would know with the "client_reference_id"
That will be on the Checkout session
Which is why you listen to the checkout.session.succeeded event.
For the payment intent you provided that is this event: https://dashboard.stripe.com/test/events/evt_1N2mudD7SFXQ82v6hvBV2wms
You can see the client_reference_id field is part of the data returned to you
As well as the payment_intent
You can look at the payment_status field to see if you have been paid or not
I'm testing I'll give you a feedback
Okey, it worked here
I just have one more question
How do I know if a payment was refunded?
I would listen to the refund.created event. This will send you a Refund object https://stripe.com/docs/api/refunds/object