KiKo
KiKo
Explore posts from servers
TTCTheo's Typesafe Cult
Created by Elite on 6/24/2024 in #questions
instant updates from route handler to frontend
Maybe just let the user hit a button to refresh
54 replies
TTCTheo's Typesafe Cult
Created by Elite on 6/24/2024 in #questions
instant updates from route handler to frontend
Idk test it
54 replies
TTCTheo's Typesafe Cult
Created by Elite on 6/24/2024 in #questions
instant updates from route handler to frontend
I've never done a payment like the way you are describing btw. Is this B2B?
54 replies
TTCTheo's Typesafe Cult
Created by Elite on 6/24/2024 in #questions
instant updates from route handler to frontend
Depending on your payment tier, either way you get billed for the execution time
54 replies
TTCTheo's Typesafe Cult
Created by Elite on 6/24/2024 in #questions
instant updates from route handler to frontend
They kill lambdas after a set amount of time
54 replies
TTCTheo's Typesafe Cult
Created by Elite on 6/24/2024 in #questions
instant updates from route handler to frontend
Your problem will be the vercel timeouts
54 replies
TTCTheo's Typesafe Cult
Created by Elite on 6/24/2024 in #questions
instant updates from route handler to frontend
Without breaking out and spinning up a server just for this
54 replies
TTCTheo's Typesafe Cult
Created by Elite on 6/24/2024 in #questions
instant updates from route handler to frontend
I mean yea probably your only option when using serverless
54 replies
TTCTheo's Typesafe Cult
Created by Elite on 6/24/2024 in #questions
instant updates from route handler to frontend
Both these callbacks should occur in sync, unless the user is being intentionally malicious, so the timings will line up and you shouldn't have to reach out to your database too many times, id assume under 15 seconds total....
54 replies
TTCTheo's Typesafe Cult
Created by Elite on 6/24/2024 in #questions
instant updates from route handler to frontend
There's essentially two callbacks, one client side and one server side
54 replies
TTCTheo's Typesafe Cult
Created by Elite on 6/24/2024 in #questions
instant updates from route handler to frontend
They click pay and get redirected back to your website once it completes
54 replies
TTCTheo's Typesafe Cult
Created by Elite on 6/24/2024 in #questions
instant updates from route handler to frontend
They go to some PayPal.com website
54 replies
TTCTheo's Typesafe Cult
Created by Elite on 6/24/2024 in #questions
instant updates from route handler to frontend
When someone clicks pay with PayPal doesn't it take them off your site to pay?
54 replies
TTCTheo's Typesafe Cult
Created by Elite on 6/24/2024 in #questions
instant updates from route handler to frontend
That shouldn't matter as long as you only start checking once the callback url is redirected to
54 replies
TTCTheo's Typesafe Cult
Created by Elite on 6/24/2024 in #questions
instant updates from route handler to frontend
a few seconds from the user returning to you site that is
54 replies
TTCTheo's Typesafe Cult
Created by Elite on 6/24/2024 in #questions
instant updates from route handler to frontend
You probably won't have to constantly check... I'm assuming that within a few seconds you might have a response from paypal
54 replies
TTCTheo's Typesafe Cult
Created by Elite on 6/24/2024 in #questions
instant updates from route handler to frontend
Full flow... User clicks pay, fills in details on PayPal site, complete payment, PayPal sends webhook and you update your db, user is redirected back to your site, once they land on your site, query your db to see that the purchase is complete, if not try again. If you have to try more than once you can probably add a fixed delay to account for anything delays on PayPal end
54 replies
TTCTheo's Typesafe Cult
Created by Elite on 6/24/2024 in #questions
instant updates from route handler to frontend
Use the callback url, all on the front end, to act as the "trigger" to re-check the payment was completed
54 replies
TTCTheo's Typesafe Cult
Created by Elite on 6/24/2024 in #questions
instant updates from route handler to frontend
Simplest solution is on the front end to wait a few seconds and send a requests, "was the payment successful yet?" Over and over again until you get a success response
54 replies
TTCTheo's Typesafe Cult
Created by Elite on 6/24/2024 in #questions
instant updates from route handler to frontend
If you are deployed to vercel that will not work because your backend only exists during the time a request is made. To use we sockets, server sent events, or long polling you need a server that will stay alive
54 replies