Skip to content

A self-hosted UPI & COD payment gateway with zero per-transaction platform fees, universal JavaScript checkout integration, dynamic QR payments, WhatsApp OTP authentication, and automated payment verification.

JavaScript
42.0 KB
Raw Blame
<!DOCTYPE html>
<html lang="en">
<head>
  <meta charset="UTF-8" />
  <meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=no" />
  <title>YOUPI Store · Enterprise Payment Gateway Suite</title>
  <link rel="preconnect" href="https://fonts.googleapis.com" />
  <link rel="preconnect" href="https://fonts.gstatic.com" crossorigin />
  <!-- OFFICIAL YOUPI PG UNIVERSAL INTEGRATION SCRIPT -->
  <script src="/youpi.js" data-youpi-key="00000000-0000-0000-0000-000000000001" data-currency="INR"></script>
  <!-- MODULAR STORE STYLESHEET -->
  <link rel="stylesheet" href="/css/store.css" />
</head>
<body>

  <!-- TOP ANNOUNCEMENT BAR -->
  <div class="top-announcement">
    <span>✨ <strong>YOUPI Gateway</strong> Demo Powered by YOUPI PG</span>
    <span style="opacity:0.4;">|</span>
    <span>Zero Platform Fees · Direct P2P UPI Settlement</span>
  </div>

  <!-- STICKY MAIN HEADER -->
  <header>
    <div class="header-inner">
      <a href="/" class="brand-group">
        <div class="brand-logo-badge">⚡</div>
        <div class="brand-text">
          <span class="brand-title">YOUPI Store</span>
          <span class="brand-subtitle">Official Payment Gateway Demo</span>
        </div>
      </a>
      <nav class="header-nav">
        <a href="#purchase" class="btn-admin-link">🛒 Buy Demo Pack</a>
        <a href="#outcome-pages" class="btn-admin-link">🚦 Outcome Pages</a>
        <a href="#developer-guide" class="btn-admin-link" style="background:#eff6ff; color:#2563eb; border-color:#bfdbfe;">📖 Developer Guide</a>
        <a href="/openapi.yaml" target="_blank" class="btn-admin-link">⚙️ OpenAPI</a>
        <a href="/wallet" class="btn-admin-link" style="background:#1e293b; color:#ffffff; border-color:#334155;">🪙 Wallet (<span id="topWalletBalance">50</span>)</a>
      </nav>
    </div>
  </header>

  <!-- MAIN E-COMMERCE PRODUCT DETAIL PAGE -->
  <main class="product-showcase-container">
    <div class="pdp-grid">

      <!-- LEFT COLUMN: INTERACTIVE VISUAL GALLERY -->
      <div class="gallery-column" id="gallery">
        <div class="gallery-main-viewport" onclick="openLightbox()" title="Click to view full-resolution screenshot">
          <img id="mainGalleryImg" class="gallery-main-img" src="/assets/gateway_pc_checkout.png?v=2" alt="YOUPI PG Desktop Checkout View" />
          <div class="gallery-zoom-hint">
            <span>🔍</span>
            <span>Click to Enlarge</span>
          </div>
        </div>

        <!-- 5 High-Res Gateway Screenshots Carousel -->
        <div class="thumbnails-grid">
          <div class="thumb-card active" onclick="switchGalleryPhoto(0, '/assets/gateway_pc_checkout.png?v=2', 'Desktop 2-Column Checkout', 'Authentic desktop 2-column checkout frame with real-time dynamic QR, clean card at counter, live order summary, and verified merchant branding.')">
            <img src="/assets/gateway_pc_checkout.png?v=2" alt="PC Checkout" />
          </div>
          <div class="thumb-card" onclick="switchGalleryPhoto(1, '/assets/gateway_mobile_checkout.png?v=2', 'Mobile Instant Sheet &amp; UPI Intent', 'Native fluid mobile checkout bottom sheet with instant UPI app deep-linking (GPay, PhonePe, Paytm, CRED).')">
            <img src="/assets/gateway_mobile_checkout.png?v=2" alt="Mobile Checkout" />
          </div>
          <div class="thumb-card" onclick="switchGalleryPhoto(2, '/assets/gateway_merchant_operations.png?v=2', 'Merchant Operations &amp; Live Slots Hub', 'Crisp bright white operations dashboard with real-time slot allocation, floating cashier till dock, and observers status.')">
            <img src="/assets/gateway_merchant_operations.png?v=2" alt="Operations Hub" />
          </div>
          <div class="thumb-card" onclick="switchGalleryPhoto(3, '/assets/gateway_developer_dark_hub.png?v=2', 'Developer Hub (Real Dark Mode)', 'Authentic obsidian real dark mode with multi-service supervisor, live host ports, and aggregate streaming terminal.')">
            <img src="/assets/gateway_developer_dark_hub.png?v=2" alt="Developer Hub" />
          </div>
          <div class="thumb-card" onclick="switchGalleryPhoto(4, '/assets/gateway_whitelabel_customizer.png?v=2', 'White-Label Customizer &amp; Mockup', 'Live smartphone reflection with instant brand logo, custom color palette, trust seals, and conversion banners.')">
            <img src="/assets/gateway_whitelabel_customizer.png?v=2" alt="White-Label Customizer" />
          </div>
        </div>
      </div>

      <!-- RIGHT COLUMN: PRODUCT BUY BOX FIRST (PRIORITIZED DEMO), THEN CONTENT BELOW IT -->
      <div class="details-column">
        <div class="product-header-block">
          <h1 class="product-h1">YOUPI PG — Small Scale Self-Hosted UPI Payment Gateway</h1>
          <p style="color:var(--text-muted); font-size:0.92rem; margin-top:0.35rem; font-weight:600;">
            Direct-to-bank sovereign settlement. Test live checkout with zero intermediary fees.
          </p>
        </div>

        <!-- THE BUY BOX CARD: PRIORITIZED FIRST -->
        <div class="buy-box-card" id="purchase">
          <div class="pricing-header">
            <div>
              <span style="font-size:0.8rem; font-weight:700; color:var(--text-muted); text-transform:uppercase;">Live Demo Checkout Price</span>
              <div class="price-main" id="displayPrice">₹1.00</div>
            </div>
            <span class="price-badge-demo">1-Tap Live Checkout</span>
          </div>

          <p class="pricing-note">
            Test real end-to-end payment gateway execution. Default is <strong>₹1.00</strong> for instant testing, or select/type any custom amount:
          </p>

          <!-- Quick Preset Chips -->
          <div class="amount-selector-title">
            <span>Quick Select Test Amount</span>
          </div>
          <div class="amount-selector-chips">
            <button type="button" class="chip-btn active" onclick="selectAmount(1.00, this)">₹1 (Demo)</button>
            <button type="button" class="chip-btn" onclick="selectAmount(10.00, this)">₹10</button>
            <button type="button" class="chip-btn" onclick="selectAmount(100.00, this)">₹100</button>
            <button type="button" class="chip-btn" onclick="selectAmount(499.00, this)">₹499</button>
            <button type="button" class="chip-btn" onclick="selectAmount(1499.00, this)">₹1,499</button>
          </div>

          <!-- Custom Amount Input -->
          <div class="custom-amount-box">
            <span class="custom-amount-label">Or Custom Amount:</span>
            <div class="custom-input-wrap">
              <span class="custom-currency-symbol">₹</span>
              <input type="number" id="customAmountInput" class="custom-amount-input" value="1.00" min="1" step="any" oninput="handleCustomAmountInput(this.value)" />
            </div>
          </div>

          <!-- PRIMARY BUY BUTTON (Official One-Button Integration Target) -->
          <button type="button"
                  class="btn-buy-primary"
                  id="btnInitiateCheckout"
                  data-youpi-pay
                  data-order-id=""
                  data-amount="1.00"
                  data-currency="INR"
                  data-name="YOUPI Store"
                  data-description="YOUPI PG Enterprise Suite Top-Up"
                  data-success-url="/order-success"
                  data-failed-url="/order-failed"
                  data-suspicious-url="/order-suspicious"
                  data-expired-url="/order-expired"
                  data-cancelled-url="/order-cancelled"
                  onclick="startGatewayPurchase()">
            <span>⚡ Buy Now with YOUPI PG · <span id="btnAmountDisplay">₹1.00</span></span>
          </button>

          <div class="security-guarantee-note">
            <span>🔒</span>
            <span>Bank-Grade 256-Bit SSL · Direct UPI Settlement · 0% Deductions</span>
          </div>

          <!-- Value Proposition Grid -->
          <div class="value-props-grid">
            <div class="prop-pill"><span class="icon">⚡</span> Sub-second QR Code</div>
            <div class="prop-pill"><span class="icon">🛡️</span> Direct P2P Settlement</div>
            <div class="prop-pill"><span class="icon">💬</span> WhatsApp OTP Auth</div>
            <div class="prop-pill"><span class="icon">📱</span> Bank SMS Parsing</div>
            <div class="prop-pill"><span class="icon">📧</span> Gmail Parsing</div>
            <div class="prop-pill"><span class="icon">🔒</span> Browser Fingerprinting</div>
            <div class="prop-pill"><span class="icon">🛑</span> Instant Fraud Ban</div>
            <div class="prop-pill"><span class="icon">🏪</span> Cashier POS Till Desk</div>
          </div>
        </div>

        <!-- CONTENT BELOW THE DEMO: Security Features Checklist -->
        <div class="security-checklist-block" style="background:#ffffff; border:1px solid var(--border); border-radius:var(--radius-lg); padding:1.25rem 1.5rem; box-shadow:var(--shadow-sm);">
          <div style="font-size:0.8rem; font-weight:800; text-transform:uppercase; letter-spacing:0.05em; color:var(--text-muted); margin-bottom:0.75rem;">
            Security &amp; Core Capabilities
          </div>
          <ul class="feature-checklist">
            <li>
              <span class="chk">✓</span>
              <span><strong>0% Gateway Fees:</strong> Direct bank settlement with zero aggregator fees.</span>
            </li>
            <li>
              <span class="chk">✓</span>
              <span><strong>WhatsApp-Based OTP Auth:</strong> Verifies buyers with WhatsApp OTP before checkout.</span>
            </li>
            <li>
              <span class="chk">✓</span>
              <span><strong>SMS &amp; Email Parsing:</strong> Automatically parses incoming bank SMS and Gmail alerts to verify payments.</span>
            </li>
            <li>
              <span class="chk">✓</span>
              <span><strong>Browser Fingerprinting:</strong> Identifies buyer devices and flags high-risk or repeat offenders.</span>
            </li>
            <li>
              <span class="chk">✓</span>
              <span><strong>Bans Fraudulent Users Instantly:</strong> Automatically bans fraudulent and suspicious users immediately.</span>
            </li>
            <li>
              <span class="chk">✓</span>
              <span><strong>Strict Payment Verification Parameters:</strong> Strictly verifies payment amount, transaction UTR, and timestamp.</span>
            </li>
            <li>
              <span class="chk">✓</span>
              <span><strong>POS Cashier Counter Desk:</strong> Counter checkout for walk-in cash and card payments.</span>
            </li>
            <li>
              <span class="chk">✓</span>
              <span><strong>100% White-Label:</strong> Custom merchant domain, logo, and branding.</span>
            </li>
          </ul>
        </div>

      </div>
    </div>
  </main>

  <!-- CRITICAL ARCHITECTURAL REQUIREMENTS & SECURITY FLAW SECTION -->
  <section class="requirements-section" id="requirements">
    <div class="req-banner">
      <div style="display:flex; align-items:center; gap:0.75rem; margin-bottom:1rem;">
        <span style="font-size:1.75rem;">⚠️</span>
        <div>
          <h2 style="font-family:'Outfit',sans-serif; font-size:1.45rem; font-weight:800; color:#78350f; letter-spacing:-0.02em;">
            Security Flaw &amp; System Requirements
          </h2>
          <p style="font-size:0.85rem; color:#92400e; margin-top:0.2rem;">
            Key operational limitations, bank notification rules, and device compatibility for YOUPI PG.
          </p>
        </div>
      </div>

      <div class="req-grid">
        
        <!-- CARD 1: THE SECURITY FLAW / LIMITATION -->
        <div class="req-card">
          <div>
            <div style="display:flex; align-items:center; justify-content:space-between; margin-bottom:0.75rem;">
              <div style="display:flex; align-items:center; gap:0.5rem;">
                <span style="font-size:1.25rem;">⏳</span>
                <strong style="font-size:1.05rem; color:#0f172a;">Security Flaw: Single-Session UPI Queue</strong>
              </div>
              <span class="req-pill-badge" style="background:#eff6ff; color:#2563eb; border:1px solid #bfdbfe;">SECURITY FLAW</span>
            </div>
            <p style="font-size:0.86rem; color:#334155; line-height:1.55;">
              <strong>UPI works on a strict queue system to ensure topmost security and prevent payment mismatches.</strong> Only one user can pay on a VPA at a time. Other buyers must wait in a queue until the active transaction completes.
            </p>
          </div>
          <div style="margin-top:0.85rem; padding:0.65rem 0.85rem; background:#f8fafc; border-left:3px solid #2563eb; border-radius:4px; font-size:0.78rem; color:#475569;">
            🔒 <em>Why this exists:</em> Guarantees every payment matches the exact order with 100% security and zero payment mismatch.
          </div>
        </div>

        <!-- CARD 2: BANK SMS & GMAIL NOTIFICATION MANDATE (STRICT PREREQUISITE) -->
        <div class="req-card danger-card">
          <div>
            <div style="display:flex; align-items:center; justify-content:space-between; margin-bottom:0.75rem;">
              <div style="display:flex; align-items:center; gap:0.5rem;">
                <span style="font-size:1.25rem;">🚨</span>
                <strong style="font-size:1.05rem; color:#991b1b;">Mandatory Requirement: Bank SMS &amp; Gmail Alerts</strong>
              </div>
              <span class="req-pill-badge" style="background:#fef2f2; color:#dc2626; border:1px solid #fecaca;">MANDATORY REQUIREMENT</span>
            </div>
            <p style="font-size:0.86rem; color:#334155; line-height:1.55;">
              <strong>Your bank must push messages to Gmail and SMS. This is mandatory even for ₹1 transactions. Without it, it does not work.</strong> The gateway parses incoming SMS and Gmail alerts to automatically verify payments.
            </p>
          </div>
          <div style="margin-top:0.85rem; padding:0.65rem 0.85rem; background:#fef2f2; border-left:3px solid #dc2626; border-radius:4px; font-size:0.78rem; color:#991b1b;">
            ⚠️ <em>Requirement:</em> Real-time SMS and email alerts must be active on your bank account for all transactions.
          </div>
        </div>

        <!-- CARD 3: CONDITIONAL DEVICE REQUIREMENT -->
        <div class="req-card conditional-card">
          <div>
            <div style="display:flex; align-items:center; justify-content:space-between; margin-bottom:0.75rem;">
              <div style="display:flex; align-items:center; gap:0.5rem;">
                <span style="font-size:1.25rem;">📱</span>
                <strong style="font-size:1.05rem; color:#9a3412;">Conditional Requirement: Device Setup</strong>
              </div>
              <span class="req-pill-badge" style="background:#fff7ed; color:#c2410c; border:1px solid #fed7aa;">CONDITIONAL REQUIREMENT</span>
            </div>
            <p style="font-size:0.86rem; color:#334155; line-height:1.55;">
              <strong>If you want Gmail + SMS verification, you need an Android device.</strong> Or if you only need Gmail verification, you can use an iPhone. <strong>SMS verification is not supported by iPhones.</strong>
            </p>
            <div style="display:flex; flex-direction:column; gap:0.45rem; margin-top:0.75rem;">
              <div style="display:flex; align-items:center; justify-content:space-between; padding:0.45rem 0.65rem; background:#f0fdf4; border:1px solid #bbf7d0; border-radius:6px; font-size:0.78rem;">
                <span style="color:#166534; font-weight:700;">🟢 Gmail + SMS Verification</span>
                <span style="color:#15803d; font-weight:800; font-size:0.74rem; background:#dcfce7; padding:2px 8px; border-radius:4px;">Android Device Required</span>
              </div>
              <div style="display:flex; align-items:center; justify-content:space-between; padding:0.45rem 0.65rem; background:#f8fafc; border:1px solid #e2e8f0; border-radius:6px; font-size:0.78rem;">
                <span style="color:#334155; font-weight:700;">🔵 Gmail Verification Only</span>
                <span style="color:#0f172a; font-weight:800; font-size:0.74rem; background:#e2e8f0; padding:2px 8px; border-radius:4px;">iPhone Supported</span>
              </div>
            </div>
          </div>
          <div style="margin-top:0.85rem; padding:0.65rem 0.85rem; background:#fff7ed; border-left:3px solid #ea580c; border-radius:4px; font-size:0.78rem; color:#9a3412;">
            ⚠️ <em>Important Limitation:</em> SMS verification is not supported by iPhones.
          </div>
        </div>

      </div>
    </div>
  </section>

  <!-- TECHNICAL SPECIFICATIONS & QUAD CARDS -->
  <section class="specs-section" id="features">
    <div class="section-heading-row">
      <span class="section-badge">Gateway Capabilities</span>
      <h2 class="section-title">Built For Small Scale Businesses</h2>
    </div>

    <div class="features-quad-grid">
      <div class="quad-card">
        <div class="quad-icon">⚡</div>
        <h3 class="quad-title">0% Gateway Fees</h3>
        <p class="quad-desc">
          Direct bank settlement with zero aggregator fees. 100% of the funds go directly into your account.
        </p>
      </div>

      <div class="quad-card">
        <div class="quad-icon">💬</div>
        <h3 class="quad-title">WhatsApp OTP Auth</h3>
        <p class="quad-desc">
          Verifies buyers with WhatsApp OTP before checkout to prevent fake orders and confirm valid mobile numbers.
        </p>
      </div>

      <div class="quad-card">
        <div class="quad-icon">🔒</div>
        <h3 class="quad-title">Browser Fingerprinting &amp; Instant Bans</h3>
        <p class="quad-desc">
          Identifies buyer devices and flags high-risk or repeat offenders. Automatically bans fraudulent users immediately.
        </p>
      </div>

      <div class="quad-card">
        <div class="quad-icon">📱</div>
        <h3 class="quad-title">SMS &amp; Email Parsing</h3>
        <p class="quad-desc">
          Parses incoming bank SMS and Gmail alerts to automatically verify payments and confirm transactions in real time.
        </p>
      </div>
    </div>

    <!-- COMPARISON TABLE (WRAPPED IN RESPONSIVE WRAPPER) -->
    <div class="comparison-card" id="comparison">
      <h3 style="font-size:1.3rem; font-weight:800; margin-bottom:1.25rem;">Why Merchants Switch to YOUPI PG</h3>
      <div class="table-responsive-wrapper">
        <table class="comparison-table">
          <thead>
            <tr>
              <th>Architecture Feature</th>
              <th class="col-highlight">⚡ YOUPI PG (Self-Hosted)</th>
              <th>Traditional Gateways (Razorpay / Stripe)</th>
            </tr>
          </thead>
          <tbody>
            <tr>
              <td><strong>Transaction Fee</strong></td>
              <td class="col-highlight"><strong>0% (Zero Fees Forever)</strong></td>
              <td>2.0% – 3.0% + 18% GST</td>
            </tr>
            <tr>
              <td><strong>Settlement Window</strong></td>
              <td class="col-highlight"><strong>Instant (Direct to Bank)</strong></td>
              <td>T+2 to T+3 Business Days</td>
            </tr>
            <tr>
              <td><strong>Customer Authentication</strong></td>
              <td class="col-highlight"><strong>WhatsApp-Based OTP Verification</strong></td>
              <td>SMS / Email OTP Only</td>
            </tr>
            <tr>
              <td><strong>Fraud Mitigation</strong></td>
              <td class="col-highlight"><strong>Browser Fingerprinting &amp; Instant Bans</strong></td>
              <td>Generic Risk Scoring</td>
            </tr>
            <tr>
              <td><strong>Payment Verification</strong></td>
              <td class="col-highlight"><strong>Parses Bank SMS &amp; Gmail Alerts</strong></td>
              <td>Aggregator Dependent</td>
            </tr>
            <tr>
              <td><strong>White-Label Customization</strong></td>
              <td class="col-highlight"><strong>100% Brand Control &amp; Custom Domain</strong></td>
              <td>Aggregator Branding Mandatory</td>
            </tr>
            <tr>
              <td><strong>POS Counter &amp; Till Support</strong></td>
              <td class="col-highlight"><strong>Included (Cash &amp; Card Modalities)</strong></td>
              <td>Separate Hardware / High Add-On Cost</td>
            </tr>
          </tbody>
        </table>
      </div>
    </div>
  </section>

  <!-- ============================================================ -->
  <!-- DEMO MERCHANT OUTCOME PAGES SHOWCASE                         -->
  <!-- ============================================================ -->
  <section class="specs-section" id="outcome-pages" style="background:#ffffff; border-top:1px solid var(--border); border-bottom:1px solid var(--border); padding:3.5rem 1.5rem;">
    <div style="max-width:1280px; margin:0 auto;">
      <div class="section-heading-row" style="text-align:center; margin-bottom:2.5rem;">
        <span class="section-badge" style="background:rgba(37,99,235,0.1); color:#2563eb; border:1px solid rgba(37,99,235,0.25);">Merchant Reference Pages</span>
        <h2 class="section-title" style="font-size:2rem; margin-top:0.5rem;">Standardized Gateway Outcome Demonstrations</h2>
        <p style="color:var(--text-muted); max-width:700px; margin:0.5rem auto 0; font-size:0.95rem;">
          YOUPI PG communicates 5 distinct deterministic payment outcomes. Below are the live reference merchant pages demonstrating how customer experiences should be rendered.
        </p>
      </div>

      <div style="display:grid; grid-template-columns:repeat(auto-fit, minmax(230px, 1fr)); gap:1.25rem;">
        <!-- Card 1: SUCCESS -->
        <div style="background:#f0fdf4; border:1px solid #bbf7d0; border-radius:14px; padding:1.5rem; display:flex; flex-direction:column; justify-content:space-between;">
          <div>
            <div style="display:flex; align-items:center; gap:0.5rem; margin-bottom:0.75rem;">
              <span style="display:inline-flex; align-items:center; justify-content:center; width:28px; height:28px; border-radius:50%; background:#22c55e; color:#fff; font-size:0.9rem; font-weight:800;">✓</span>
              <strong style="color:#166534; font-size:1.1rem;">SUCCESS</strong>
            </div>
            <p style="font-size:0.85rem; color:#15803d; line-height:1.5; margin-bottom:1rem;">
              Payment verified by banking observers. Order marked paid and provisioned.
            </p>
          </div>
          <a href="/order-success?order_id=ORD-SUCCESS-TEST&amount=499.00&utr=987654321012&mode=UPI" class="btn" style="background:#16a34a; color:#ffffff; font-size:0.85rem; padding:0.6rem; text-decoration:none; text-align:center; border-radius:8px; font-weight:700;">
            Preview Success Page →
          </a>
        </div>

        <!-- Card 2: FAILED -->
        <div style="background:#fef2f2; border:1px solid #fecaca; border-radius:14px; padding:1.5rem; display:flex; flex-direction:column; justify-content:space-between;">
          <div>
            <div style="display:flex; align-items:center; gap:0.5rem; margin-bottom:0.75rem;">
              <span style="display:inline-flex; align-items:center; justify-content:center; width:28px; height:28px; border-radius:50%; background:#ef4444; color:#fff; font-size:0.9rem; font-weight:800;">✕</span>
              <strong style="color:#991b1b; font-size:1.1rem;">FAILED</strong>
            </div>
            <p style="font-size:0.85rem; color:#b91c1c; line-height:1.5; margin-bottom:1rem;">
              Transaction declined or not confirmed. Informs customer no funds were lost.
            </p>
          </div>
          <a href="/order-failed?order_id=ORD-FAILED-TEST&reason=UPI_CONFIRMATION_TIMEOUT" class="btn" style="background:#dc2626; color:#ffffff; font-size:0.85rem; padding:0.6rem; text-decoration:none; text-align:center; border-radius:8px; font-weight:700;">
            Preview Failed Page →
          </a>
        </div>

        <!-- Card 3: SUSPICIOUS -->
        <div style="background:#fffbeb; border:1px solid #fde68a; border-radius:14px; padding:1.5rem; display:flex; flex-direction:column; justify-content:space-between;">
          <div>
            <div style="display:flex; align-items:center; gap:0.5rem; margin-bottom:0.75rem;">
              <span style="display:inline-flex; align-items:center; justify-content:center; width:28px; height:28px; border-radius:50%; background:#f59e0b; color:#fff; font-size:0.9rem; font-weight:800;">⚠</span>
              <strong style="color:#92400e; font-size:1.1rem;">SUSPICIOUS</strong>
            </div>
            <p style="font-size:0.85rem; color:#b45309; line-height:1.5; margin-bottom:1rem;">
              Flagged by gateway security systems. Held for manual compliance review.
            </p>
          </div>
          <a href="/order-suspicious?order_id=ORD-SUSPICIOUS-TEST" class="btn" style="background:#d97706; color:#ffffff; font-size:0.85rem; padding:0.6rem; text-decoration:none; text-align:center; border-radius:8px; font-weight:700;">
            Preview Review Page →
          </a>
        </div>

        <!-- Card 4: EXPIRED -->
        <div style="background:#f8fafc; border:1px solid #cbd5e1; border-radius:14px; padding:1.5rem; display:flex; flex-direction:column; justify-content:space-between;">
          <div>
            <div style="display:flex; align-items:center; gap:0.5rem; margin-bottom:0.75rem;">
              <span style="display:inline-flex; align-items:center; justify-content:center; width:28px; height:28px; border-radius:50%; background:#64748b; color:#fff; font-size:0.9rem; font-weight:800;">⏱</span>
              <strong style="color:#334155; font-size:1.1rem;">EXPIRED</strong>
            </div>
            <p style="font-size:0.85rem; color:#475569; line-height:1.5; margin-bottom:1rem;">
              5-minute session window elapsed. Slot auto-released for next customer.
            </p>
          </div>
          <a href="/order-expired?order_id=ORD-EXPIRED-TEST" class="btn" style="background:#475569; color:#ffffff; font-size:0.85rem; padding:0.6rem; text-decoration:none; text-align:center; border-radius:8px; font-weight:700;">
            Preview Expired Page →
          </a>
        </div>

        <!-- Card 5: CANCELLED -->
        <div style="background:#f8fafc; border:1px solid #cbd5e1; border-radius:14px; padding:1.5rem; display:flex; flex-direction:column; justify-content:space-between;">
          <div>
            <div style="display:flex; align-items:center; gap:0.5rem; margin-bottom:0.75rem;">
              <span style="display:inline-flex; align-items:center; justify-content:center; width:28px; height:28px; border-radius:50%; background:#94a3b8; color:#fff; font-size:0.9rem; font-weight:800;">⊘</span>
              <strong style="color:#334155; font-size:1.1rem;">CANCELLED</strong>
            </div>
            <p style="font-size:0.85rem; color:#475569; line-height:1.5; margin-bottom:1rem;">
              User dismissed modal or requested cancellation before payment.
            </p>
          </div>
          <a href="/order-cancelled?order_id=ORD-CANCELLED-TEST" class="btn" style="background:#64748b; color:#ffffff; font-size:0.85rem; padding:0.6rem; text-decoration:none; text-align:center; border-radius:8px; font-weight:700;">
            Preview Cancelled Page →
          </a>
        </div>
      </div>
    </div>
  </section>

  <!-- ============================================================ -->
  <!-- OFFICIAL DEVELOPER INTEGRATION GUIDE                         -->
  <!-- ============================================================ -->
  <section class="specs-section" id="developer-guide" style="background:#0f172a; color:#f8fafc; padding:4rem 1.5rem;">
    <div style="max-width:1100px; margin:0 auto;">
      <div style="text-align:center; margin-bottom:3rem;">
        <span style="background:rgba(56,189,248,0.15); border:1px solid rgba(56,189,248,0.35); color:#38bdf8; font-size:0.8rem; font-weight:800; padding:0.35rem 1rem; border-radius:20px; text-transform:uppercase; letter-spacing:0.04em;">Official Integration Guide</span>
        <h2 style="font-family:'Outfit',sans-serif; font-size:2.4rem; font-weight:800; color:#ffffff; margin-top:0.75rem;">Integrate YOUPI PG in 5 Minutes</h2>
        <p style="color:#94a3b8; font-size:1.05rem; max-width:700px; margin:0.5rem auto 0;">
          Universal, framework-independent browser integration. Works with PHP, Node.js, Python, Laravel, Django, Next.js, WordPress, or plain HTML.
        </p>
      </div>

      <!-- STEP 1 -->
      <div style="background:#1e293b; border:1px solid #334155; border-radius:16px; padding:1.75rem; margin-bottom:1.75rem;">
        <div style="display:flex; align-items:center; gap:0.75rem; margin-bottom:0.75rem;">
          <span style="background:#2563eb; color:#ffffff; width:32px; height:32px; border-radius:50%; display:flex; align-items:center; justify-content:center; font-weight:800;">1</span>
          <h3 style="font-family:'Outfit',sans-serif; font-size:1.35rem; font-weight:700; color:#ffffff;">Add the Official Script to Your Page</h3>
        </div>
        <p style="color:#cbd5e1; font-size:0.92rem; margin-bottom:1rem; line-height:1.5;">
          Place this single script tag in your HTML. It automatically provides modal checkout, responsive iframe sizing, and button auto-detection.
        </p>
        <pre style="background:#0b1120; border:1px solid #1e293b; border-radius:10px; padding:1rem; color:#38bdf8; font-family:monospace; font-size:0.9rem; overflow-x:auto;"><code>&lt;!-- Official YOUPI PG Universal Integration Script --&gt;
