<?php

header('Content-Type: application/json');

$error = $_GET['error'] ?? 'Bilinmeyen hata';
$errorCode = $_GET['error_code'] ?? 'UNKNOWN_ERROR';
$conversationId = $_GET['conversation_id'] ?? null;

// Log failed payment
error_log("Payment failed - Error: {$error}, Error Code: {$errorCode}, Conversation ID: {$conversationId}");

echo json_encode([
    'success' => false,
    'message' => 'Ödeme işlemi başarısız oldu',
    'error' => $error,
    'error_code' => $errorCode,
    'conversation_id' => $conversationId,
    'timestamp' => date('Y-m-d H:i:s')
]);
