#SnowRunescape

1 messages ยท Page 1 of 1 (latest)

errant pagodaBOT
worldly sun
#

Hi ๐Ÿ‘‹

Can you provide a link to specific doc you are referring to?

golden iris
#

or... when I create a payment link with Session::create, which stripe reference should I keep? as the unique id of the transaction?

worldly sun
#

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?

golden iris
#

so when I receive the webhook, I know which transaction

golden iris
worldly sun
#

The Checkout Session, once completed, will have the Payment Intent ID associated with it.

#

Which webhook event are you listening to?

golden iris
#

charge.succeeded

#

but I didn't get the "client_reference_id"

#

example code

worldly sun
#

That field only exists on the Checkout Session. It is not present in the Charge

golden iris
#

How can I validate if it was paid and at the same time receive this parameter?

worldly sun
#

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?

golden iris
#

I don't know very well the events that exist, I'll check if this one meets

worldly sun
#

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.

golden iris
#

this pi_3N2mucD7SFXQ82v60r11o08I ?

worldly sun
#

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

golden iris
#

yes, but this transaction represents which transaction within my system?

#

I would know with the "client_reference_id"

worldly sun
#

That will be on the Checkout session

#

Which is why you listen to the checkout.session.succeeded event.

#

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

golden iris
#

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?

worldly sun