Trying to implement the test purchase case study on the website.
Make an ajax request with the ID of the case, a php script checks purchased it.
If purchased - returns a response that the page begins to scroll roulette
If the briefcase is purchased - response is returned, based on which the window appears(sweetalert2) with the text "you must buy a case" and two buttons: "Buy" and "Cancel".
Click on to buy, another query. PHP file while not checking the balance and not buying the case, just gives the answer that the case is purchased(for the test). Or rather, must give this response, but actually does not..
Either I did something with ajax, may request isn't sent, and maybe in the php file missed something.
JS code: pastebin.com/Kk07EwDp
PHP code: pastebin.com/f9pm6LWW