#thomas-d

1 messages · Page 1 of 1 (latest)

solemn smeltBOT
drowsy island
#

Can you share the Payment Intent ID (pi_xxx)?

sly coral
#

You want me to share it here?

drowsy island
#

Yup! Sharing payment intent here is fine since only Stripe staff is able to access it

sly coral
#

but I just wanted to know if it was possible because I want to implement this in my site (cancellation of a payment if a customer wants to cancel an appointment). but here is the id :cs_test_a1v8g9tf6FYmEUSfcisbEVYetKSzEHhwMxNMxgwJPqL1M8GVTnLaalWxIr (but this is a test payment)

drowsy island
#

Canceling a Payment Intent API can only be used when a Payment Intent (pi_xxx) is created. When the Checkout Session isn't completed, no Payment Intent will be created

sly coral
#

I have this error : Only Checkout Sessions with a status in ["open"] can be expired. This Checkout Session has a status of complete

But the payment is not completed on the interface of stripe

drowsy island
#

Can you share the Checkout Session ID (cs_xxx) that this error is shown?

#

Oh wait

#

My bad

#

cs_test_a1v8g9tf6FYmEUSfcisbEVYetKSzEHhwMxNMxgwJPqL1M8GVTnLaalWxIr was completed, which fell into case 2 that I mentioned above

sly coral
#

ok but i don't have the payment_intent in session object when i create a session. So i need to get this and after Cancel Payment Intent API ? Do you have a link in the doc for get the payment ?

drowsy island
#

payment_intent will only be available after the payment is completed. Your system should subscribe to checkout.session.completed event to get the payment intent ID. Here's the guide about handling checkout.session.completed events

sly coral
#

Ok thank you i go try this !