mirror of
https://github.com/myronblair/tomtomgames
synced 2026-06-30 17:51:08 -05:00
18 lines
574 B
PHP
18 lines
574 B
PHP
<?php
|
|
require_once __DIR__ . '/../../includes/auth.php';
|
|
header('Content-Type: application/json');
|
|
|
|
if (!isLoggedIn()) { echo json_encode(['success'=>false,'error'=>'Not authenticated']); exit; }
|
|
|
|
$userId = $_SESSION['user_id'];
|
|
$stmt = db()->prepare("
|
|
SELECT id, tokens, amount_cents, payment_method, platform_id, game_alias,
|
|
card_brand, card_last4, status, created_at
|
|
FROM token_purchases
|
|
WHERE user_id = ?
|
|
ORDER BY created_at DESC
|
|
LIMIT 20
|
|
");
|
|
$stmt->execute([$userId]);
|
|
echo json_encode(['success'=>true, 'purchases'=>$stmt->fetchAll()]);
|