#b33fb0n3

1 messages · Page 1 of 1 (latest)

dim hawkBOT
rancid umbra
#

Hi there!

#

What do you mean by "check if the confirm is successful or not"?

#

Can you share more context about what you are trying to do?

quick valve
#

Hey soma, I just saw handleing errors

then(function(result) {
  if (result.error) {
    // Inform the customer that there was an error.
  }
});
quick valve
# rancid umbra Can you share more context about what you are trying to do?

yeah. The customer buy content from me and I want to safe the bought content to the customer object. To create a customer object I need to have an email and a password. I get both in the component where the customer also have the elements and confirm them. Now I want to only create the customer object, when the payment was successful, but not when there is an error. I don't want to send the email and password via the url

rancid umbra
#

You want to create a customer when the payment is successful?

#

Then you should use webhook events for this.

quick valve
rancid umbra
#

It's not a third party, you write your own code to handle incoming webhook events.

quick valve
rancid umbra
#

I don't understand your sentence. But webhook events it's just Stripe telling you "hey, this payment intent succeeded". And then you can do whatever you want with this information, without having to share anything with Stripe.

quick valve
rancid umbra
#

Got it. Do you only accept cards payment or other payment method?

quick valve
rancid umbra
#

When you confirm the PaymentIntent, users will be redirected to your return_url. But if users close they browser before the redirectino happens, you will lose some information.
So you have two options:

  • Create the customer before creating the payment
  • Create the customer with a webhook event
quick valve
#

well, than I have only the option to create the customer before and than it's my problem how to handle it if the payment have errors, right?

rancid umbra
#

Yes seems like a good option.

quick valve
#

alright, thanks!

rancid umbra
#

Happy to help 🙂