#Sangeeta
1 messages · Page 1 of 1 (latest)
Hi there, you can listen to payment_intent.succeeded event to get notified when a payment is succeeded.
I see, so you want to get the payment status in frontend?
yes
For payment methods that can be confirmed immediately, i.e., card payment, as long as the customer is redirected to success_url, it means the payment is successful.
However, for payment methods that can't be confirmed immediately. a customer is redirected to success_url even though the payment is pending.
You can add the {CHECKOUT_SESSION_ID} template variable to the success_url when you create the Checkout Session, and Stripe will replace it with the checkout session ID upon redirection. You still need to write some backend code to retrieve the checkout_session -> payment_intent and check its status. The details is explained here. https://stripe.com/docs/payments/checkout/custom-success-page#create-success-page
but at least gave us $_GET['session_id'] in success page .