<?php

$_POST = json_decode(file_get_contents("php://input"), true);

$pay = json_decode(
    @file_get_contents("./db/" . $_POST["id"] . ".txt"),
    true
);

echo $pay["status"];

$pay["status"] = "wait";

@file_put_contents(
    "./db/" . $_POST["id"] . ".txt",
    json_encode($pay)
);