<?php
require_once 'production_config.php';
$mtid = urlencode($_GET['mtid'] ?? '');
$deeplink = APP_DEEPLINK_BASE . '?mtid=' . $mtid;
?>
<!doctype html>
<html>
<head>
  <meta charset="utf-8">
  <title>Returning to app…</title>
  <meta name="viewport" content="width=device-width, initial-scale=1">
  <meta http-equiv="refresh" content="0;url=<?=$deeplink?>">
  <style>
    body{font-family:system-ui,-apple-system,Segoe UI,Roboto,Ubuntu,Helvetica,Arial,sans-serif;padding:24px}
    .card{max-width:520px;margin:auto;padding:20px;border-radius:16px;box-shadow:0 6px 30px rgba(0,0,0,.08)}
    .btn{display:inline-block;margin-top:12px;padding:12px 16px;border-radius:10px;background:#111;color:#fff;text-decoration:none}
    .muted{color:#555}
  </style>
</head>
<body>
  <div class="card">
    <h2>Payment complete — opening app…</h2>
    <p class="muted">If nothing happens, tap the button below.</p>
    <p><a class="btn" href="<?=$deeplink?>">Open in App</a></p>
    <p><a class="btn" href="/production_verify_status.php?merchantTransactionId=<?=$mtid?>">Check Status</a></p>
  </div>
</body>
</html>
