#עידן-paymentelement
1 messages · Page 1 of 1 (latest)
Hi there!
- You could either run your function in the backend when you receive the webhook event
payment_intent.succeeded, or run the function on thereturn_urlpage - The
return_urlis required as mentioned here: https://stripe.com/docs/js/payment_intents/confirm_payment#confirm_payment_intent-options-confirmParams
I read it thanks, but why the differences between the PaymentElement and the CardElement?
In my case:
After the setup is confirmed (trial phase), I want
- The user to stay where he is, and replace the
PaymentElementwith "We got you'r info" and show him aDownloadbutton - Send an event to some analytics, and log the success.
How can I manage to do that?
Thank you
I read it thanks, but why the differences between the PaymentElement and the CardElement?
CardElement only works with cards, however PaymentElement works with many payment method, including some that will redirect the end user to a different URL to confirm the payment.
That's why you need to set areturn_url.
what is the question?
How can I achieve these 2 things? Thanks
what is missing from my colleagues answer?
He said it will redirect me.
My question is, how can I achieve:
- The user to stay where he is, and replace the PaymentElement with "We got you'r info" and show him a Download button
- Send an event to some analytics, and log the success.
Maybe there is a way to not redirect with return_url=""? and pass a callback function to onSuccess?
the only way to stay on the same page is to pass the return_url as the same url you're already in
OK, and about the callback function? I mean, how do I know the stripe.confirmSetup succeeded?
either on the success page (return_url) on the front end or by listening to the setup_intent.succeeded event in your webhook endpoint
Oh great, how do I listen to the setup_intent.succeeded event?
you need to setup webhooks and choose that event to listen to
Great, thanks again, Edan
let me know if you need any more help