<?php
require_once __DIR__.'/../../config.php';
require_once __DIR__ . '/../../engine/Kernel.php';
require_once __DIR__.'/../../engine/Logger.php';
require_once __DIR__.'/../../engine/ServicePaymentEngine.php';
$ctx = Kernel::handle(['auth' => true]);
$u   = $ctx['user'];
$earnings = ServicePaymentEngine::getProviderEarnings((int)$u['id']);
echo json_encode(['ok'=>true,'data'=>$earnings], JSON_UNESCAPED_UNICODE);
