#Aruljothi-applePay

1 messages ยท Page 1 of 1 (latest)

desert viper
#

@tulip lichen I don't think I understand you, can you explain in a lot more detail?

tulip lichen
#

in applepay ->payment done but payment not completed message displayed

#

payment are done, and got email receipt also

#

but applpeay wallet pages ->payment not completed message return

desert viper
#

can you share the code you're using?

tulip lichen
#

one moment

desert viper
#

this seems to missing some parts, can you show me where ev comes from, as in how your event listener to .on("paymentmethod") is set?

#

my guess is though you aren't actually running that code you think you are(it's likely not saved or deployed to the actual page you're using)

tulip lichen
#

one moment

desert viper
#

this code is really complicated and error-prone since you make 4 separate fetch requests in a row when handling the event, it's hard to follow ๐Ÿ˜ฆ

#

for example have you timed these fetch requests?

#

because maybe what happens is they take too long, so the code doesn't actually reach the point of calling confirmCardPayment(and then you call ev.complete after that function is called) until >30s, so the Apple Pay sheet has already cancelled

#

that would be my guess. My overall advice here is to work with your backend developer and simplify this, so you only have to make one single fetch to your backend and have it to do all the work and then return back the PaymentIntent. Right now doing 3 backend calls, and then a Stripe API call, all while the Apple Pay sheet is spinning, seems like a recipe for problems.