Spaces:
Running
Running
interbanco brazil pix payment reciept generator
Browse files- index.html +5 -2
- pix.html +325 -0
index.html
CHANGED
|
@@ -44,9 +44,12 @@
|
|
| 44 |
<header class="flex flex-col items-center mb-8">
|
| 45 |
<h1 class="text-3xl font-bold text-primary mb-2">BankSlip Bot</h1>
|
| 46 |
<p class="text-gray-600">Generate professional interbank receipts</p>
|
|
|
|
|
|
|
|
|
|
|
|
|
| 47 |
</header>
|
| 48 |
-
|
| 49 |
-
<!-- Main Content -->
|
| 50 |
<main class="flex flex-col lg:flex-row gap-8">
|
| 51 |
<!-- Form Section -->
|
| 52 |
<div class="w-full lg:w-1/2 bg-white rounded-xl shadow-md p-6">
|
|
|
|
| 44 |
<header class="flex flex-col items-center mb-8">
|
| 45 |
<h1 class="text-3xl font-bold text-primary mb-2">BankSlip Bot</h1>
|
| 46 |
<p class="text-gray-600">Generate professional interbank receipts</p>
|
| 47 |
+
<div class="mt-4 flex gap-4">
|
| 48 |
+
<a href="index.html" class="px-4 py-2 bg-primary text-white rounded-md">International</a>
|
| 49 |
+
<a href="pix.html" class="px-4 py-2 bg-pix text-white rounded-md">PIX Brasil</a>
|
| 50 |
+
</div>
|
| 51 |
</header>
|
| 52 |
+
<!-- Main Content -->
|
|
|
|
| 53 |
<main class="flex flex-col lg:flex-row gap-8">
|
| 54 |
<!-- Form Section -->
|
| 55 |
<div class="w-full lg:w-1/2 bg-white rounded-xl shadow-md p-6">
|
pix.html
ADDED
|
@@ -0,0 +1,325 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
<!DOCTYPE html>
|
| 2 |
+
<html lang="pt-br">
|
| 3 |
+
<head>
|
| 4 |
+
<meta charset="UTF-8">
|
| 5 |
+
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
| 6 |
+
<title>BankSlip Bot - PIX Receipt Generator</title>
|
| 7 |
+
<link rel="icon" type="image/x-icon" href="/static/favicon.ico">
|
| 8 |
+
<script src="https://cdn.tailwindcss.com"></script>
|
| 9 |
+
<script src="https://cdn.jsdelivr.net/npm/feather-icons/dist/feather.min.js"></script>
|
| 10 |
+
<script>
|
| 11 |
+
tailwind.config = {
|
| 12 |
+
theme: {
|
| 13 |
+
extend: {
|
| 14 |
+
colors: {
|
| 15 |
+
primary: '#2563eb',
|
| 16 |
+
secondary: '#7c3aed',
|
| 17 |
+
pix: '#32BCAD'
|
| 18 |
+
}
|
| 19 |
+
}
|
| 20 |
+
}
|
| 21 |
+
}
|
| 22 |
+
</script>
|
| 23 |
+
<style>
|
| 24 |
+
.receipt-paper {
|
| 25 |
+
background-image: linear-gradient(to bottom, #f9f9f9 1px, transparent 1px);
|
| 26 |
+
background-size: 100% 24px;
|
| 27 |
+
box-shadow: 0 4px 20px rgba(0,0,0,0.08);
|
| 28 |
+
}
|
| 29 |
+
.perforation {
|
| 30 |
+
background: repeating-linear-gradient(180deg, #e5e7eb, #e5e7eb 10px, transparent 10px, transparent 20px);
|
| 31 |
+
}
|
| 32 |
+
.pix-logo {
|
| 33 |
+
filter: brightness(0) saturate(100%) invert(68%) sepia(45%) saturate(508%) hue-rotate(122deg) brightness(92%) contrast(90%);
|
| 34 |
+
}
|
| 35 |
+
.watermark {
|
| 36 |
+
opacity: 0.05;
|
| 37 |
+
pointer-events: none;
|
| 38 |
+
}
|
| 39 |
+
.qr-placeholder {
|
| 40 |
+
background: linear-gradient(135deg, #f3f4f6 25%, #e5e7eb 25%, #e5e7eb 50%, #f3f4f6 50%, #f3f4f6 75%, #e5e7eb 75%, #e5e7eb 100%);
|
| 41 |
+
background-size: 40px 40px;
|
| 42 |
+
}
|
| 43 |
+
</style>
|
| 44 |
+
</head>
|
| 45 |
+
<body class="bg-gray-50 min-h-screen">
|
| 46 |
+
<div class="container mx-auto py-12 px-4">
|
| 47 |
+
<header class="flex flex-col items-center mb-8">
|
| 48 |
+
<h1 class="text-3xl font-bold text-primary mb-2">BankSlip Bot</h1>
|
| 49 |
+
<p class="text-gray-600">Gerador de comprovante PIX</p>
|
| 50 |
+
</header>
|
| 51 |
+
|
| 52 |
+
<main class="flex flex-col lg:flex-row gap-8">
|
| 53 |
+
<!-- Form Section -->
|
| 54 |
+
<div class="w-full lg:w-1/2 bg-white rounded-xl shadow-md p-6">
|
| 55 |
+
<h2 class="text-xl font-semibold text-gray-800 mb-6">Dados do PIX</h2>
|
| 56 |
+
|
| 57 |
+
<form id="pixForm" class="space-y-4">
|
| 58 |
+
<!-- Pagador Section -->
|
| 59 |
+
<div>
|
| 60 |
+
<h3 class="text-md font-medium text-gray-700 mb-2 flex items-center">
|
| 61 |
+
<i data-feather="user" class="w-4 h-4 mr-2"></i> Dados do Pagador
|
| 62 |
+
</h3>
|
| 63 |
+
<div class="grid grid-cols-1 md:grid-cols-2 gap-4">
|
| 64 |
+
<div>
|
| 65 |
+
<label class="block text-sm font-medium text-gray-700 mb-1">Nome Completo</label>
|
| 66 |
+
<input type="text" id="payerName" required
|
| 67 |
+
class="w-full px-3 py-2 border border-gray-300 rounded-md focus:outline-none focus:ring-2 focus:ring-primary focus:border-transparent">
|
| 68 |
+
</div>
|
| 69 |
+
<div>
|
| 70 |
+
<label class="block text-sm font-medium text-gray-700 mb-1">CPF/CNPJ</label>
|
| 71 |
+
<input type="text" id="payerId" required
|
| 72 |
+
class="w-full px-3 py-2 border border-gray-300 rounded-md focus:outline-none focus:ring-2 focus:ring-primary focus:border-transparent">
|
| 73 |
+
</div>
|
| 74 |
+
</div>
|
| 75 |
+
</div>
|
| 76 |
+
|
| 77 |
+
<!-- Payment Section -->
|
| 78 |
+
<div>
|
| 79 |
+
<h3 class="text-md font-medium text-gray-700 mb-2 flex items-center">
|
| 80 |
+
<i data-feather="dollar-sign" class="w-4 h-4 mr-2"></i> Dados do Pagamento
|
| 81 |
+
</h3>
|
| 82 |
+
<div class="grid grid-cols-1 md:grid-cols-2 gap-4">
|
| 83 |
+
<div>
|
| 84 |
+
<label class="block text-sm font-medium text-gray-700 mb-1">Valor (R$)</label>
|
| 85 |
+
<input type="number" id="amount" step="0.01" required
|
| 86 |
+
class="w-full px-3 py-2 border border-gray-300 rounded-md focus:outline-none focus:ring-2 focus:ring-primary focus:border-transparent">
|
| 87 |
+
</div>
|
| 88 |
+
<div>
|
| 89 |
+
<label class="block text-sm font-medium text-gray-700 mb-1">Chave PIX</label>
|
| 90 |
+
<select id="pixType" required
|
| 91 |
+
class="w-full px-3 py-2 border border-gray-300 rounded-md focus:outline-none focus:ring-2 focus:ring-primary focus:border-transparent">
|
| 92 |
+
<option value="CPF">CPF</option>
|
| 93 |
+
<option value="CNPJ">CNPJ</option>
|
| 94 |
+
<option value="Celular">Celular</option>
|
| 95 |
+
<option value="Email">E-mail</option>
|
| 96 |
+
<option value="Aleatoria">Aleatória</option>
|
| 97 |
+
</select>
|
| 98 |
+
</div>
|
| 99 |
+
</div>
|
| 100 |
+
<div class="mt-4">
|
| 101 |
+
<label class="block text-sm font-medium text-gray-700 mb-1">Identificador</label>
|
| 102 |
+
<input type="text" id="pixKey" required
|
| 103 |
+
class="w-full px-3 py-2 border border-gray-300 rounded-md focus:outline-none focus:ring-2 focus:ring-primary focus:border-transparent">
|
| 104 |
+
</div>
|
| 105 |
+
<div class="mt-4">
|
| 106 |
+
<label class="block text-sm font-medium text-gray-700 mb-1">Descrição</label>
|
| 107 |
+
<input type="text" id="description"
|
| 108 |
+
class="w-full px-3 py-2 border border-gray-300 rounded-md focus:outline-none focus:ring-2 focus:ring-primary focus:border-transparent">
|
| 109 |
+
</div>
|
| 110 |
+
</div>
|
| 111 |
+
|
| 112 |
+
<!-- Bank Details -->
|
| 113 |
+
<div>
|
| 114 |
+
<h3 class="text-md font-medium text-gray-700 mb-2 flex items-center">
|
| 115 |
+
<i data-feather="bank" class="w-4 h-4 mr-2"></i> Dados Bancários
|
| 116 |
+
</h3>
|
| 117 |
+
<div class="grid grid-cols-1 md:grid-cols-2 gap-4">
|
| 118 |
+
<div>
|
| 119 |
+
<label class="block text-sm font-medium text-gray-700 mb-1">Banco</label>
|
| 120 |
+
<select id="bankName" required
|
| 121 |
+
class="w-full px-3 py-2 border border-gray-300 rounded-md focus:outline-none focus:ring-2 focus:ring-primary focus:border-transparent">
|
| 122 |
+
<option value="Banco do Brasil">Banco do Brasil</option>
|
| 123 |
+
<option value="Bradesco">Bradesco</option>
|
| 124 |
+
<option value="Itaú">Itaú</option>
|
| 125 |
+
<option value="Santander">Santander</option>
|
| 126 |
+
<option value="Caixa">Caixa Econômica</option>
|
| 127 |
+
<option value="Nubank">Nubank</option>
|
| 128 |
+
<option value="Inter">Banco Inter</option>
|
| 129 |
+
</select>
|
| 130 |
+
</div>
|
| 131 |
+
<div>
|
| 132 |
+
<label class="block text-sm font-medium text-gray-700 mb-1">Tipo de Conta</label>
|
| 133 |
+
<select id="accountType" required
|
| 134 |
+
class="w-full px-3 py-2 border border-gray-300 rounded-md focus:outline-none focus:ring-2 focus:ring-primary focus:border-transparent">
|
| 135 |
+
<option value="Conta Corrente">Conta Corrente</option>
|
| 136 |
+
<option value="Conta Poupança">Conta Poupança</option>
|
| 137 |
+
<option value="Conta Salário">Conta Salário</option>
|
| 138 |
+
</select>
|
| 139 |
+
</div>
|
| 140 |
+
</div>
|
| 141 |
+
</div>
|
| 142 |
+
|
| 143 |
+
<div class="pt-4">
|
| 144 |
+
<button type="submit" class="w-full bg-pix hover:bg-green-600 text-white font-medium py-2 px-4 rounded-md transition duration-300">
|
| 145 |
+
Gerar Comprovante
|
| 146 |
+
</button>
|
| 147 |
+
</div>
|
| 148 |
+
</form>
|
| 149 |
+
</div>
|
| 150 |
+
|
| 151 |
+
<!-- Preview Section -->
|
| 152 |
+
<div class="w-full lg:w-1/2 flex flex-col">
|
| 153 |
+
<div class="bg-white rounded-xl shadow-md overflow-hidden mb-4">
|
| 154 |
+
<div class="perforation h-6 w-full"></div>
|
| 155 |
+
<div id="pixPreview" class="receipt-paper p-8 relative">
|
| 156 |
+
<div class="watermark absolute inset-0 flex items-center justify-center font-bold text-6xl text-gray-300 -rotate-45">
|
| 157 |
+
PIX
|
| 158 |
+
</div>
|
| 159 |
+
|
| 160 |
+
<div class="relative z-10">
|
| 161 |
+
<!-- Header -->
|
| 162 |
+
<div class="flex justify-between items-start mb-8">
|
| 163 |
+
<div>
|
| 164 |
+
<h2 class="text-2xl font-bold text-pix">COMPROVANTE PIX</h2>
|
| 165 |
+
<p class="text-gray-500 text-sm">Transação #<span id="previewId">PIX-12345</span></p>
|
| 166 |
+
</div>
|
| 167 |
+
<div class="text-right">
|
| 168 |
+
<p class="text-gray-600 text-sm">Data: <span id="previewDate">DD/MM/YYYY</span></p>
|
| 169 |
+
<p class="text-gray-600 text-sm">Hora: <span id="previewTime">HH:MM</span></p>
|
| 170 |
+
</div>
|
| 171 |
+
</div>
|
| 172 |
+
|
| 173 |
+
<!-- QR Code -->
|
| 174 |
+
<div class="flex flex-col items-center mb-8">
|
| 175 |
+
<div class="qr-placeholder w-48 h-48 mb-4 flex items-center justify-center">
|
| 176 |
+
<img src="https://api.qrserver.com/v1/create-qr-code/?size=150x150&data=PIXEXAMPLE" id="qrCode" class="w-full h-full">
|
| 177 |
+
</div>
|
| 178 |
+
<div class="text-center">
|
| 179 |
+
<p class="text-sm text-gray-600 mb-1">Chave PIX: <span id="previewPixKey">123.456.789-09</span></p>
|
| 180 |
+
<p class="text-sm text-gray-600">Tipo: <span id="previewPixType">CPF</span></p>
|
| 181 |
+
</div>
|
| 182 |
+
</div>
|
| 183 |
+
|
| 184 |
+
<!-- Payer Info -->
|
| 185 |
+
<div class="mb-6">
|
| 186 |
+
<h4 class="text-sm font-semibold text-gray-500 uppercase tracking-wider mb-2">Pagador</h4>
|
| 187 |
+
<p class="font-medium" id="previewPayer">Nome do Pagador</p>
|
| 188 |
+
<p class="text-gray-600 text-sm" id="previewPayerId">CPF/CNPJ: 123.456.789-09</p>
|
| 189 |
+
</div>
|
| 190 |
+
|
| 191 |
+
<!-- Payment Details -->
|
| 192 |
+
<div class="mb-6">
|
| 193 |
+
<h4 class="text-sm font-semibold text-gray-500 uppercase tracking-wider mb-2">Pagamento</h4>
|
| 194 |
+
<div class="flex justify-between py-2 border-b border-gray-200">
|
| 195 |
+
<span class="text-gray-600">Valor:</span>
|
| 196 |
+
<span class="font-bold" id="previewAmount">R$ 1.000,00</span>
|
| 197 |
+
</div>
|
| 198 |
+
<div class="flex justify-between py-2 border-b border-gray-200">
|
| 199 |
+
<span class="text-gray-600">Descrição:</span>
|
| 200 |
+
<span class="font-medium" id="previewDescription">Pagamento de serviço</span>
|
| 201 |
+
</div>
|
| 202 |
+
</div>
|
| 203 |
+
|
| 204 |
+
<!-- Bank Info -->
|
| 205 |
+
<div class="mb-6">
|
| 206 |
+
<h4 class="text-sm font-semibold text-gray-500 uppercase tracking-wider mb-2">Banco Destino</h4>
|
| 207 |
+
<div class="flex items-center">
|
| 208 |
+
<div class="mr-4">
|
| 209 |
+
<div class="pix-logo bg-gray-200 w-12 h-12 rounded flex items-center justify-center">
|
| 210 |
+
<i data-feather="dollar-sign" class="w-6 h-6 text-pix"></i>
|
| 211 |
+
</div>
|
| 212 |
+
</div>
|
| 213 |
+
<div>
|
| 214 |
+
<p class="font-medium" id="previewBank">Banco</p>
|
| 215 |
+
<p class="text-gray-600 text-sm" id="previewAccountType">Tipo: Conta Corrente</p>
|
| 216 |
+
</div>
|
| 217 |
+
</div>
|
| 218 |
+
</div>
|
| 219 |
+
|
| 220 |
+
<!-- Status -->
|
| 221 |
+
<div class="mt-8 pt-4 border-t border-gray-200">
|
| 222 |
+
<div class="flex justify-between items-center">
|
| 223 |
+
<div class="text-sm text-gray-500">
|
| 224 |
+
<p>Status:</p>
|
| 225 |
+
<p class="font-medium mt-2 text-green-600">Pagamento concluído</p>
|
| 226 |
+
</div>
|
| 227 |
+
<div class="flex items-center">
|
| 228 |
+
<div class="mr-2 h-8 w-8 bg-gray-200 rounded-full flex items-center justify-center">
|
| 229 |
+
<i data-feather="check" class="w-4 h-4 text-green-500"></i>
|
| 230 |
+
</div>
|
| 231 |
+
<span class="text-sm text-gray-600">Confirmado</span>
|
| 232 |
+
</div>
|
| 233 |
+
</div>
|
| 234 |
+
</div>
|
| 235 |
+
</div>
|
| 236 |
+
</div>
|
| 237 |
+
<div class="perforation h-6 w-full"></div>
|
| 238 |
+
</div>
|
| 239 |
+
|
| 240 |
+
<!-- Actions -->
|
| 241 |
+
<div class="flex gap-4">
|
| 242 |
+
<button id="downloadPixBtn" class="flex-1 bg-white border border-gray-300 hover:bg-gray-50 text-gray-700 font-medium py-2 px-4 rounded-md transition duration-300 flex items-center justify-center gap-2 opacity-50 cursor-not-allowed" disabled>
|
| 243 |
+
<i data-feather="download" class="w-4 h-4"></i>
|
| 244 |
+
Baixar PDF
|
| 245 |
+
</button>
|
| 246 |
+
<button id="printPixBtn" class="flex-1 bg-white border border-gray-300 hover:bg-gray-50 text-gray-700 font-medium py-2 px-4 rounded-md transition duration-300 flex items-center justify-center gap-2">
|
| 247 |
+
<i data-feather="printer" class="w-4 h-4"></i>
|
| 248 |
+
Imprimir
|
| 249 |
+
</button>
|
| 250 |
+
</div>
|
| 251 |
+
</div>
|
| 252 |
+
</main>
|
| 253 |
+
</div>
|
| 254 |
+
|
| 255 |
+
<script>
|
| 256 |
+
document.addEventListener('DOMContentLoaded', function() {
|
| 257 |
+
feather.replace();
|
| 258 |
+
|
| 259 |
+
// Set current date and time
|
| 260 |
+
const now = new Date();
|
| 261 |
+
document.getElementById('previewDate').textContent = now.toLocaleDateString('pt-BR');
|
| 262 |
+
document.getElementById('previewTime').textContent = now.toLocaleTimeString('pt-BR', {hour: '2-digit', minute:'2-digit'});
|
| 263 |
+
|
| 264 |
+
// Generate random transaction ID
|
| 265 |
+
document.getElementById('previewId').textContent = 'PIX-' + Math.floor(Math.random() * 1000000).toString().padStart(6, '0');
|
| 266 |
+
|
| 267 |
+
// Form submission
|
| 268 |
+
document.getElementById('pixForm').addEventListener('submit', function(e) {
|
| 269 |
+
e.preventDefault();
|
| 270 |
+
|
| 271 |
+
// Get form values
|
| 272 |
+
const payerName = document.getElementById('payerName').value;
|
| 273 |
+
const payerId = document.getElementById('payerId').value;
|
| 274 |
+
const amount = parseFloat(document.getElementById('amount').value).toLocaleString('pt-BR', {
|
| 275 |
+
style: 'currency',
|
| 276 |
+
currency: 'BRL'
|
| 277 |
+
});
|
| 278 |
+
const pixType = document.getElementById('pixType').value;
|
| 279 |
+
const pixKey = document.getElementById('pixKey').value;
|
| 280 |
+
const description = document.getElementById('description').value || "Nenhuma descrição fornecida";
|
| 281 |
+
const bankName = document.getElementById('bankName').value;
|
| 282 |
+
const accountType = document.getElementById('accountType').value;
|
| 283 |
+
|
| 284 |
+
// Update preview
|
| 285 |
+
document.getElementById('previewPayer').textContent = payerName;
|
| 286 |
+
document.getElementById('previewPayerId').textContent = `${pixType === 'CPF' ? 'CPF' : 'CNPJ'}: ${formatId(payerId)}`;
|
| 287 |
+
document.getElementById('previewAmount').textContent = amount;
|
| 288 |
+
document.getElementById('previewDescription').textContent = description;
|
| 289 |
+
document.getElementById('previewBank').textContent = bankName;
|
| 290 |
+
document.getElementById('previewAccountType').textContent = `Tipo: ${accountType}`;
|
| 291 |
+
document.getElementById('previewPixType').textContent = pixType;
|
| 292 |
+
document.getElementById('previewPixKey').textContent = pixKey;
|
| 293 |
+
document.getElementById('qrCode').src = `https://api.qrserver.com/v1/create-qr-code/?size=150x150&data=PIX:${pixKey}`;
|
| 294 |
+
|
| 295 |
+
// Enable download button
|
| 296 |
+
document.getElementById('downloadPixBtn').disabled = false;
|
| 297 |
+
document.getElementById('downloadPixBtn').classList.remove('opacity-50', 'cursor-not-allowed');
|
| 298 |
+
|
| 299 |
+
// Scroll to preview
|
| 300 |
+
document.getElementById('pixPreview').scrollIntoView({ behavior: 'smooth' });
|
| 301 |
+
});
|
| 302 |
+
|
| 303 |
+
// Print button
|
| 304 |
+
document.getElementById('printPixBtn').addEventListener('click', function() {
|
| 305 |
+
window.print();
|
| 306 |
+
});
|
| 307 |
+
|
| 308 |
+
// Download button (placeholder functionality)
|
| 309 |
+
document.getElementById('downloadPixBtn').addEventListener('click', function() {
|
| 310 |
+
alert('Geração de PDF seria implementada em ambiente de produção');
|
| 311 |
+
});
|
| 312 |
+
|
| 313 |
+
// Format CPF/CNPJ
|
| 314 |
+
function formatId(id) {
|
| 315 |
+
if (id.length === 11) { // CPF
|
| 316 |
+
return id.replace(/(\d{3})(\d{3})(\d{3})(\d{2})/, '$1.$2.$3-$4');
|
| 317 |
+
} else if (id.length === 14) { // CNPJ
|
| 318 |
+
return id.replace(/(\d{2})(\d{3})(\d{3})(\d{4})(\d{2})/, '$1.$2.$3/$4-$5');
|
| 319 |
+
}
|
| 320 |
+
return id;
|
| 321 |
+
}
|
| 322 |
+
});
|
| 323 |
+
</script>
|
| 324 |
+
</body>
|
| 325 |
+
</html>
|