-
-{% block extra_js %}
-{% if not game.script_code %}
-
-{% endif %}
{% endblock %}
-{% endblock %}
\ No newline at end of file
diff --git a/core/templates/core/purchase.html b/core/templates/core/purchase.html
index 4225c69..dec6b16 100644
--- a/core/templates/core/purchase.html
+++ b/core/templates/core/purchase.html
@@ -1,183 +1,265 @@
{% extends 'base.html' %}
+{% load static %}
{% block content %}
-
-
-
-
{{ game.title }}
-
{{ game.prompt }}
-
-
💳
-
-
Instruções de Aluguel
-
Selecione um plano, clique em "CLICK NO QR", escaneie o código e aguarde 3 minutos para receber seu código de validação.
-
-
-
-
Escolha o tempo de acesso:
-
+
+
+
+
{{ game.title }}
+
Selecione o tempo de jogo desejado para liberar o acesso.
+
+
+
{% for option in options %}
-
-
-
{{ option.title }}
-
R$ {{ option.price }}
+
+
+
+
+
+
+
{{ option.title }}
+
{{ option.description }}
+
R$ {{ option.price }}
+
{{ option.duration_days }} dia(s) de jogo
+
{% endfor %}
-
-
-
-
-
-
🛒
-
Selecione uma opção
-
Escolha um plano ao lado para começar.
-
-
-
-
-
-
-
-
Clique para visualizar os códigos de pagamento
-
-
-
-
-
-
-
-
-
QR CODE 1
+
+
+
+
+
+
+
+
+
+
+
+
-
-
-
+
Para ver os QR Codes e iniciar o pagamento:
+
+
+
+
+
+
+
+ SISTEMA ANTI-FRAUDE ATIVO: O sistema está monitorando a transação. O código de acesso só será liberado se o pagamento for concluído dentro dos 3 minutos.
+
+
+
+
+
+
PAGAMENTO PIX 1
+
+
-
QR CODE 2
+
+
+
PAGAMENTO PIX 2
+
+
+
+
+
+
+
+ Tempo Restante:
+ 03:00
+
+
+
+
+
+
+ Aguardando identificação do pagamento...
+
+
+
+
+
+
-
-
Aguardando confirmação do pagamento...
-
03:00
-
-
+
+
+
+
+
PAGAMENTO CONFIRMADO!
+
Seu código de acesso foi gerado com sucesso pelo sistema inteligente.
+
+
+
Código de Liberação do Jogo
+
000000
+
+
+
-
-
Pagamento Concluído! Seu código de 6 dígitos:
-
-
Copie e cole no campo abaixo para liberar o jogo.
+
+
+
+
+
PAGAMENTO NÃO IDENTIFICADO
+
O tempo de 3 minutos expirou e o sistema não detectou uma transação real. O código gerado é inválido e não dará acesso ao jogo.
+
+
+
Código Inválido Gerado
+
000000
+
+
+
+ O temporizador reiniciará automaticamente em instantes para uma nova tentativa.
+
+
-
-
-
-
-{% block extra_js %}
-
-
-{% endblock %}
{% endblock %}
\ No newline at end of file
diff --git a/core/urls.py b/core/urls.py
index b7cb8c5..50413f5 100644
--- a/core/urls.py
+++ b/core/urls.py
@@ -19,5 +19,7 @@ urlpatterns = [
path('catalog/', views.catalog, name='catalog'),
path('purchase//', views.purchase_game, name='purchase_game'),
path('generate-purchase///', views.generate_purchase, name='generate_purchase'),
+ path('simulate-payment//', views.simulate_payment, name='simulate_payment'),
+ path('verify-payment-status//', views.verify_payment_status, name='verify_payment_status'),
path('play//', views.play_game, name='play_game'),
-]
\ No newline at end of file
+]
diff --git a/core/views.py b/core/views.py
index c7b1bdf..39f62e2 100644
--- a/core/views.py
+++ b/core/views.py
@@ -7,6 +7,7 @@ from django.contrib import messages
from django.utils import timezone
from datetime import timedelta
from django.http import JsonResponse
+from django.views.decorators.csrf import csrf_exempt
from .models import GameProject, UserSession, AdminConfig, RentalOption, UserPurchase
from ai.local_ai_api import LocalAIApi
@@ -40,7 +41,6 @@ def admin_login(request):
def generate_code(request):
if request.method == 'POST':
phone = request.POST.get('phone')
- # Generate 6 digit code for platform access
code = ''.join(random.choices(string.digits, k=6))
while UserSession.objects.filter(access_code=code).exists():
code = ''.join(random.choices(string.digits, k=6))
@@ -67,22 +67,20 @@ def logout(request):
request.session.flush()
return redirect('index')
-# AI Helper - PROGRAMADOR AI AUTOMATIZADO
+# AI Helper - Refined for better functional games
def generate_game_script(prompt, genre):
system_prompt = (
- "You are an expert game developer. Create a complete, single-file HTML/JavaScript/CSS game. "
- "The game MUST be fully functional, self-contained, and playable in a browser iframe. "
- "Use modern JavaScript (ES6+), HTML5 Canvas, or CSS animations. "
- "The game MUST have: "
- "1. A 'Start Game' screen with instructions. "
- "2. Smooth controls (keyboard or touch). "
- "3. A scoring system and a 'Game Over' state with a 'Restart' button. "
- "4. A polished, modern visual style (dark theme preferred). "
- "5. Responsive design to fit any screen size. "
- "Return ONLY the raw source code starting with and ending with