E
E
exetico2020-09-18 09:06:52
Node.js
exetico, 2020-09-18 09:06:52

How to set up access to the page only after payment?

node js,
express,
react.
How can I set up access to a page on my site only after paying for the goods?
Those. the payment system has Fail URL and Success URL redirects.
It is necessary that users cannot enter the page in any way, because. on it will be given an access key to the program, except for redirection by success.
P.s. I ask not for the solution of my question, but at least the direction of what to google)

Answer the question

In order to leave comments, you need to log in

2 answer(s)
H
hzzzzl, 2020-09-18
@hzzzzl

Success URL, let the user's ID be written to the database and paid: true, and when entering the desired page, let it be checked, and if not, then redirect?

A
Alexander Cheremkhin, 2020-09-19
@Che603000

Success URL, let the user's ID be written to the database and paid: true, and when entering the desired page, let it be checked, and if not, then redirect?

This is not a good idea, it is not safe to do so. This is usually done in the following way - after the provider called the success page, you need to contact the provider using the payment data that you received in the request in order to get the payment status Directly from the provider. Only after that the record in the database, etc.
Anyone can access the success pages, it's not safe.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question