Y
Y
yarovikov2020-05-21 10:29:47
WordPress
yarovikov, 2020-05-21 10:29:47

Server-side price check?

Hi all.

There is a custom checkout form, where the price changes depending on the selected options (number of people, nights, etc.) and the whole thing goes to the payment via ajax and then written to the database.
How to protect yourself from data spoofing on the user side?
Do I understand correctly that you need to recalculate the price in the php callback function based on the initial data (in fact, a double calculator from the front), check with what came from the POST request and then send it to the payment?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
W
WP Panda, 2020-05-21
@weart

At the front, the calculation should be for reference, all calculations that are important must be done on the server side and not on the client

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question