#davizzolla
1 messages · Page 1 of 1 (latest)
Hi, can you share what exactly you're doing and the documentation you're using? Where are you exactly stuck?
I'm making a system where the user can buy discount cards, I'm using stripe to process payments, for the user to use the card I thought of doing the following: when the purchase is approved I would put a field in the database like true and the user could use the card, the problem is that I don't know how to know if the purchase was approved or not
You can listen to charge.succeeded event, https://stripe.com/docs/api/events/types#event_types-charge.succeeded to be notified when the charge succeeds. You can retrieve a PaymentIntent, https://stripe.com/docs/api/payment_intents/retrieve and look at the status as well to see if the payment succeeded.