#עידן-paymentelement

1 messages · Page 1 of 1 (latest)

stiff crater
#

Hi there!

tacit dove
#

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

  1. The user to stay where he is, and replace the PaymentElement with "We got you'r info" and show him a Download button
  2. Send an event to some analytics, and log the success.
    How can I manage to do that?
    Thank you
stiff crater
#

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 a return_url.

bleak sundial
#

what is the question?

tacit dove
#

How can I achieve these 2 things? Thanks

bleak sundial
#

what is missing from my colleagues answer?

tacit dove
#

He said it will redirect me.
My question is, how can I achieve:

  1. The user to stay where he is, and replace the PaymentElement with "We got you'r info" and show him a Download button
  2. 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?

bleak sundial
#

the only way to stay on the same page is to pass the return_url as the same url you're already in

tacit dove
#

OK, and about the callback function? I mean, how do I know the stripe.confirmSetup succeeded?

bleak sundial
#

either on the success page (return_url) on the front end or by listening to the setup_intent.succeeded event in your webhook endpoint

tacit dove
#

Oh great, how do I listen to the setup_intent.succeeded event?

bleak sundial
#

you need to setup webhooks and choose that event to listen to

tacit dove
#

Great, thanks again, Edan

bleak sundial
#

let me know if you need any more help