&lt;script
    src="https://&lt;youpi-checkout-host&gt;/youpi.js"
    data-youpi-key="YOUR_PUBLIC_KEY"&gt;
&lt;/script&gt;</code></pre>
      </div>

      <!-- STEP 2 -->
      <div style="background:#1e293b; border:1px solid #334155; border-radius:16px; padding:1.75rem; margin-bottom:1.75rem;">
        <div style="display:flex; align-items:center; gap:0.75rem; margin-bottom:0.75rem;">
          <span style="background:#2563eb; color:#ffffff; width:32px; height:32px; border-radius:50%; display:flex; align-items:center; justify-content:center; font-weight:800;">2</span>
          <h3 style="font-family:'Outfit',sans-serif; font-size:1.35rem; font-weight:700; color:#ffffff;">Map Your Payment Button (Zero JavaScript)</h3>
        </div>
        <p style="color:#cbd5e1; font-size:0.92rem; margin-bottom:1rem; line-height:1.5;">
          Add <code>data-youpi-pay</code>, <code>data-order-id</code>, and <code>data-amount</code> to any button. The script automatically opens the centered modal checkout on click!
        </p>
        <pre style="background:#0b1120; border:1px solid #1e293b; border-radius:10px; padding:1rem; color:#4ade80; font-family:monospace; font-size:0.9rem; overflow-x:auto;"><code>&lt;button
    data-youpi-pay
    data-order-id="ORDER-1001"
    data-amount="499"&gt;
    Buy Now
