$html .= "<div class='row'><label>Сумма возврата</label><input type='text' name='amount'/></div>"; $html .= "<div class='row'><label>Текст сообщения</label><input type='text' name='message_text'/></div>"; $html .= "<div class='row'><label>URL картинки сообщения</label><input type='text' name='message_image_url'/></div>"; $html .= "<div class='row'><label>URL сообщения</label><input type='text' name='message_url'/></div>"; $html .= "<div class='row'><input type='submit'/></div>"; $html .= "</form>"; echo $html; $method = isset($_POST["method"]) ? $_POST["method"] : ""; $id = isset($_POST["id"]) ? $_POST["id"] : ""; if (!empty($id)) { $Payqr_invoice = new PayqrInvoiceAction(); $Payqr_revert = new PayqrRevertAction(); $result = ""; switch ($method) { case "get_invoice": $result = $Payqr_invoice->get_invoice($id); break; case "invoice_cancel": $result = $Payqr_invoice->invoice_cancel($id); break; case "invoice_revert": $result = $Payqr_invoice->invoice_revert($id, $amount); break; case "invoice_confirm": $result = $Payqr_invoice->invoice_confirm($id); break; case "invoice_message": $result = $Payqr_invoice->invoice_message($id, $_POST["message_text"], $_POST["message_image_url"], $_POST["message_url"]); break; case "get_revert": $result = $Payqr_revert->get_revert($revertId);