I’m building a new checkout flow with the Node.js SDK createPaymentLink function. As soon as the link is received I redirect the user to it. Fairly often (I’d say > ~50%) of the time, the link 404s. If I wait a short time and then reload the page, everything is fine.
It almost seems like the SDK is returning links before the page is publicly available.
Is this a known issue? It’s a blocker for me as I can’t be redirecting users to a page that’s going to 404. The only workaround I can think of is artificially delaying my redirect after the link is received.
Often time there are some asynchronous functions that happen on the Square side that can cause a slight delay. I’ve mentioned this to the team and they are looking into it.
Hey @dtf, we’re still looking into this! We found something earlier today that we suspect may be related, but we’re still verifying. Thanks for your patience!
Hi @josh-square, I’m also experiencing this problem. Just wondering if there has been any progress on a potential fix.
Is there anything we do in the meantime? as in, being able to check if the link is ready before redirecting the users to it?
We could make a fetch() HEAD request till getting a 200 response but it’s blocked by CORS (as it probably should) but is there any Square API we could poll on or something?
@Bryan-Square Glad to hear to hear of some movement on this. I just tried to reproduce this again. First attempt went well, second failed. Here’s the link that was generated.
Thanks for the quick reply, @Bryan-Square. I’ve just started implementing this functionality this week, and have been getting the error since the start of the week.