&lt;/button&gt;</code></pre>
        <p style="color:#94a3b8; font-size:0.85rem; margin-top:0.75rem;">
          Optional button attributes: <code>data-currency="INR"</code>, <code>data-customer-name="Mohit"</code>, <code>data-customer-email="[email protected]"</code>, <code>data-customer-phone="9876543210"</code>, <code>data-metadata='{"sku":"TSHIRT-01"}'</code>.
        </p>
      </div>

      <!-- STEP 3 -->
      <div style="background:#1e293b; border:1px solid #334155; border-radius:16px; padding:1.75rem; margin-bottom:1.75rem;">
        <div style="display:flex; align-items:center; gap:0.75rem; margin-bottom:0.75rem;">
          <span style="background:#2563eb; color:#ffffff; width:32px; height:32px; border-radius:50%; display:flex; align-items:center; justify-content:center; font-weight:800;">3</span>
          <h3 style="font-family:'Outfit',sans-serif; font-size:1.35rem; font-weight:700; color:#ffffff;">Listen to Browser Payment Events (For Frontend UX)</h3>
        </div>
        <p style="color:#cbd5e1; font-size:0.92rem; margin-bottom:1rem; line-height:1.5;">
          The script emits standardized DOM CustomEvents on <code>window</code> to drive your user experience.
        </p>
        <pre style="background:#0b1120; border:1px solid #1e293b; border-radius:10px; padding:1rem; color:#facc15; font-family:monospace; font-size:0.88rem; overflow-x:auto;"><code>&lt;script&gt;
  window.addEventListener('youpi:payment:success', (e) =&gt; {
    const { order_id, amount_received, utr, payment_mode } = e.detail;
    console.log(`Payment confirmed for Order #${order_id}. UTR: ${utr}`);
    window.location.href = `/order-success?order_id=${order_id}&amount=${amount_received}&utr=${utr}`;
  });

  window.addEventListener('youpi:payment:failed', (e) =&gt; {
    window.location.href = `/order-failed?order_id=${e.detail.order_id}&reason=${e.detail.reason}`;
  });

  window.addEventListener('youpi:payment:suspicious', (e) =&gt; {
    window.location.href = `/order-suspicious?order_id=${e.detail.order_id}`;
  });
