Skip to content

Commit

Permalink
Create main.html
Browse files Browse the repository at this point in the history
  • Loading branch information
dvalenca authored Sep 29, 2024
0 parents commit 140e37b
Showing 1 changed file with 37 additions and 0 deletions.
37 changes: 37 additions & 0 deletions main.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
<!-- pagamento.html -->
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<title>Pagamento</title>
<script src="https://telegram.org/js/telegram-web-app.js"></script>
</head>
<body>
<h1>Processo de Pagamento</h1>
<!-- Sua interface aqui -->
<script>
// Inicialização
const tg = window.Telegram.WebApp;
tg.expand(); // Expande o MiniApp para tela cheia

// Exemplo de uso do MainButton
tg.MainButton.text = "Enviar Solicitação de Pagamento";
tg.MainButton.show();

// Evento de clique no MainButton
tg.MainButton.onClick(() => {
// Coleta de dados do formulário
const dadosPagamento = {
projeto: "Projeto X",
rubrica: "Rubrica Y",
valor: 1000,
descricao: "Descrição do pagamento",
fornecedor: "Fornecedor Z"
};

// Envia os dados para o bot e fecha o MiniApp
tg.sendData(JSON.stringify(dadosPagamento));
});
</script>
</body>
</html>

0 comments on commit 140e37b

Please sign in to comment.