#charliematters

1 messages ยท Page 1 of 1 (latest)

solemn muskBOT
feral coral
#

Hi ๐Ÿ‘‹

I"m not actually familiar with Remix (Dev Advocacy doesn't staff this server). I definitely think that is not what is intended though. You should only get a single payment intent that you then take action on.

royal lintel
#

Hi! That's what I thought might be the case - is there a better place to ask the question?

feral coral
#

I mean, I can review the tutorial, I'm just not familiar with the framework so I might miss why it's reloading.

#

Okay wait... why is there any Payment Intent creation occurring on success.tsx? Shouldn't that just be a "thank you for your purchase" kind of thing?

royal lintel
#

Yeah, that's what I thought!

#

With the way remix handles the routes though, it runs the loaders for both /app/routes/pay.tsx as well as /app/routes/pay/success.tsx

#

It feels like the /success page should just be outside of that tree,

feral coral
#

But why does running the loader for /success.tsx cause a second Payment Intent to be created?

royal lintel
#

When the browser is redirected to /pay/success, it runs every loader in the tree of routes

#

/success.tsx doesn't do anything, but the loader at the parent level (/pay.tsx) runs createIntent()

#

In fact, in playing around with it, moving routes/pay/success.tsx to routes/pay.success.tsx seems to have done the trick

#

If you're new to remix's file-base routing, it can mess with your head!

feral coral
#

So did talking it out just resolve the issue for you? We're pretty good rubber ๐Ÿฆ† s around here ๐Ÿ™‚

royal lintel
#

The best rubber ducks!

#

I still think the tutorial might need updating, but ultimately all it will do is fill the payment logs with incomplete duplicates

#

Would it help if I left a github issue on it?

feral coral
#

Actually that is a great way to leave feedback!

royal lintel
#

I'll do that then - thanks for your help