&lt;/script&gt;</code></pre>
      </div>

      <!-- STEP 4 -->
      <div style="background:#1e293b; border:1px solid #334155; border-radius:16px; padding:1.75rem; margin-bottom:1.75rem;">
        <div style="display:flex; align-items:center; gap:0.75rem; margin-bottom:0.75rem;">
          <span style="background:#2563eb; color:#ffffff; width:32px; height:32px; border-radius:50%; display:flex; align-items:center; justify-content:center; font-weight:800;">4</span>
          <h3 style="font-family:'Outfit',sans-serif; font-size:1.35rem; font-weight:700; color:#ffffff;">Or Use Programmatic Invocation: <code>Youpi.pay({...})</code></h3>
        </div>
        <p style="color:#cbd5e1; font-size:0.92rem; margin-bottom:1rem; line-height:1.5;">
          For dynamic shopping carts (React, Vue, Next.js, Nuxt), call the programmatic API directly:
        </p>
        <pre style="background:#0b1120; border:1px solid #1e293b; border-radius:10px; padding:1rem; color:#a78bfa; font-family:monospace; font-size:0.88rem; overflow-x:auto;"><code>Youpi.pay({
  order_id: "ORDER-1001",
  amount: 499,
  currency: "INR",
  customer: {
    name: "Mohit",
    email: "[email protected]",
    phone: "9876543210"
  },
  metadata: { product_id: "TSHIRT-01" },
  handler: function(response) {
    // response: { status: "SUCCESS", order_id, amount_received, utr, payment_mode }
    alert(`Payment successful! UTR: ${response.utr}`);
  },
  onFailed: function(response) {
    alert(`Payment failed: ${response.reason}`);
  }
});</code></pre>
      </div>

      <!-- STEP 5 -->
      <div style="background:#1e293b; border:1px solid #334155; border-radius:16px; padding:1.75rem; margin-bottom:2.5rem;">
        <div style="display:flex; align-items:center; gap:0.75rem; margin-bottom:0.75rem;">
          <span style="background:#10b981; color:#ffffff; width:32px; height:32px; border-radius:50%; display:flex; align-items:center; justify-content:center; font-weight:800;">5</span>
          <h3 style="font-family:'Outfit',sans-serif; font-size:1.35rem; font-weight:700; color:#ffffff;">Configure Authoritative Backend Webhook (Server-to-Server)</h3>
        </div>
        <div style="background:rgba(239,68,68,0.15); border:1px solid rgba(239,68,68,0.3); border-radius:8px; padding:0.85rem 1rem; color:#fca5a5; font-size:0.88rem; margin-bottom:1rem;">
          <strong>CRITICAL SECURITY INVARIANT:</strong> Never mark an order paid based only on client-side browser events. Only fulfill orders after verifying the server-to-server HMAC-SHA256 signed webhook!
        </div>
        <pre style="background:#0b1120; border:1px solid #1e293b; border-radius:10px; padding:1rem; color:#f472b6; font-family:monospace; font-size:0.88rem; overflow-x:auto;"><code>// Node.js / Express Webhook Receiver Reference
