T.ME/BIBIL_0DAY
CasperSecurity


Server : Apache/2
System : Linux server-15-235-50-60 5.15.0-164-generic #174-Ubuntu SMP Fri Nov 14 20:25:16 UTC 2025 x86_64
User : gositeme ( 1004)
PHP Version : 8.2.29
Disable Function : exec,system,passthru,shell_exec,proc_close,proc_open,dl,popen,show_source,posix_kill,posix_mkfifo,posix_getpwuid,posix_setpgid,posix_setsid,posix_setuid,posix_setgid,posix_seteuid,posix_setegid,posix_uname
Directory :  /home/gositeme/domains/soundstudiopro.com/private_html/

Upload File :
current_dir [ Writeable ] document_root [ Writeable ]

 

Current File : /home/gositeme/domains/soundstudiopro.com/private_html/fix_stephane_500_credits.php
<?php
/**
 * Fix Stephane's Missing 500 Credits
 * Adds credits that were purchased but not added due to webhook format issue
 */

require_once __DIR__ . '/config/database.php';
require_once __DIR__ . '/webhooks/stripe.php';

$target_user_id = 5; // Stephane's user ID
$payment_intent_id = 'pi_3SbUdyD0zXLMB4gH1P4poDyJ';
$credits_to_add = 500;
$package = 'premium';

echo "šŸ”§ Fixing Stephane's Missing 500 Credits...\n\n";

try {
    $pdo = getDBConnection();
    
    // Check if credits were already added
    $stmt = $pdo->prepare("
        SELECT id FROM credit_purchases 
        WHERE payment_intent_id = ? AND user_id = ?
    ");
    $stmt->execute([$payment_intent_id, $target_user_id]);
    $existing_purchase = $stmt->fetch();
    
    if ($existing_purchase) {
        echo "āœ… Credits were already added (purchase record exists: ID {$existing_purchase['id']})\n";
        
        // Check current credits
        $stmt = $pdo->prepare("SELECT credits FROM users WHERE id = ?");
        $stmt->execute([$target_user_id]);
        $user = $stmt->fetch(PDO::FETCH_ASSOC);
        
        echo "šŸ“Š Current credits: {$user['credits']}\n";
        echo "āœ… No action needed - credits are already in the system.\n";
        exit(0);
    }
    
    // Get user info
    $stmt = $pdo->prepare("SELECT id, name, email, credits FROM users WHERE id = ?");
    $stmt->execute([$target_user_id]);
    $user = $stmt->fetch(PDO::FETCH_ASSOC);
    
    if (!$user) {
        die("āŒ Error: User not found!\n");
    }
    
    echo "šŸ‘¤ User: {$user['name']} ({$user['email']})\n";
    echo "šŸ’° Current credits: {$user['credits']}\n";
    echo "āž• Adding: {$credits_to_add} credits (Premium package)\n";
    echo "šŸ’³ Payment Intent: {$payment_intent_id}\n\n";
    
    // Add credits using the same function as webhook
    addCreditsToUser($target_user_id, $credits_to_add, $package, '30_days', $payment_intent_id);
    
    // Verify credits were added
    $stmt = $pdo->prepare("SELECT credits FROM users WHERE id = ?");
    $stmt->execute([$target_user_id]);
    $updated_user = $stmt->fetch(PDO::FETCH_ASSOC);
    
    // Check purchase record
    $stmt = $pdo->prepare("SELECT id FROM credit_purchases WHERE payment_intent_id = ? AND user_id = ?");
    $stmt->execute([$payment_intent_id, $target_user_id]);
    $purchase_record = $stmt->fetch();
    
    echo "\nāœ… SUCCESS!\n";
    echo "šŸ“Š New credits: {$updated_user['credits']}\n";
    echo "šŸ’¾ Purchase record created: " . ($purchase_record ? "Yes (ID: {$purchase_record['id']})" : "No") . "\n";
    echo "\nāœ… Stephane's 500 credits have been added successfully!\n";
    
} catch (Exception $e) {
    echo "\nāŒ ERROR: " . $e->getMessage() . "\n";
    echo "Stack trace:\n" . $e->getTraceAsString() . "\n";
    exit(1);
}

CasperSecurity Mini