<?php
// Test script for different scenarios
require_once 'mtn_airtime_working.php';

echo "🧪 === TESTING ALL SCENARIOS === 🧪\n";
echo "📅 Date: 2025-08-29 20:11:06 UTC\n";
echo "👤 User: nede32332 (Isah Tasiu)\n\n";

$airtime = new MTNAirtimeWorking();

$scenarios = [
    [
        'name' => 'SUCCESS Test',
        'phone' => '46733123456',
        'amount' => 10,
        'description' => 'This should complete successfully'
    ],
    [
        'name' => 'FAILED Test', 
        'phone' => '46733123450',
        'amount' => 5,
        'description' => 'This should fail immediately'
    ],
    [
        'name' => 'REJECTED Test',
        'phone' => '46733123451', 
        'amount' => 15,
        'description' => 'This should be rejected by customer'
    ]
];

foreach ($scenarios as $i => $scenario) {
    echo "📋 === TEST " . ($i + 1) . ": {$scenario['name']} === 📋\n";
    echo "📱 Phone: {$scenario['phone']}\n";
    echo "💰 Amount: €{$scenario['amount']}\n";
    echo "📝 Description: {$scenario['description']}\n";
    echo "━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━\n\n";
    
    $result = $airtime->purchaseAirtime($scenario['phone'], $scenario['amount']);
    
    echo "\n📊 Test " . ($i + 1) . " Result: " . ($result['success'] ? '✅ SUCCESS' : '❌ FAILED') . "\n";
    if (!$result['success']) {
        echo "📋 Error: {$result['error']}\n";
    }
    
    echo "\n" . str_repeat("═", 80) . "\n\n";
    
    if ($i < count($scenarios) - 1) {
        echo "⏳ Waiting 10 seconds before next test...\n\n";
        sleep(10);
    }
}

echo "🏁 === ALL TESTS COMPLETED === 🏁\n";
echo "📅 Completed at: " . date('Y-m-d H:i:s') . " UTC\n";
?>