#mahraamir

1 messages ยท Page 1 of 1 (latest)

lime kernelBOT
honest urchin
#

๐Ÿ‘‹ happy to help

#

would you mind elaborating more though?

wet bolt
#

I mean the return URL I am providing for confirming payment, stripe is calling back two times

#

const {error} = await stripe.confirmPayment({
elements,
confirmParams: {
return_url: capp_return_url,
payment_method_data: {
billing_details: {
name: cname,
email: cemail,
}
},
}
});

honest urchin
#

oh really?

wet bolt
#

pi_3OKeUDL9quFZ1jsw132VMNkO

honest urchin
#

are you sure your code isn't running twice?

wet bolt
#

no

honest urchin
#

how can you tell it's calling it twice?

wet bolt
#

I added a log

#

I dumped log on top of script and saving GET request

honest urchin
#

that doesn't prove that it's the stripe.confrimPayment that is calling your return url twice

#

this only means that the code that inserted these rows is being called twice

#

did you happen to debug your code to find exactly what's happening?

wet bolt
#

I am trying obviously but couldn't find duplicate thing

#

one thing is sure, I am calling confirm once because stripe log is telling

honest urchin
#

yes you're totally right

#

just a quick question

#

what does it change for you if the returnURL is hit twice?

#

does you returnURL has any special "fulfilling" logic?

wet bolt
#

I have a logic based on that

#

like deducting balance

#

sending emails

#

so everying is bineg done twice ๐Ÿ™‚

honest urchin
#

you should never rely on the return URL for this

#

this is why we have the webhook events

wet bolt
#

hmm

#

ok I change my logic