#b33fb0n3
1 messages · Page 1 of 1 (latest)
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?
Hey soma, I just saw handleing errors
then(function(result) {
if (result.error) {
// Inform the customer that there was an error.
}
});
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
You want to create a customer when the payment is successful?
Then you should use webhook events for this.
You can learn more about this here: https://stripe.com/docs/webhooks
yes I want to, but I don't what to share the credentials to a third party. The login information should stay at the client
It's not a third party, you write your own code to handle incoming webhook events.
they call and also the data will come from stripe. To access the credentials from the webhook I need to store them in the data that I get and I only get the data, that stripe knows. So I would share them with stripe
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.
yeah. Stripe tells me "ok was successful". Than I say "alright let's create the user on my side without stripe. Let me add the user to the records with the username ... uhm wait... username??? where is the username... let me check the password... oh well I have no data..."
Got it. Do you only accept cards payment or other payment method?
I accept other payment methods as well
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
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?
Yes seems like a good option.
alright, thanks!
Happy to help 🙂