<?php
/**
 * Test different endpoint combinations for ashof.paymently.io
 */
require_once 'config/database.php';
require_once 'config/uddoktapay.php';

echo "Testing different endpoint combinations for ashof.paymently.io...\n\n";

$base_url = 'https://ashof.paymently.io/api';

// Test different verification endpoints
$endpoints = [
    '/verify-payment',
    '/payment/verify',
    '/api/verify-payment',
    '/api/payment/verify',
    '/v1/verify-payment',
    '/api/v1/verify-payment',
    '/verify',
    '/payment-verify'
];

foreach ($endpoints as $endpoint) {
    $url = rtrim($base_url, '/') . '/' . ltrim($endpoint, '/');
    echo "Testing: " . $url . "\n";
    
    // Simple HEAD request to check if endpoint exists
    $ch = curl_init();
    curl_setopt($ch, CURLOPT_URL, $url);
    curl_setopt($ch, CURLOPT_NOBODY, true);
    curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
    curl_setopt($ch, CURLOPT_TIMEOUT, 10);
    curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, false);
    
    $response = curl_exec($ch);
    $httpCode = curl_getinfo($ch, CURLINFO_HTTP_CODE);
    $error = curl_error($ch);
    
    curl_close($ch);
    
    if ($error) {
        echo "  Error: " . $error . "\n";
    } else {
        echo "  HTTP Code: " . $httpCode . "\n";
        if ($httpCode >= 200 && $httpCode < 400) {
            echo "  ✓ Endpoint exists\n";
        } else {
            echo "  ✗ Endpoint not found or error\n";
        }
    }
    echo "\n";
}

echo "Testing complete.\n";
?>