#akshay-payment-element

1 messages · Page 1 of 1 (latest)

vapid kelp
#

Hi there!

#

Hrmm this doesn't really sound possible.

#

Can you explain more about what you are trying to accomplish?

#

Then we can talk about the best way to do so

solid thunder
#

Its like once i get to know the payment is successful.. i would like to confirm order for that user by writing some functions to my database..

#

I want all this to happen bfore stripe redirects to me the success url

#

Right now it’s directly redirecting me to the success url without executing my functions which i have written that will connect to my db

vapid kelp
#

Why do you need this code to run before the redirect?

solid thunder
#

It shuld execute only after the payment is successfull

#

And i wont be able to execute this in the success page

vapid kelp
#

Well overall you want to use Webhooks for this

#

That is the point, as they are foolproof for a dropped session from the customer where the payment gets confirmed but code after that never runs.

solid thunder
#

But will i be able to send my cart data to the webhook?

vapid kelp
#

There are various ways to do that, yes.

#

Most folks attach metadata to the PaymentIntent which would be an order ID

#

Then that metadata will come through your Webhook and you match it to the cart that is already in your database based on the checkout page

solid thunder
#

So in the metdata i can attach anything i require right

vapid kelp
solid thunder
#

Ok let me check that

#

I had one more thing to ask.. is it possible to hide the query parameters which is there in the success redirect url??

vapid kelp
#

No that's not possible.

solid thunder
#

Okay

#

Thankss for the help! @vapid kelp 😄