import crypto from 'node:crypto';

app.post('/api/youpi-webhook', express.raw({ type: 'application/json' }), (req, res) => {
  const signature = req.headers['x-gateway-signature']; // 'sha256=...'
  const webhookSecret = process.env.YOUPI_WEBHOOK_SECRET;

  // Verify HMAC-SHA256 signature
  const expectedHmac = crypto.createHmac('sha256', webhookSecret).update(req.body).digest('hex');
  if (signature !== `sha256=${expectedHmac}`) {
    return res.status(401).send('Signature mismatch');
  }

  const event = JSON.parse(req.body.toString());
  if (event.event === 'SUCCESS') {
    // Authoritative proof: Mark order as PAID in your database!
    db.orders.markPaid(event.orderId, { utr: event.utr, amount: event.amount });
  }

  res.status(200).json({ received: true });
});</code></pre>
      </div>

      <!-- FAQ ACCORDION: DEVELOPER QUESTIONS -->
      <div style="background:#111c34; border:1px solid #1e293b; border-radius:18px; padding:2rem;">
        <h3 style="font-family:'Outfit',sans-serif; font-size:1.6rem; font-weight:800; color:#ffffff; margin-bottom:1.5rem; text-align:center;">
          Frequently Asked Developer Questions
        </h3>
        
        <div style="display:grid; grid-template-columns:repeat(auto-fit, minmax(280px, 1fr)); gap:1.25rem;">
          <div style="background:#0c1527; padding:1.25rem; border-radius:10px; border:1px solid #1e293b;">
            <strong style="color:#38bdf8; font-size:0.95rem;">Q: What do I put in my HTML?</strong>
            <p style="color:#94a3b8; font-size:0.85rem; margin-top:0.4rem; line-height:1.5;">A: Exactly one script tag: <code>&lt;script src="..." data-youpi-key="KEY"&gt;&lt;/script&gt;</code> and your button with <code>data-youpi-pay</code>.</p>
          </div>
          <div style="background:#0c1527; padding:1.25rem; border-radius:10px; border:1px solid #1e293b;">
            <strong style="color:#38bdf8; font-size:0.95rem;">Q: What information do I send to YOUPI?</strong>
            <p style="color:#94a3b8; font-size:0.85rem; margin-top:0.4rem; line-height:1.5;">A: Only <code>order_id</code> and <code>amount</code> are required. Currency defaults to INR. Customer info and metadata are optional.</p>
          </div>
          <div style="background:#0c1527; padding:1.25rem; border-radius:10px; border:1px solid #1e293b;">
            <strong style="color:#38bdf8; font-size:0.95rem;">Q: How does the payment modal open?</strong>
            <p style="color:#94a3b8; font-size:0.85rem; margin-top:0.4rem; line-height:1.5;">A: Automatically! Clicking a <code>data-youpi-pay</code> button dims and blurs the background and renders the centered 2-column modal (or mobile drawer).</p>
          </div>
          <div style="background:#0c1527; padding:1.25rem; border-radius:10px; border:1px solid #1e293b;">
            <strong style="color:#38bdf8; font-size:0.95rem;">Q: Which event actually proves the order is paid?</strong>
            <p style="color:#94a3b8; font-size:0.85rem; margin-top:0.4rem; line-height:1.5;">A: ONLY the server-to-server webhook with valid HMAC signature. Browser events are for UI animations only.</p>
          </div>
          <div style="background:#0c1527; padding:1.25rem; border-radius:10px; border:1px solid #1e293b;">
            <strong style="color:#38bdf8; font-size:0.95rem;">Q: What should never be trusted from the browser?</strong>
            <p style="color:#94a3b8; font-size:0.85rem; margin-top:0.4rem; line-height:1.5;">A: Any frontend declaration of payment success. Never mark orders as fulfilled based solely on browser redirects or client callbacks.</p>
          </div>
          <div style="background:#0c1527; padding:1.25rem; border-radius:10px; border:1px solid #1e293b;">
            <strong style="color:#38bdf8; font-size:0.95rem;">Q: Does the browser integration need private API secrets?</strong>
            <p style="color:#94a3b8; font-size:0.85rem; margin-top:0.4rem; line-height:1.5;">A: NO! Only your public merchant key is placed in the browser. Private webhook secrets remain securely on your server.</p>
          </div>
        </div>
      </div>
    </div>
  </section>

  <!-- FOOTER -->
  <footer>
    <div class="footer-inner">
      <div class="footer-brand">
        <div class="brand-logo-badge">⚡</div>
        <div>
          <div style="font-family:'Outfit', sans-serif; font-size:1.2rem; font-weight:800; color:#ffffff;">YOUPI Store</div>
          <div style="font-size:0.75rem; color:#94a3b8;">Official Demo Store &amp; E-Commerce Gateway Showcase</div>
        </div>
      </div>
      <div style="font-size:0.8rem; color:#94a3b8;">
        © 2026 YOUPI PG · Sovereign Small Scale Payment Gateway Suite
      </div>
    </div>
  </footer>

  <!-- LIGHTBOX MODAL FOR FULL-RES IMAGE INSPECTION -->
  <div class="lightbox-modal" id="lightboxModal" onclick="closeLightbox(event)">
    <button type="button" class="lightbox-close-btn" onclick="closeLightbox()">✕</button>
    <img id="lightboxImg" class="lightbox-img" src="/assets/gateway_pc_checkout.png" alt="Enlarged Gateway Photo" />
  </div>

  <!-- PAYMENT SUCCESS CELEBRATION MODAL -->
  <div class="celebration-modal" id="celebrationModal">
    <div class="celebration-card">
      <div class="celebration-icon">✓</div>
      <h2 style="font-family:'Outfit',sans-serif; font-size:1.6rem; font-weight:800; color:#0f172a; margin-bottom:0.4rem;">Payment Verified!</h2>
      <p style="font-size:0.88rem; color:var(--text-muted);">
        Your transaction was verified via banking observers. Your YOUPI PG Suite license is provisioned.
      </p>

      <div class="receipt-box">
        <div class="receipt-row"><span>Product:</span><strong>YOUPI PG Small Scale Suite</strong></div>
        <div class="receipt-row"><span>Order ID:</span><span id="receiptOrderId" style="font-family:monospace; font-weight:700;">-</span></div>
        <div class="receipt-row"><span>Payment ID:</span><span id="receiptPaymentId" style="font-family:monospace; font-size:0.75rem;">-</span></div>
        <div class="receipt-row"><span>Amount Paid:</span><strong id="receiptAmountPaid" style="color:#059669; font-size:0.95rem;">₹1.00</strong></div>
        <div class="receipt-row"><span>License Token:</span><code style="color:#2563eb; font-weight:700;">YPG-SML-2026-LIVE</code></div>
      </div>

      <button type="button" class="btn-buy-primary" onclick="closeCelebrationModal()" style="padding:0.75rem 1.25rem; font-size:0.95rem;">
        Done &amp; Close Receipt
      </button>
    </div>
  </div>

  <!-- MODULAR JAVASCRIPT: INTERACTIVE CONTROLLER & YOUPI CHECKOUT EMBED -->
  <script src="/js/store.js"></script>
</body>
</html>