<?php
$pageTitle   = $pageTitle   ?? 'FamAPI - #1 FamPay UPI Payment Gateway & Automated QR API India';
$metaDesc    = $metaDesc    ?? 'Accept FamPay & UPI payments on your website, bot, or app with zero commission. Instant automated verification, 2-call REST API, AES-256 encryption. Trusted by 5,000+ developers in India.';
$metaKeywords= $metaKeywords?? 'FamPay API, FamAPI, FamPay UPI Gateway, UPI Payment API India, FamPay QR Generator, Automated Payment Verification, Zero Commission Payment Gateway, FamPay Bot Integration, Telegram Bot Payment Gateway';
$bodyClass   = $bodyClass   ?? '';
$noIndex     = $noIndex     ?? false;
$canonical   = $canonical   ?? '';
$ogImage     = $ogImage     ?? 'assets/img/og-cover.svg';
$schemaOrg   = $schemaOrg   ?? '';
$base = getBaseUrl();
$path = strtok($_SERVER['REQUEST_URI'] ?? '/', '?');
if ($canonical === '') $canonical = $base . $path;
$loggedIn = function_exists('isLoggedIn') ? isLoggedIn() : false;
?>
<!DOCTYPE html>
<html lang="en-IN" class="js">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=5.0">
<title><?= htmlspecialchars($pageTitle) ?></title>
<meta name="description" content="<?= htmlspecialchars($metaDesc) ?>">
<meta name="keywords" content="<?= htmlspecialchars($metaKeywords) ?>">
<meta name="robots" content="<?= $noIndex ? 'noindex,nofollow' : 'index,follow,max-image-preview:large,max-snippet:-1,max-video-preview:-1' ?>">
<link rel="canonical" href="<?= htmlspecialchars($canonical) ?>">
<meta name="theme-color" content="#a370fc">
<meta name="author" content="AdityaHost FamAPI">
<meta name="publisher" content="AdityaHost Enterprise">
<link rel="icon" type="image/x-icon" href="favicon.ico">
<link rel="icon" type="image/png" sizes="32x32" href="favicon-32x32.png">
<link rel="icon" type="image/png" sizes="16x16" href="favicon-16x16.png">
<link rel="apple-touch-icon" sizes="180x180" href="apple-touch-icon.png">
<link rel="manifest" href="site.webmanifest">

<!-- Open Graph / Facebook / WhatsApp -->
<meta property="og:type" content="website">
<meta property="og:site_name" content="FamAPI by AdityaHost">
<meta property="og:title" content="<?= htmlspecialchars($pageTitle) ?>">
<meta property="og:description" content="<?= htmlspecialchars($metaDesc) ?>">
<meta property="og:url" content="<?= htmlspecialchars($canonical) ?>">
<meta property="og:image" content="<?= htmlspecialchars($base . '/' . ltrim($ogImage, '/')) ?>">
<meta property="og:image:width" content="1200">
<meta property="og:image:height" content="630">
<meta property="og:locale" content="en_IN">

<!-- Twitter Cards -->
<meta name="twitter:card" content="summary_large_image">
<meta name="twitter:site" content="@adityahost">
<meta name="twitter:creator" content="@adityahost">
<meta name="twitter:title" content="<?= htmlspecialchars($pageTitle) ?>">
<meta name="twitter:description" content="<?= htmlspecialchars($metaDesc) ?>">
<meta name="twitter:image" content="<?= htmlspecialchars($base . '/' . ltrim($ogImage, '/')) ?>">

<!-- Geo & Target Optimization for India -->
<meta name="geo.region" content="IN">
<meta name="geo.placename" content="India">

<!-- Google Fonts & FontAwesome -->
<link rel="preconnect" href="https://fonts.googleapis.com">
<link rel="preconnect" href="https://fonts.gstatic.com" crossorigin>
<link href="https://fonts.googleapis.com/css2?family=Plus+Jakarta+Sans:wght@400;500;600;700;800&family=Space+Grotesk:wght@600;700&family=JetBrains+Mono:wght@500;600&display=swap" rel="stylesheet">
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.5.1/css/all.min.css">
<link rel="stylesheet" href="assets/site.css?v=8">

<!-- Primary Organization & Software Schema -->
<script type="application/ld+json">
{
  "@context": "https://schema.org",
  "@type": "Organization",
  "name": "AdityaHost",
  "url": "<?= htmlspecialchars($base) ?>",
  "logo": "<?= htmlspecialchars($base . '/assets/img/logo.png') ?>",
  "description": "AdityaHost builds FamAPI — India's leading FamPay UPI payment verification API for developers, creators and small businesses.",
  "foundingDate": "2025",
  "address": {
    "@type": "PostalAddress",
    "addressCountry": "IN"
  },
  "contactPoint": {
    "@type": "ContactPoint",
    "contactType": "customer support",
    "email": "support@adityahost.in",
    "availableLanguage": ["English", "Hindi"]
  },
  "sameAs": [],
  "hasOfferCatalog": {
    "@type": "OfferCatalog",
    "name": "FamAPI Plans",
    "itemListElement": [
      { "@type": "Offer", "name": "Free Plan", "price": "0", "priceCurrency": "INR" },
      { "@type": "Offer", "name": "Basic Plan", "price": "99", "priceCurrency": "INR" }
    ]
  }
}
</script>
<script type="application/ld+json">
{
  "@context": "https://schema.org",
  "@type": "SoftwareApplication",
  "name": "FamAPI",
  "operatingSystem": "All",
  "applicationCategory": "DeveloperApplication",
  "url": "<?= htmlspecialchars($base) ?>",
  "offers": {
    "@type": "AggregateOffer",
    "lowPrice": "0",
    "highPrice": "499",
    "priceCurrency": "INR",
    "offerCount": "4"
  },
  "aggregateRating": {
    "@type": "AggregateRating",
    "ratingValue": "4.9",
    "reviewCount": "3420",
    "bestRating": "5"
  },
  "author": {
    "@type": "Organization",
    "name": "AdityaHost",
    "url": "<?= htmlspecialchars($base) ?>"
  }
}
</script>
<script type="application/ld+json">
{
  "@context": "https://schema.org",
  "@type": "WebSite",
  "name": "AdityaHost FamAPI",
  "url": "<?= htmlspecialchars($base) ?>",
  "potentialAction": {
    "@type": "SearchAction",
    "target": "<?= htmlspecialchars($base) ?>/blog.php?q={search_term_string}",
    "query-input": "required name=search_term_string"
  }
}
</script>
<?= $schemaOrg ?>
</head>
<body class="<?= htmlspecialchars($bodyClass) ?>">

<!-- TRUST BADGE -->
<div class="trust-badge" role="banner">
  <div class="trust-content">
    <span class="trust-label">✓ VERIFIED</span>
    <span>✅ <strong>Trusted & Official</strong> — <a href="https://adityahost.in">adityahost.in</a> & <a href="https://fampay.adityahost.in">fampay.adityahost.in</a> are the only genuine domains.</span>
    <span class="trust-note">You can trust us</span>
    <a href="blog-post.php?slug=scam-warning-fake-domains" class="trust-link">Avoid Fake Sites →</a>
  </div>
</div>

<?php include __DIR__ . '/nav.php'; ?>