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/check_stephane_stripe_invoices.php
<?php
/**
 * Check Stéphane's Stripe Invoices and Payments
 */

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

$pdo = getDBConnection();
$stripe_secret = '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';

// Get Stéphane's info
$stmt = $pdo->prepare("SELECT id, name, email, stripe_customer_id FROM users WHERE email = ? OR id = 5");
$stmt->execute(['stevenberg450@gmail.com']);
$user = $stmt->fetch(PDO::FETCH_ASSOC);

if (!$user) {
    die("User not found\n");
}

echo "=== Stéphane's Stripe Data ===\n\n";
echo "User ID: {$user['id']}\n";
echo "Email: {$user['email']}\n";
echo "Stripe Customer ID: " . ($user['stripe_customer_id'] ?? 'NOT SET') . "\n\n";

// Get credit purchases from database
echo "=== Credit Purchases in Database ===\n";
$credit_stmt = $pdo->prepare("
    SELECT id, package, credits, amount, payment_intent_id, created_at 
    FROM credit_purchases 
    WHERE user_id = ? 
    ORDER BY created_at DESC
");
$credit_stmt->execute([$user['id']]);
$credit_purchases = $credit_stmt->fetchAll(PDO::FETCH_ASSOC);

echo "Found " . count($credit_purchases) . " credit purchases:\n";
foreach ($credit_purchases as $p) {
    echo "  - ID: {$p['id']}, Package: {$p['package']}, Credits: {$p['credits']}, Amount: \${$p['amount']}, Payment Intent: " . ($p['payment_intent_id'] ?? 'N/A') . ", Date: {$p['created_at']}\n";
}
echo "\n";

if (empty($user['stripe_customer_id'])) {
    echo "⚠️  No Stripe Customer ID - cannot fetch Stripe invoices\n";
    exit;
}

// Get all Stripe invoices
echo "=== Stripe Invoices ===\n";
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, 'https://api.stripe.com/v1/invoices?customer=' . urlencode($user['stripe_customer_id']) . '&limit=100');
curl_setopt($ch, CURLOPT_HTTPHEADER, ['Authorization: Bearer ' . $stripe_secret]);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
$response = curl_exec($ch);
$http_code = curl_getinfo($ch, CURLINFO_HTTP_CODE);
curl_close($ch);

if ($http_code === 200) {
    $data = json_decode($response, true);
    $invoices = $data['data'] ?? [];
    echo "Found " . count($invoices) . " Stripe invoices:\n";
    foreach ($invoices as $inv) {
        $date = date('Y-m-d H:i:s', $inv['created']);
        $amount = number_format($inv['amount_paid'] / 100, 2);
        echo "  - Invoice: {$inv['id']}, Number: {$inv['number']}, Amount: \${$amount}, Status: {$inv['status']}, Date: {$date}\n";
        if (!empty($inv['payment_intent'])) {
            echo "    Payment Intent: {$inv['payment_intent']}\n";
        }
    }
} else {
    echo "Error fetching invoices: HTTP {$http_code}\n";
    echo "Response: {$response}\n";
}
echo "\n";

// Get all payment intents
echo "=== Stripe Payment Intents ===\n";
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, 'https://api.stripe.com/v1/payment_intents?customer=' . urlencode($user['stripe_customer_id']) . '&limit=100');
curl_setopt($ch, CURLOPT_HTTPHEADER, ['Authorization: Bearer ' . $stripe_secret]);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
$response = curl_exec($ch);
$http_code = curl_getinfo($ch, CURLINFO_HTTP_CODE);
curl_close($ch);

if ($http_code === 200) {
    $data = json_decode($response, true);
    $payment_intents = $data['data'] ?? [];
    echo "Found " . count($payment_intents) . " payment intents:\n";
    foreach ($payment_intents as $pi) {
        $date = date('Y-m-d H:i:s', $pi['created']);
        $amount = number_format($pi['amount'] / 100, 2);
        echo "  - Payment Intent: {$pi['id']}, Amount: \${$amount}, Status: {$pi['status']}, Date: {$date}\n";
    }
} else {
    echo "Error fetching payment intents: HTTP {$http_code}\n";
}
echo "\n";

// Get all charges
echo "=== Stripe Charges ===\n";
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, 'https://api.stripe.com/v1/charges?customer=' . urlencode($user['stripe_customer_id']) . '&limit=100');
curl_setopt($ch, CURLOPT_HTTPHEADER, ['Authorization: Bearer ' . $stripe_secret]);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
$response = curl_exec($ch);
$http_code = curl_getinfo($ch, CURLINFO_HTTP_CODE);
curl_close($ch);

if ($http_code === 200) {
    $data = json_decode($response, true);
    $charges = $data['data'] ?? [];
    echo "Found " . count($charges) . " charges:\n";
    foreach ($charges as $charge) {
        $date = date('Y-m-d H:i:s', $charge['created']);
        $amount = number_format($charge['amount'] / 100, 2);
        echo "  - Charge: {$charge['id']}, Amount: \${$amount}, Status: {$charge['status']}, Date: {$date}\n";
        if (!empty($charge['payment_intent'])) {
            echo "    Payment Intent: {$charge['payment_intent']}\n";
        }
    }
} else {
    echo "Error fetching charges: HTTP {$http_code}\n";
}

echo "\n=== Summary ===\n";
echo "Database credit purchases: " . count($credit_purchases) . "\n";
echo "Stripe invoices: " . (isset($invoices) ? count($invoices) : 0) . "\n";
echo "Stripe payment intents: " . (isset($payment_intents) ? count($payment_intents) : 0) . "\n";
echo "Stripe charges: " . (isset($charges) ? count($charges) : 0) . "\n";

CasperSecurity Mini