#charliematters
1 messages ยท Page 1 of 1 (latest)
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.
Hi! That's what I thought might be the case - is there a better place to ask the question?
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?
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,
But why does running the loader for /success.tsx cause a second Payment Intent to be created?
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!
So did talking it out just resolve the issue for you? We're pretty good rubber ๐ฆ s around here ๐
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?
Actually that is a great way to leave feedback!
I'll do that then - thanks for your help