<?php
// Isolated reproduction of the actual local source expression; no application bootstrap or DB.
class helper { public static function bccomp($a, $b, $scale) { return bccomp($a, $b, $scale); } }
$source = file_get_contents(__DIR__ . '/../../../zhctproject/store/application/p/logic/MealOrder.php');
$start = strpos($source, 'public function rejectRefund(');
$end = strpos($source, 'public function agreeRefund(', $start);
$body = substr($source, $start, $end - $start);
if (!preg_match('/\$orderRefundStatus = ([^;]+);/', $body, $match)) { throw new RuntimeException('Source expression missing'); }
foreach ([['0.00', 0], ['5.00', 2], ['22.00', 2]] as [$amount, $expected]) {
    $orderInfo = ['refund_amount' => $amount];
    $actual = eval('return ' . $match[1] . ';');
    if ($actual !== $expected) { throw new RuntimeException('Unexpected reproduction result'); }
    echo "refund_amount=$amount, status=$actual\n";
}
echo "REPRODUCED: fully refunded 22.00 is overwritten as partial on rejection.\n";
