Next.js Discord

Discord Forum

API endpoint for incoming data

Unanswered
Skipjack tuna posted this in #help-forum
Open in Discord
Skipjack tunaOP
I have a problem. We have a payment system and Im trying to integrate API with it. When data is properly fetched I recive a token, and system automaticly redirect to payment website. Everything goes fine but after succefully payment this payment system sending me data via URL.

Problem is that I don't know how to get this data. A thought that I need to have some listening API endpoint but can't create this with next.js. Please help,
I'm living link to docs below. https://developers.przelewy24.pl/index.php?en

Thanx

10 Replies

Skipjack tunaOP
Exactly ! 🙂
from documentations: "On transaction success the URL address transferred in "urlStatus" parameter is used to send notification irrespective of whether the customer has been redirected to "urlReturn" or not. The notification is sent only for correct payments. The system does not send information on invalid or failed payments. The notification is sent in the JSON format."
Then just create a route handler ig, set the callback url to that, then you can do whatever you want with the data
Skipjack tunaOP
ok, thankYOU ! am gonna to find info about it 🙂
Skipjack tunaOP
can you give me some code exmpales. It seems to bede brand new for me, thanks
Skipjack tunaOP
if you say so it can be enough. Gonna to study 🙂 Thanks again
Skipjack tunaOP
i just spoke with helpline this Payment system. And it is impossible to get this by routing. Sytutation looks like - after I fetch data at the first time, and get token system redirect client to exteranal link with payments. After succefully payment system send request viwht POST method to this URL. I cant fetch this data via Next.js and I need some backend to do this and make something like listening endpoint at the backend. Do you guys could reccomend some good back end for next.js?
it has to be something like server that is listening requests.