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
feat(coin-wallet-store): modularize monolithic store.html and add responsive layout
ArunGupta1526891ead5d2504
diff --git a/apps/coin-wallet-store/public/css/store.css b/apps/coin-wallet-store/public/css/store.cssnew file mode 100644index 0000000..ca4b3e0--- /dev/null+++ b/apps/coin-wallet-store/public/css/store.css@@ -0,0 +1,1024 @@+:root {+ --primary: #2563eb;+ --primary-hover: #1d4ed8;+ --primary-glow: rgba(37, 99, 235, 0.22);+ --primary-light: #eff6ff;+ --primary-border: #bfdbfe;++ --bg: #f8fafc;+ --bg-card: #ffffff;+ --bg-card-subtle: #f8fafc;+ --border: #e2e8f0;+ --border-focus: #2563eb;+ --border-hover: #cbd5e1;++ --text: #0f172a;+ --text-muted: #64748b;+ --text-dim: #94a3b8;+ --text-heading: #0f172a;++ --success: #059669;+ --success-light: #ecfdf5;+ --success-border: #a7f3d0;++ --amber: #d97706;+ --amber-light: #fffbeb;+ --amber-border: #fde68a;++ --danger: #dc2626;+ --danger-light: #fef2f2;+ --danger-border: #fca5a5;++ --radius-sm: 8px;+ --radius-md: 12px;+ --radius-lg: 16px;+ --radius-xl: 20px;++ --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.05), 0 1px 2px rgba(0, 0, 0, 0.03);+ --shadow-md: 0 4px 12px -2px rgba(0, 0, 0, 0.06), 0 2px 6px -1px rgba(0, 0, 0, 0.04);+ --shadow-lg: 0 12px 30px -4px rgba(0, 0, 0, 0.08), 0 4px 12px -2px rgba(0, 0, 0, 0.03);+ --shadow-glow: 0 8px 24px -4px rgba(37, 99, 235, 0.28);+}++* {+ box-sizing: border-box;+ margin: 0;+ padding: 0;+ font-family: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;+}++body {+ background: var(--bg);+ color: var(--text);+ min-height: 100vh;+ display: flex;+ flex-direction: column;+ line-height: 1.5;+ overflow-x: hidden;+}++/* --- TOP ANNOUNCEMENT BANNER --- */+.top-announcement {+ background: linear-gradient(90deg, #1e3a8a 0%, #2563eb 50%, #0284c7 100%);+ color: #ffffff;+ font-size: 0.78rem;+ font-weight: 600;+ padding: 0.45rem 1rem;+ text-align: center;+ display: flex;+ align-items: center;+ justify-content: center;+ gap: 0.6rem;+ letter-spacing: 0.02em;+}++/* --- HEADER & NAVIGATION --- */+header {+ background: #ffffff;+ border-bottom: 1px solid var(--border);+ position: sticky;+ top: 0;+ z-index: 100;+ box-shadow: var(--shadow-sm);+}+.header-inner {+ max-width: 1280px;+ margin: 0 auto;+ padding: 0.85rem 1.5rem;+ display: flex;+ align-items: center;+ justify-content: space-between;+ gap: 1rem;+}+.brand-group {+ display: flex;+ align-items: center;+ gap: 0.85rem;+ text-decoration: none;+}+.brand-logo-badge {+ width: 38px;+ height: 38px;+ background: linear-gradient(135deg, #2563eb 0%, #1d4ed8 100%);+ color: #ffffff;+ border-radius: var(--radius-sm);+ display: flex;+ align-items: center;+ justify-content: center;+ font-weight: 900;+ font-size: 1.25rem;+ box-shadow: var(--shadow-sm);+}+.brand-text {+ display: flex;+ flex-direction: column;+}+.brand-title {+ font-family: 'Outfit', sans-serif;+ font-size: 1.25rem;+ font-weight: 800;+ color: var(--text-heading);+ line-height: 1.1;+ letter-spacing: -0.02em;+}+.brand-subtitle {+ font-size: 0.72rem;+ font-weight: 700;+ color: var(--primary);+ text-transform: uppercase;+ letter-spacing: 0.05em;+}++.header-nav {+ display: flex;+ align-items: center;+ gap: 0.75rem;+ flex-wrap: wrap;+}++.badge-live-store {+ display: inline-flex;+ align-items: center;+ gap: 0.35rem;+ background: var(--success-light);+ border: 1px solid var(--success-border);+ color: var(--success);+ font-size: 0.75rem;+ font-weight: 700;+ padding: 0.25rem 0.65rem;+ border-radius: 9999px;+}+.badge-live-store .dot {+ width: 7px;+ height: 7px;+ background: #10b981;+ border-radius: 50%;+ animation: pulseDot 1.8s infinite;+}+@keyframes pulseDot {+ 0%, 100% { opacity: 1; transform: scale(1); }+ 50% { opacity: 0.5; transform: scale(0.85); }+}++.btn-admin-link {+ display: inline-flex;+ align-items: center;+ gap: 0.4rem;+ background: #f1f5f9;+ border: 1px solid var(--border);+ color: var(--text);+ font-size: 0.78rem;+ font-weight: 700;+ padding: 0.4rem 0.8rem;+ border-radius: var(--radius-sm);+ text-decoration: none;+ transition: all 0.15s;+ white-space: nowrap;+}+.btn-admin-link:hover {+ background: #e2e8f0;+ border-color: var(--border-hover);+}++/* --- MAIN PDP CONTAINER --- */+.product-showcase-container {+ max-width: 1280px;+ margin: 1.5rem auto 2.5rem;+ padding: 0 1.5rem;+ width: 100%;+}++.pdp-grid {+ display: grid;+ grid-template-columns: 1.15fr 1fr;+ gap: 2.5rem;+ align-items: start;+}++/* --- LEFT: PRODUCT VISUAL GALLERY --- */+.gallery-column {+ background: var(--bg-card);+ border: 1px solid var(--border);+ border-radius: var(--radius-xl);+ padding: 1.5rem;+ box-shadow: var(--shadow-sm);+ position: sticky;+ top: 85px;+}+.gallery-main-viewport {+ width: 100%;+ height: 480px;+ background: #090d16;+ border: 1px solid #1e293b;+ border-radius: var(--radius-lg);+ position: relative;+ overflow: hidden;+ display: flex;+ align-items: center;+ justify-content: center;+ cursor: zoom-in;+ box-shadow: inset 0 2px 8px rgba(0,0,0,0.4);+}+.gallery-main-img {+ max-width: 100%;+ max-height: 100%;+ width: auto;+ height: auto;+ object-fit: contain;+ transition: transform 0.25s cubic-bezier(0.16, 1, 0.3, 1), opacity 0.2s ease;+}+.gallery-main-img:hover {+ transform: scale(1.02);+}+.gallery-badge-overlay {+ position: absolute;+ top: 14px;+ left: 14px;+ background: rgba(15, 23, 42, 0.85);+ backdrop-filter: blur(8px);+ -webkit-backdrop-filter: blur(8px);+ border: 1px solid rgba(255, 255, 255, 0.15);+ color: #ffffff;+ font-size: 0.75rem;+ font-weight: 700;+ padding: 0.35rem 0.75rem;+ border-radius: 9999px;+ display: inline-flex;+ align-items: center;+ gap: 0.4rem;+ pointer-events: none;+}+.gallery-zoom-hint {+ position: absolute;+ bottom: 14px;+ right: 14px;+ background: rgba(15, 23, 42, 0.85);+ backdrop-filter: blur(8px);+ border: 1px solid rgba(255, 255, 255, 0.15);+ color: #94a3b8;+ font-size: 0.72rem;+ font-weight: 600;+ padding: 0.3rem 0.65rem;+ border-radius: var(--radius-sm);+ display: inline-flex;+ align-items: center;+ gap: 0.35rem;+ pointer-events: none;+}++/* Thumbnail Carousel Grid */+.thumbnails-grid {+ display: grid;+ grid-template-columns: repeat(5, 1fr);+ gap: 0.75rem;+ margin-top: 1rem;+}+.thumb-card {+ border: 2px solid var(--border);+ border-radius: var(--radius-md);+ background: #090d16;+ height: 75px;+ padding: 4px;+ display: flex;+ flex-direction: column;+ align-items: center;+ justify-content: center;+ cursor: pointer;+ transition: all 0.18s cubic-bezier(0.16, 1, 0.3, 1);+ overflow: hidden;+ position: relative;+}+.thumb-card img {+ max-width: 100%;+ max-height: 100%;+ object-fit: cover;+ border-radius: 6px;+ opacity: 0.82;+ transition: opacity 0.15s;+}+.thumb-card:hover {+ border-color: var(--primary-border);+ transform: translateY(-2px);+}+.thumb-card:hover img {+ opacity: 1;+}+.thumb-card.active {+ border-color: var(--primary);+ box-shadow: 0 0 0 2px var(--primary-glow);+}+.thumb-card.active img {+ opacity: 1;+}++/* --- RIGHT: PRODUCT BUY BOX --- */+.details-column {+ display: flex;+ flex-direction: column;+ gap: 1.25rem;+}++.product-h1 {+ font-family: 'Outfit', sans-serif;+ font-size: 2.15rem;+ font-weight: 800;+ line-height: 1.2;+ color: var(--text-heading);+ letter-spacing: -0.025em;+}++/* Core Features Checklist */+.feature-checklist {+ list-style: none;+ display: flex;+ flex-direction: column;+ gap: 0.65rem;+ margin: 0.35rem 0;+}+.feature-checklist li {+ font-size: 0.86rem;+ color: var(--text);+ display: flex;+ align-items: flex-start;+ gap: 0.65rem;+ line-height: 1.45;+}+.feature-checklist li .chk {+ color: var(--success);+ font-weight: 900;+ font-size: 0.95rem;+ margin-top: 1px;+ flex-shrink: 0;+}++/* --- THE DEMO CHECKOUT BUY BOX CARD --- */+.buy-box-card {+ background: #ffffff;+ border: 2px solid #bfdbfe;+ border-radius: var(--radius-xl);+ padding: 1.75rem;+ box-shadow: var(--shadow-md);+ position: relative;+}+.buy-box-card::before {+ content: "";+ position: absolute;+ top: -2px;+ left: 10%;+ right: 10%;+ height: 3px;+ background: linear-gradient(90deg, #2563eb, #38bdf8, #2563eb);+ border-radius: 3px;+}++.pricing-header {+ display: flex;+ align-items: baseline;+ justify-content: space-between;+ margin-bottom: 0.5rem;+ flex-wrap: wrap;+ gap: 0.5rem;+}+.price-main {+ font-family: 'Outfit', sans-serif;+ font-size: 2.6rem;+ font-weight: 900;+ color: #0f172a;+ letter-spacing: -0.03em;+ line-height: 1;+}+.price-badge-demo {+ background: #eff6ff;+ border: 1px solid #bfdbfe;+ color: #2563eb;+ font-size: 0.72rem;+ font-weight: 800;+ text-transform: uppercase;+ padding: 0.25rem 0.65rem;+ border-radius: 9999px;+ letter-spacing: 0.04em;+}++.pricing-note {+ font-size: 0.82rem;+ color: var(--text-muted);+ margin-bottom: 1.25rem;+}++/* AMOUNT SELECTOR CHIPS */+.amount-selector-title {+ font-size: 0.78rem;+ font-weight: 800;+ text-transform: uppercase;+ letter-spacing: 0.05em;+ color: var(--text-muted);+ margin-bottom: 0.65rem;+ display: flex;+ justify-content: space-between;+ align-items: center;+}+.amount-selector-chips {+ display: grid;+ grid-template-columns: repeat(5, 1fr);+ gap: 0.5rem;+ margin-bottom: 1rem;+}+.chip-btn {+ padding: 0.55rem 0.4rem;+ font-size: 0.85rem;+ font-weight: 800;+ border-radius: var(--radius-sm);+ border: 1px solid var(--border);+ background: #ffffff;+ color: var(--text);+ cursor: pointer;+ text-align: center;+ transition: all 0.15s cubic-bezier(0.16, 1, 0.3, 1);+}+.chip-btn:hover {+ border-color: var(--primary-border);+ background: var(--primary-light);+ color: var(--primary);+}+.chip-btn.active {+ border-color: var(--primary);+ background: var(--primary);+ color: #ffffff;+ box-shadow: 0 2px 8px var(--primary-glow);+}++/* CUSTOM AMOUNT INPUT ROW */+.custom-amount-box {+ margin-bottom: 1.25rem;+ background: var(--bg-card-subtle);+ border: 1px solid var(--border);+ border-radius: var(--radius-md);+ padding: 0.75rem 1rem;+ display: flex;+ align-items: center;+ justify-content: space-between;+ gap: 0.75rem;+ flex-wrap: wrap;+}+.custom-amount-label {+ font-size: 0.82rem;+ font-weight: 700;+ color: var(--text);+ white-space: nowrap;+}+.custom-input-wrap {+ display: flex;+ align-items: center;+ background: #ffffff;+ border: 1px solid var(--border);+ border-radius: var(--radius-sm);+ padding: 0.35rem 0.65rem;+ width: 150px;+ transition: border-color 0.15s;+}+.custom-input-wrap:focus-within {+ border-color: var(--primary);+ box-shadow: 0 0 0 3px var(--primary-light);+}+.custom-currency-symbol {+ font-weight: 800;+ color: var(--text-muted);+ font-size: 0.95rem;+ margin-right: 4px;+}+.custom-amount-input {+ border: none;+ outline: none;+ font-size: 1rem;+ font-weight: 800;+ color: var(--text-heading);+ width: 100%;+}++/* PRIMARY BUY BUTTON */+.btn-buy-primary {+ width: 100%;+ background: linear-gradient(135deg, #2563eb 0%, #1d4ed8 100%);+ color: #ffffff;+ border: none;+ border-radius: var(--radius-md);+ padding: 1.05rem 1.5rem;+ font-size: 1.08rem;+ font-weight: 800;+ cursor: pointer;+ display: flex;+ align-items: center;+ justify-content: center;+ gap: 0.65rem;+ box-shadow: var(--shadow-glow);+ transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);+ letter-spacing: -0.01em;+}+.btn-buy-primary:hover {+ transform: translateY(-2px);+ box-shadow: 0 10px 28px -4px rgba(37, 99, 235, 0.38);+ background: linear-gradient(135deg, #1d4ed8 0%, #1e40af 100%);+}+.btn-buy-primary:active {+ transform: translateY(0);+}+.btn-buy-primary:disabled {+ opacity: 0.65;+ cursor: not-allowed;+ transform: none;+}++.security-guarantee-note {+ font-size: 0.75rem;+ color: var(--text-muted);+ text-align: center;+ margin-top: 0.85rem;+ display: flex;+ align-items: center;+ justify-content: center;+ gap: 0.4rem;+}++/* VALUE PROPOSITION BADGES GRID */+.value-props-grid {+ display: grid;+ grid-template-columns: repeat(2, 1fr);+ gap: 0.75rem;+ margin-top: 1.25rem;+ padding-top: 1.25rem;+ border-top: 1px solid var(--border);+}+.prop-pill {+ display: flex;+ align-items: center;+ gap: 0.5rem;+ font-size: 0.78rem;+ font-weight: 600;+ color: var(--text-muted);+}+.prop-pill .icon {+ font-size: 0.95rem;+}++/* --- ARCHITECTURE REQUIREMENTS & TRADEOFFS SECTION --- */+.requirements-section {+ max-width: 1280px;+ margin: 2.5rem auto 1.5rem;+ padding: 0 1.5rem;+ width: 100%;+}+.req-banner {+ background: linear-gradient(135deg, #fffbeb 0%, #fef3c7 100%);+ border: 2px solid #fcd34d;+ border-radius: var(--radius-xl);+ padding: 2rem;+ box-shadow: var(--shadow-sm);+}+.req-grid {+ display: grid;+ grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));+ gap: 1.5rem;+ margin-top: 1.25rem;+}+.req-card {+ background: #ffffff;+ border: 1px solid #fde68a;+ border-radius: var(--radius-lg);+ padding: 1.5rem;+ box-shadow: var(--shadow-sm);+ display: flex;+ flex-direction: column;+ justify-content: space-between;+}+.req-card.danger-card {+ border-color: #fca5a5;+}+.req-card.conditional-card {+ border-color: #fed7aa;+}+.req-pill-badge {+ font-size: 0.7rem;+ font-weight: 800;+ padding: 0.2rem 0.55rem;+ border-radius: 9999px;+ text-transform: uppercase;+ letter-spacing: 0.04em;+}++/* --- CAPABILITIES SECTION --- */+.specs-section {+ max-width: 1280px;+ margin: 2rem auto;+ padding: 0 1.5rem;+ width: 100%;+}+.section-heading-row {+ text-align: center;+ max-width: 720px;+ margin: 0 auto 2.5rem;+}+.section-badge {+ display: inline-block;+ font-size: 0.75rem;+ font-weight: 800;+ text-transform: uppercase;+ color: var(--primary);+ background: var(--primary-light);+ padding: 0.25rem 0.75rem;+ border-radius: 9999px;+ letter-spacing: 0.05em;+ margin-bottom: 0.5rem;+}+.section-title {+ font-family: 'Outfit', sans-serif;+ font-size: 2rem;+ font-weight: 800;+ color: var(--text-heading);+ letter-spacing: -0.025em;+}++.features-quad-grid {+ display: grid;+ grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));+ gap: 1.5rem;+ margin-bottom: 3rem;+}+.quad-card {+ background: #ffffff;+ border: 1px solid var(--border);+ border-radius: var(--radius-lg);+ padding: 1.5rem;+ box-shadow: var(--shadow-sm);+ transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);+}+.quad-card:hover {+ transform: translateY(-3px);+ box-shadow: var(--shadow-md);+ border-color: var(--border-hover);+}+.quad-icon {+ width: 44px;+ height: 44px;+ border-radius: var(--radius-md);+ background: var(--primary-light);+ color: var(--primary);+ display: flex;+ align-items: center;+ justify-content: center;+ font-size: 1.35rem;+ margin-bottom: 1rem;+}+.quad-title {+ font-size: 1.05rem;+ font-weight: 800;+ color: var(--text-heading);+ margin-bottom: 0.4rem;+}+.quad-desc {+ font-size: 0.85rem;+ color: var(--text-muted);+ line-height: 1.5;+}++/* RESPONSIVE TABLE WRAPPER & COMPARISON CARD */+.table-responsive-wrapper {+ width: 100%;+ overflow-x: auto;+ -webkit-overflow-scrolling: touch;+}+.comparison-card {+ background: #ffffff;+ border: 1px solid var(--border);+ border-radius: var(--radius-xl);+ padding: 2rem;+ box-shadow: var(--shadow-sm);+ margin-bottom: 3rem;+ overflow: hidden;+}+.comparison-table {+ width: 100%;+ min-width: 580px;+ border-collapse: collapse;+ font-size: 0.88rem;+}+.comparison-table th {+ text-align: left;+ padding: 0.85rem 1rem;+ background: var(--bg-card-subtle);+ color: var(--text-heading);+ font-weight: 700;+ border-bottom: 2px solid var(--border);+}+.comparison-table td {+ padding: 0.85rem 1rem;+ border-bottom: 1px solid var(--border);+ color: var(--text-body);+}+.comparison-table tr:last-child td {+ border-bottom: none;+}+.comparison-table tr:hover td {+ background: rgba(37, 99, 235, 0.02);+}+.comparison-table .col-highlight {+ background: rgba(37, 99, 235, 0.05);+ color: #1d4ed8;+ font-weight: 600;+}+.comparison-table th.col-highlight {+ background: rgba(37, 99, 235, 0.08);+ color: #1d4ed8;+ border-bottom-color: #3b82f6;+}++/* FOOTER */+footer {+ background: #020617;+ border-top: 1px solid #1e293b;+ padding: 2.5rem 1.5rem;+ margin-top: auto;+}+.footer-inner {+ max-width: 1280px;+ margin: 0 auto;+ display: flex;+ align-items: center;+ justify-content: space-between;+ gap: 1.5rem;+}+.footer-brand {+ display: flex;+ align-items: center;+ gap: 0.75rem;+}++/* LIGHTBOX MODAL */+.lightbox-modal {+ display: none;+ position: fixed;+ inset: 0;+ background: rgba(2, 6, 23, 0.92);+ backdrop-filter: blur(8px);+ -webkit-backdrop-filter: blur(8px);+ z-index: 999999;+ align-items: center;+ justify-content: center;+ padding: 2rem;+ cursor: zoom-out;+}+.lightbox-modal.active {+ display: flex;+}+.lightbox-close-btn {+ position: absolute;+ top: 1.5rem;+ right: 1.5rem;+ background: rgba(255, 255, 255, 0.15);+ border: 1px solid rgba(255, 255, 255, 0.25);+ color: #ffffff;+ width: 40px;+ height: 40px;+ border-radius: 50%;+ font-size: 1.25rem;+ cursor: pointer;+ display: flex;+ align-items: center;+ justify-content: center;+ transition: background 0.2s;+}+.lightbox-close-btn:hover {+ background: rgba(255, 255, 255, 0.3);+}+.lightbox-img {+ max-width: 90vw;+ max-height: 85vh;+ border-radius: var(--radius-lg);+ box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.5);+ cursor: default;+ object-fit: contain;+}++/* CELEBRATION MODAL */+.celebration-modal {+ display: none;+ position: fixed;+ inset: 0;+ background: rgba(2, 6, 23, 0.8);+ backdrop-filter: blur(6px);+ -webkit-backdrop-filter: blur(6px);+ z-index: 999998;+ align-items: center;+ justify-content: center;+ padding: 1rem;+}+.celebration-modal.active {+ display: flex;+}+.celebration-card {+ background: #ffffff;+ border-radius: var(--radius-xl);+ padding: 2rem;+ max-width: 440px;+ width: 100%;+ text-align: center;+ box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);+ animation: popIn 0.25s ease-out;+}+@keyframes popIn {+ from { transform: scale(0.9); opacity: 0; }+ to { transform: scale(1); opacity: 1; }+}+.celebration-icon {+ width: 64px;+ height: 64px;+ border-radius: 50%;+ background: #dcfce7;+ color: #16a34a;+ display: flex;+ align-items: center;+ justify-content: center;+ font-size: 2rem;+ font-weight: 800;+ margin: 0 auto 1rem;+}+.receipt-box {+ background: #f8fafc;+ border: 1px solid var(--border);+ border-radius: var(--radius-md);+ padding: 1rem;+ margin: 1.25rem 0;+ text-align: left;+ font-size: 0.85rem;+}+.receipt-row {+ display: flex;+ justify-content: space-between;+ align-items: center;+ padding: 0.35rem 0;+ border-bottom: 1px dashed var(--border);+}+.receipt-row:last-child {+ border-bottom: none;+}++/* ========================================================+ RESPONSIVE BREAKPOINTS (Mobile, Tablet, Desktop)+ ======================================================== */++@media (max-width: 1024px) {+ .pdp-grid {+ grid-template-columns: 1fr;+ gap: 2rem;+ }+ .gallery-column {+ position: static;+ }+ .gallery-main-viewport {+ height: 380px;+ }+}++@media (max-width: 768px) {+ .top-announcement {+ font-size: 0.72rem;+ padding: 0.4rem 0.5rem;+ gap: 0.35rem;+ }+ header {+ padding: 0.5rem 0.75rem;+ }+ .header-inner {+ flex-direction: column;+ align-items: stretch;+ gap: 0.65rem;+ padding: 0.5rem 0.25rem;+ }+ .brand-group {+ justify-content: flex-start;+ }+ .header-nav {+ width: 100%;+ flex-wrap: nowrap;+ overflow-x: auto;+ -webkit-overflow-scrolling: touch;+ padding-bottom: 4px;+ gap: 0.45rem;+ scrollbar-width: none;+ }+ .header-nav::-webkit-scrollbar {+ display: none;+ }+ .btn-admin-link {+ flex-shrink: 0;+ padding: 0.35rem 0.65rem;+ font-size: 0.72rem;+ }+ .product-showcase-container {+ padding: 1rem 0.75rem;+ }+ .gallery-column {+ padding: 1rem;+ }+ .gallery-main-viewport {+ height: 280px;+ }+ .product-h1 {+ font-size: 1.45rem;+ }+ .buy-box-card {+ padding: 1.25rem 1rem;+ }+ .price-main {+ font-size: 1.85rem;+ }+ .amount-selector-chips {+ gap: 0.4rem;+ }+ .chip-btn {+ padding: 0.45rem 0.4rem;+ font-size: 0.8rem;+ }+ .thumbnails-grid {+ gap: 0.35rem;+ margin-top: 0.75rem;+ }+ .thumb-card {+ height: 54px;+ border-radius: var(--radius-sm);+ padding: 2px;+ }+ .requirements-section {+ padding: 0 0.85rem;+ margin: 1.5rem auto 1rem;+ }+ .req-banner {+ padding: 1.15rem 1rem;+ border-radius: var(--radius-lg);+ }+ .req-grid {+ grid-template-columns: 1fr;+ gap: 1rem;+ margin-top: 1rem;+ }+ .req-card {+ padding: 1.1rem;+ }+ .specs-section {+ padding: 0 0.85rem;+ margin: 1.5rem auto;+ }+ .section-title {+ font-size: 1.45rem;+ }+ .features-quad-grid {+ grid-template-columns: 1fr;+ gap: 1rem;+ margin-bottom: 2rem;+ }+ .comparison-card {+ padding: 1.25rem 1rem;+ border-radius: var(--radius-lg);+ margin-bottom: 2rem;+ }+ .comparison-table th, .comparison-table td {+ padding: 0.65rem 0.5rem;+ font-size: 0.8rem;+ }+ footer {+ padding: 1.75rem 1rem;+ }+ .footer-inner {+ flex-direction: column;+ text-align: center;+ gap: 1rem;+ justify-content: center;+ }+}++@media (max-width: 480px) {+ .product-h1 {+ font-size: 1.3rem;+ }+ .price-main {+ font-size: 1.6rem;+ }+ .amount-selector-chips {+ grid-template-columns: repeat(3, 1fr);+ }+ .custom-amount-box {+ flex-direction: column;+ align-items: stretch;+ }+ .custom-input-wrap {+ width: 100%;+ }+ .value-props-grid {+ grid-template-columns: 1fr;+ }+ .gallery-main-viewport {+ height: 220px;+ }+ .lightbox-modal {+ padding: 0.75rem;+ }+}diff --git a/apps/coin-wallet-store/public/js/store.js b/apps/coin-wallet-store/public/js/store.jsnew file mode 100644index 0000000..678ce55--- /dev/null+++ b/apps/coin-wallet-store/public/js/store.js@@ -0,0 +1,233 @@+// --- STATE MANAGEMENT ---+let currentAmount = 1.00;+const photos = [+ {+ url: '/assets/gateway_pc_checkout.png?v=2',+ badge: '💻 Desktop 2-Column Checkout',+ title: 'Desktop 2-Column Checkout',+ desc: 'Authentic desktop 2-column checkout frame with real-time dynamic QR, clean card at counter, live order summary, and verified merchant branding.'+ },+ {+ url: '/assets/gateway_mobile_checkout.png?v=2',+ badge: '📱 Mobile Instant Sheet & UPI Intent',+ title: 'Mobile Instant Sheet & UPI Intent',+ desc: 'Native fluid mobile checkout bottom sheet with instant UPI app deep-linking (GPay, PhonePe, Paytm, CRED).'+ },+ {+ url: '/assets/gateway_merchant_operations.png?v=2',+ badge: '📊 Merchant Operations & Live Slots Hub',+ title: 'Merchant Operations & Live Slots Hub',+ desc: 'Crisp bright white operations dashboard with real-time slot allocation, floating cashier till dock, and observers status.'+ },+ {+ url: '/assets/gateway_developer_dark_hub.png?v=2',+ badge: '🌙 Developer Hub (Real Dark Mode)',+ title: 'Developer Hub (Real Dark Mode)',+ desc: 'Authentic obsidian real dark mode with multi-service supervisor, live host ports, and aggregate streaming terminal.'+ },+ {+ url: '/assets/gateway_whitelabel_customizer.png?v=2',+ badge: '🎨 White-Label Customizer & Mockup',+ title: 'White-Label Customizer & Mockup',+ desc: 'Live smartphone reflection with instant brand logo, custom color palette, trust seals, and conversion banners.'+ }+];+let currentPhotoIndex = 0;++// --- GALLERY CONTROLLER ---+function switchGalleryPhoto(index, url, title, desc) {+ currentPhotoIndex = index;+ const mainImg = document.getElementById('mainGalleryImg');+ const badgeText = document.getElementById('galleryBadgeText');++ if (mainImg) {+ mainImg.style.opacity = '0.3';+ mainImg.src = url;+ setTimeout(() => { mainImg.style.opacity = '1'; }, 100);+ }+ if (badgeText) badgeText.textContent = title;++ // Update thumbnails active state+ document.querySelectorAll('.thumb-card').forEach((el, i) => {+ el.classList.toggle('active', i === index);+ });+}++function openLightbox() {+ const modal = document.getElementById('lightboxModal');+ const img = document.getElementById('lightboxImg');+ if (modal && img) {+ img.src = photos[currentPhotoIndex].url;+ modal.classList.add('active');+ }+}++function closeLightbox() {+ const modal = document.getElementById('lightboxModal');+ if (modal) {+ modal.classList.remove('active');+ }+}++// --- AMOUNT MODIFIER & BUY BOX ---+function selectAmount(amt, chipEl) {+ currentAmount = Number(amt);+ updateAmountUI();++ document.querySelectorAll('.chip-btn').forEach(b => b.classList.remove('active'));+ if (chipEl) chipEl.classList.add('active');+ const customInput = document.getElementById('customAmountInput');+ if (customInput) customInput.value = currentAmount.toFixed(2);+}++function handleCustomAmountInput(val) {+ const num = parseFloat(val);+ if (!isNaN(num) && num >= 1) {+ currentAmount = num;+ updateAmountUI();+ }+ // Unset active chips if not exact match+ document.querySelectorAll('.chip-btn').forEach(b => {+ const chipVal = parseFloat(b.innerText.replace(/[^0-9.]/g, ''));+ b.classList.toggle('active', chipVal === currentAmount);+ });+}++function updateAmountUI() {+ const formatted = '₹' + currentAmount.toLocaleString('en-IN', { minimumFractionDigits: 2, maximumFractionDigits: 2 });+ const dispEl = document.getElementById('displayPrice');+ const btnDisp = document.getElementById('btnAmountDisplay');+ if (dispEl) dispEl.textContent = formatted;+ if (btnDisp) btnDisp.textContent = formatted;+}++// --- PURCHASE INITIATION (Using Official Universal YouPI Integration) ---+async function startGatewayPurchase() {+ const btn = document.getElementById('btnInitiateCheckout');+ const oldHtml = btn.innerHTML;+ btn.disabled = true;+ btn.innerHTML = '<span>⏳ Preparing Gateway Session...</span>';++ try {+ const orderId = `COIN-ORD-${Date.now()}`;+ btn.setAttribute('data-amount', currentAmount.toFixed(2));+ btn.setAttribute('data-order-id', orderId);++ // 1. Create order on store backend via YoupiPaymentClient+ const res = await fetch('/api/checkout', {+ method: 'POST',+ headers: { 'Content-Type': 'application/json' },+ body: JSON.stringify({+ price: currentAmount,+ productName: 'YOUPI PG Enterprise Gateway Suite',+ coins: Math.round(currentAmount)+ })+ });++ const data = await res.json();+ if (!res.ok || !data.checkoutUrl) {+ alert(data.error || 'Failed to initiate checkout session.');+ btn.disabled = false;+ btn.innerHTML = oldHtml;+ return;+ }++ // 2. Launch checkout modal using official Youpi.pay() SDK+ window.Youpi.pay({+ checkoutUrl: data.checkoutUrl,+ order_id: data.orderId,+ amount: currentAmount,+ currency: 'INR',+ name: 'YOUPI Store',+ description: 'YOUPI PG Enterprise Suite Top-Up',+ successUrl: `/order-success?order_id=${encodeURIComponent(data.orderId)}&amount=${encodeURIComponent(currentAmount)}`,+ failedUrl: `/order-failed?order_id=${encodeURIComponent(data.orderId)}`,+ suspiciousUrl: `/order-suspicious?order_id=${encodeURIComponent(data.orderId)}`,+ expiredUrl: `/order-expired?order_id=${encodeURIComponent(data.orderId)}`,+ cancelledUrl: `/order-cancelled?order_id=${encodeURIComponent(data.orderId)}`,+ handler: function(paymentResponse) {+ btn.disabled = false;+ btn.innerHTML = oldHtml;+ showCelebrationModal(data.orderId, paymentResponse.utr || paymentResponse.paymentId || data.paymentId, currentAmount);+ },+ onClose: function() {+ btn.disabled = false;+ btn.innerHTML = oldHtml;+ }+ });+ } catch (err) {+ alert('Error launching YOUPI Gateway: ' + err.message);+ btn.disabled = false;+ btn.innerHTML = oldHtml;+ }+}++// --- OFFICIAL BROWSER PAYMENT EVENT LISTENERS ---+window.addEventListener('youpi:payment:success', function(e) {+ console.log('[YOUPI PG Event] youpi:payment:success', e.detail);+ const res = e.detail;+ fetch('/api/verify-payment', {+ method: 'POST',+ headers: { 'Content-Type': 'application/json' },+ body: JSON.stringify({+ orderId: res.order_id,+ amount: res.amount_received || currentAmount,+ coins: Math.round(res.amount_received || currentAmount),+ paymentId: res.utr || res.order_id+ })+ }).then(r => r.json()).then(d => {+ if (d.coins !== undefined) {+ const el = document.getElementById('topWalletBalance');+ if (el) el.textContent = d.coins;+ }+ }).catch(() => {});+});++window.addEventListener('youpi:payment:failed', function(e) {+ console.warn('[YOUPI PG Event] youpi:payment:failed', e.detail);+});++window.addEventListener('youpi:payment:suspicious', function(e) {+ console.warn('[YOUPI PG Event] youpi:payment:suspicious', e.detail);+});++window.addEventListener('youpi:payment:expired', function(e) {+ console.warn('[YOUPI PG Event] youpi:payment:expired', e.detail);+});++window.addEventListener('youpi:payment:cancelled', function(e) {+ console.log('[YOUPI PG Event] youpi:payment:cancelled', e.detail);+});++function showCelebrationModal(orderId, paymentId, amount) {+ const modal = document.getElementById('celebrationModal');+ const elOrder = document.getElementById('receiptOrderId');+ const elPayment = document.getElementById('receiptPaymentId');+ const elAmount = document.getElementById('receiptAmountPaid');++ if (elOrder) elOrder.textContent = orderId || 'YOUPI-ORD-LIVE';+ if (elPayment) elPayment.textContent = paymentId || 'pay_verified';+ if (elAmount) elAmount.textContent = '₹' + Number(amount).toFixed(2);+ if (modal) modal.classList.add('active');+}++function closeCelebrationModal() {+ const modal = document.getElementById('celebrationModal');+ if (modal) modal.classList.remove('active');+}++// Keydown ESC to close modals+window.addEventListener('keydown', (e) => {+ if (e.key === 'Escape') {+ closeLightbox();+ closeCelebrationModal();+ }+});++// Initialize UI on load+document.addEventListener('DOMContentLoaded', () => {+ updateAmountUI();+});+if (document.readyState === 'interactive' || document.readyState === 'complete') {+ updateAmountUI();+}diff --git a/apps/coin-wallet-store/src/__tests__/coin-wallet-store.test.js b/apps/coin-wallet-store/src/__tests__/coin-wallet-store.test.jsindex 49964d1..29e0539 100644--- a/apps/coin-wallet-store/src/__tests__/coin-wallet-store.test.js+++ b/apps/coin-wallet-store/src/__tests__/coin-wallet-store.test.js@@ -372,4 +372,26 @@ describe('Coin Top-Up Wallet Demo Store Integration Tests', () => {// It should either return 200/502 (if portal not up on that test port), but NEVER 404 "Route Not Found"assert.notEqual(res.body, 'Route Not Found');});++ test('GET /css/store.css serves modular stylesheet with proper Content-Type', async () => {+ const res = await request('/css/store.css');+ assert.equal(res.status, 200);+ assert.ok(res.headers['content-type'].includes('text/css'));+ assert.ok(res.body.includes('--primary: #2563eb'));+ assert.ok(res.body.includes('table-responsive-wrapper'));+ });++ test('GET /js/store.js serves modular client script with proper Content-Type', async () => {+ const res = await request('/js/store.js');+ assert.equal(res.status, 200);+ assert.ok(res.headers['content-type'].includes('application/javascript'));+ assert.ok(res.body.includes('startGatewayPurchase'));+ assert.ok(res.body.includes('youpi:payment:success'));+ });++ test('Security: directory traversal attempts on public static assets are blocked', async () => {+ const res = await request('/css/../../package.json');+ // Traversal should not return package.json content with 200+ assert.ok(res.status === 404 || res.status === 502 || !res.body.includes('"name": "youpi-pg"'));+ });});diff --git a/apps/coin-wallet-store/src/server.js b/apps/coin-wallet-store/src/server.jsindex db64f76..d66ee6e 100644--- a/apps/coin-wallet-store/src/server.js+++ b/apps/coin-wallet-store/src/server.js@@ -149,19 +149,27 @@ export class CoinWalletStoreServer {return;}- // GET /assets/* (serve product screenshots and icons)- if (pathname.startsWith('/assets/') && (method === 'GET' || method === 'HEAD')) {- const assetName = path.basename(pathname);- const assetPath = path.join(__dirname, '../public/assets', assetName);- if (fs.existsSync(assetPath)) {- const ext = path.extname(assetName).toLowerCase();- const contentType = ext === '.png' ? 'image/png' : ext === '.svg' ? 'image/svg+xml' : ext === '.jpg' || ext === '.jpeg' ? 'image/jpeg' : 'application/octet-stream';+ // SERVE LOCAL PUBLIC ASSETS: /assets/*, /css/*, /js/*+ if ((pathname.startsWith('/assets/') || pathname.startsWith('/css/') || pathname.startsWith('/js/')) && (method === 'GET' || method === 'HEAD')) {+ const publicDir = path.resolve(__dirname, '../public');+ const safeRelative = path.normalize(pathname.replace(/^\//, '')).replace(/^(\.\.(\/|\\|$))+/, '');+ const targetPath = path.join(publicDir, safeRelative);+ const rel = path.relative(publicDir, targetPath);++ if (!rel.startsWith('..') && !path.isAbsolute(rel) && fs.existsSync(targetPath) && fs.statSync(targetPath).isFile()) {+ const ext = path.extname(targetPath).toLowerCase();+ const contentType = ext === '.css' ? 'text/css; charset=utf-8'+ : ext === '.js' ? 'application/javascript; charset=utf-8'+ : ext === '.png' ? 'image/png'+ : ext === '.svg' ? 'image/svg+xml'+ : ext === '.jpg' || ext === '.jpeg' ? 'image/jpeg'+ : 'application/octet-stream';res.writeHead(200, {'Content-Type': contentType,- 'Cache-Control': 'public, max-age=86400'+ 'Cache-Control': ext === '.css' || ext === '.js' ? 'no-cache' : 'public, max-age=86400'});if (method === 'HEAD') { res.end(); return; }- const stream = fs.createReadStream(assetPath);+ const stream = fs.createReadStream(targetPath);stream.pipe(res);return;}@@ -201,8 +209,8 @@ export class CoinWalletStoreServer {}}- // REVERSE PROXY: /checkout/* and /icons/* -> Checkout Portal (Port 7000)- if (pathname.startsWith('/checkout') || pathname.startsWith('/icons/')) {+ // REVERSE PROXY: /checkout/*, /icons/*, /css/*, and /js/* -> Checkout Portal (Port 7000)+ if (pathname.startsWith('/checkout') || pathname.startsWith('/icons/') || pathname.startsWith('/css/') || pathname.startsWith('/js/')) {const portalPort = Number(process.env.CHECKOUT_PORT || 7000);const proxyReq = http.request({hostname: '127.0.0.1',diff --git a/apps/coin-wallet-store/src/store.html b/apps/coin-wallet-store/src/store.htmlindex 8a8f6d8..1f10adc 100644--- a/apps/coin-wallet-store/src/store.html+++ b/apps/coin-wallet-store/src/store.html@@ -8,956 +8,8 @@<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>-- <style>- :root {- --primary: #2563eb;- --primary-hover: #1d4ed8;- --primary-glow: rgba(37, 99, 235, 0.22);- --primary-light: #eff6ff;- --primary-border: #bfdbfe;-- --bg: #f8fafc;- --bg-card: #ffffff;- --bg-card-subtle: #f8fafc;- --border: #e2e8f0;- --border-focus: #2563eb;- --border-hover: #cbd5e1;-- --text: #0f172a;- --text-muted: #64748b;- --text-dim: #94a3b8;- --text-heading: #0f172a;-- --success: #059669;- --success-light: #ecfdf5;- --success-border: #a7f3d0;-- --amber: #d97706;- --amber-light: #fffbeb;- --amber-border: #fde68a;-- --danger: #dc2626;- --danger-light: #fef2f2;- --danger-border: #fca5a5;-- --radius-sm: 8px;- --radius-md: 12px;- --radius-lg: 16px;- --radius-xl: 20px;-- --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.05), 0 1px 2px rgba(0, 0, 0, 0.03);- --shadow-md: 0 4px 12px -2px rgba(0, 0, 0, 0.06), 0 2px 6px -1px rgba(0, 0, 0, 0.04);- --shadow-lg: 0 12px 30px -4px rgba(0, 0, 0, 0.08), 0 4px 12px -2px rgba(0, 0, 0, 0.03);- --shadow-glow: 0 8px 24px -4px rgba(37, 99, 235, 0.28);- }-- * {- box-sizing: border-box;- margin: 0;- padding: 0;- font-family: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;- }-- body {- background: var(--bg);- color: var(--text);- min-height: 100vh;- display: flex;- flex-direction: column;- line-height: 1.5;- overflow-x: hidden;- }-- /* --- TOP ANNOUNCEMENT BANNER --- */- .top-announcement {- background: linear-gradient(90deg, #1e3a8a 0%, #2563eb 50%, #0284c7 100%);- color: #ffffff;- font-size: 0.78rem;- font-weight: 600;- padding: 0.45rem 1rem;- text-align: center;- display: flex;- align-items: center;- justify-content: center;- gap: 0.6rem;- letter-spacing: 0.02em;- }-- /* --- HEADER & NAVIGATION --- */- header {- background: #ffffff;- border-bottom: 1px solid var(--border);- position: sticky;- top: 0;- z-index: 100;- box-shadow: var(--shadow-sm);- }- .header-inner {- max-width: 1280px;- margin: 0 auto;- padding: 0.85rem 1.5rem;- display: flex;- align-items: center;- justify-content: space-between;- gap: 1rem;- }- .brand-group {- display: flex;- align-items: center;- gap: 0.85rem;- text-decoration: none;- }- .brand-logo-badge {- width: 38px;- height: 38px;- background: linear-gradient(135deg, #2563eb 0%, #1d4ed8 100%);- color: #ffffff;- border-radius: var(--radius-sm);- display: flex;- align-items: center;- justify-content: center;- font-weight: 900;- font-size: 1.25rem;- box-shadow: var(--shadow-sm);- }- .brand-text {- display: flex;- flex-direction: column;- }- .brand-title {- font-family: 'Outfit', sans-serif;- font-size: 1.25rem;- font-weight: 800;- color: var(--text-heading);- line-height: 1.1;- letter-spacing: -0.02em;- }- .brand-subtitle {- font-size: 0.72rem;- font-weight: 700;- color: var(--primary);- text-transform: uppercase;- letter-spacing: 0.05em;- }-- .badge-live-store {- display: inline-flex;- align-items: center;- gap: 0.35rem;- background: var(--success-light);- border: 1px solid var(--success-border);- color: var(--success);- font-size: 0.75rem;- font-weight: 700;- padding: 0.25rem 0.65rem;- border-radius: 9999px;- }- .badge-live-store .dot {- width: 7px;- height: 7px;- background: #10b981;- border-radius: 50%;- animation: pulseDot 1.8s infinite;- }- @keyframes pulseDot {- 0%, 100% { opacity: 1; transform: scale(1); }- 50% { opacity: 0.5; transform: scale(0.85); }- }-- .btn-admin-link {- display: inline-flex;- align-items: center;- gap: 0.4rem;- background: #f1f5f9;- border: 1px solid var(--border);- color: var(--text);- font-size: 0.78rem;- font-weight: 700;- padding: 0.4rem 0.8rem;- border-radius: var(--radius-sm);- text-decoration: none;- transition: all 0.15s;- }- .btn-admin-link:hover {- background: #e2e8f0;- border-color: var(--border-hover);- }-- /* --- MAIN PDP CONTAINER --- */- .product-showcase-container {- max-width: 1280px;- margin: 1.5rem auto 2.5rem;- padding: 0 1.5rem;- width: 100%;- }-- .pdp-grid {- display: grid;- grid-template-columns: 1.15fr 1fr;- gap: 2.5rem;- align-items: start;- }-- /* --- LEFT: PRODUCT VISUAL GALLERY --- */- .gallery-column {- background: var(--bg-card);- border: 1px solid var(--border);- border-radius: var(--radius-xl);- padding: 1.5rem;- box-shadow: var(--shadow-sm);- position: sticky;- top: 85px;- }- .gallery-main-viewport {- width: 100%;- height: 480px;- background: #090d16;- border: 1px solid #1e293b;- border-radius: var(--radius-lg);- position: relative;- overflow: hidden;- display: flex;- align-items: center;- justify-content: center;- cursor: zoom-in;- box-shadow: inset 0 2px 8px rgba(0,0,0,0.4);- }- .gallery-main-img {- max-width: 100%;- max-height: 100%;- width: auto;- height: auto;- object-fit: contain;- transition: transform 0.25s cubic-bezier(0.16, 1, 0.3, 1), opacity 0.2s ease;- }- .gallery-main-img:hover {- transform: scale(1.02);- }- .gallery-badge-overlay {- position: absolute;- top: 14px;- left: 14px;- background: rgba(15, 23, 42, 0.85);- backdrop-filter: blur(8px);- -webkit-backdrop-filter: blur(8px);- border: 1px solid rgba(255, 255, 255, 0.15);- color: #ffffff;- font-size: 0.75rem;- font-weight: 700;- padding: 0.35rem 0.75rem;- border-radius: 9999px;- display: inline-flex;- align-items: center;- gap: 0.4rem;- pointer-events: none;- }- .gallery-zoom-hint {- position: absolute;- bottom: 14px;- right: 14px;- background: rgba(15, 23, 42, 0.85);- backdrop-filter: blur(8px);- border: 1px solid rgba(255, 255, 255, 0.15);- color: #94a3b8;- font-size: 0.72rem;- font-weight: 600;- padding: 0.3rem 0.65rem;- border-radius: var(--radius-sm);- display: inline-flex;- align-items: center;- gap: 0.35rem;- pointer-events: none;- }-- /* Thumbnail Carousel Grid */- .thumbnails-grid {- display: grid;- grid-template-columns: repeat(5, 1fr);- gap: 0.75rem;- margin-top: 1rem;- }- .thumb-card {- border: 2px solid var(--border);- border-radius: var(--radius-md);- background: #090d16;- height: 75px;- padding: 4px;- display: flex;- flex-direction: column;- align-items: center;- justify-content: center;- cursor: pointer;- transition: all 0.18s cubic-bezier(0.16, 1, 0.3, 1);- overflow: hidden;- position: relative;- }- .thumb-card img {- max-width: 100%;- max-height: 100%;- object-fit: cover;- border-radius: 6px;- opacity: 0.82;- transition: opacity 0.15s;- }- .thumb-card:hover {- border-color: var(--primary-border);- transform: translateY(-2px);- }- .thumb-card:hover img {- opacity: 1;- }- .thumb-card.active {- border-color: var(--primary);- box-shadow: 0 0 0 2px var(--primary-glow);- }- .thumb-card.active img {- opacity: 1;- }-- /* --- RIGHT: PRODUCT BUY BOX --- */- .details-column {- display: flex;- flex-direction: column;- gap: 1.25rem;- }-- .product-h1 {- font-family: 'Outfit', sans-serif;- font-size: 2.15rem;- font-weight: 800;- line-height: 1.2;- color: var(--text-heading);- letter-spacing: -0.025em;- }-- /* Core Features Checklist */- .feature-checklist {- list-style: none;- display: flex;- flex-direction: column;- gap: 0.65rem;- margin: 0.35rem 0;- }- .feature-checklist li {- font-size: 0.86rem;- color: var(--text);- display: flex;- align-items: flex-start;- gap: 0.65rem;- line-height: 1.45;- }- .feature-checklist li .chk {- color: var(--success);- font-weight: 900;- font-size: 0.95rem;- margin-top: 1px;- flex-shrink: 0;- }-- /* --- THE DEMO CHECKOUT BUY BOX CARD --- */- .buy-box-card {- background: #ffffff;- border: 2px solid #bfdbfe;- border-radius: var(--radius-xl);- padding: 1.75rem;- box-shadow: var(--shadow-md);- position: relative;- }- .buy-box-card::before {- content: "";- position: absolute;- top: -2px;- left: 10%;- right: 10%;- height: 3px;- background: linear-gradient(90deg, #2563eb, #38bdf8, #2563eb);- border-radius: 3px;- }-- .pricing-header {- display: flex;- align-items: baseline;- justify-content: space-between;- margin-bottom: 0.5rem;- }- .price-main {- font-family: 'Outfit', sans-serif;- font-size: 2.6rem;- font-weight: 900;- color: #0f172a;- letter-spacing: -0.03em;- line-height: 1;- }- .price-badge-demo {- background: #eff6ff;- border: 1px solid #bfdbfe;- color: #2563eb;- font-size: 0.72rem;- font-weight: 800;- text-transform: uppercase;- padding: 0.25rem 0.65rem;- border-radius: 9999px;- letter-spacing: 0.04em;- }-- .pricing-note {- font-size: 0.82rem;- color: var(--text-muted);- margin-bottom: 1.25rem;- }-- /* AMOUNT SELECTOR CHIPS */- .amount-selector-title {- font-size: 0.78rem;- font-weight: 800;- text-transform: uppercase;- letter-spacing: 0.05em;- color: var(--text-muted);- margin-bottom: 0.65rem;- display: flex;- justify-content: space-between;- align-items: center;- }- .amount-selector-chips {- display: grid;- grid-template-columns: repeat(5, 1fr);- gap: 0.5rem;- margin-bottom: 1rem;- }- .chip-btn {- padding: 0.55rem 0.4rem;- font-size: 0.85rem;- font-weight: 800;- border-radius: var(--radius-sm);- border: 1px solid var(--border);- background: #ffffff;- color: var(--text);- cursor: pointer;- text-align: center;- transition: all 0.15s cubic-bezier(0.16, 1, 0.3, 1);- }- .chip-btn:hover {- border-color: var(--primary-border);- background: var(--primary-light);- color: var(--primary);- }- .chip-btn.active {- border-color: var(--primary);- background: var(--primary);- color: #ffffff;- box-shadow: 0 2px 8px var(--primary-glow);- }-- /* CUSTOM AMOUNT INPUT ROW */- .custom-amount-box {- margin-bottom: 1.25rem;- background: var(--bg-card-subtle);- border: 1px solid var(--border);- border-radius: var(--radius-md);- padding: 0.75rem 1rem;- display: flex;- align-items: center;- justify-content: space-between;- gap: 0.75rem;- }- .custom-amount-label {- font-size: 0.82rem;- font-weight: 700;- color: var(--text);- white-space: nowrap;- }- .custom-input-wrap {- display: flex;- align-items: center;- background: #ffffff;- border: 1px solid var(--border);- border-radius: var(--radius-sm);- padding: 0.35rem 0.65rem;- width: 150px;- transition: border-color 0.15s;- }- .custom-input-wrap:focus-within {- border-color: var(--primary);- box-shadow: 0 0 0 3px var(--primary-light);- }- .custom-currency-symbol {- font-weight: 800;- color: var(--text-muted);- font-size: 0.95rem;- margin-right: 4px;- }- .custom-amount-input {- border: none;- outline: none;- font-size: 1rem;- font-weight: 800;- color: var(--text-heading);- width: 100%;- }-- /* PRIMARY BUY BUTTON */- .btn-buy-primary {- width: 100%;- background: linear-gradient(135deg, #2563eb 0%, #1d4ed8 100%);- color: #ffffff;- border: none;- border-radius: var(--radius-md);- padding: 1.05rem 1.5rem;- font-size: 1.08rem;- font-weight: 800;- cursor: pointer;- display: flex;- align-items: center;- justify-content: center;- gap: 0.65rem;- box-shadow: var(--shadow-glow);- transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);- letter-spacing: -0.01em;- }- .btn-buy-primary:hover {- transform: translateY(-2px);- box-shadow: 0 10px 28px -4px rgba(37, 99, 235, 0.38);- background: linear-gradient(135deg, #1d4ed8 0%, #1e40af 100%);- }- .btn-buy-primary:active {- transform: translateY(0);- }- .btn-buy-primary:disabled {- opacity: 0.65;- cursor: not-allowed;- transform: none;- }-- .security-guarantee-note {- font-size: 0.75rem;- color: var(--text-muted);- text-align: center;- margin-top: 0.85rem;- display: flex;- align-items: center;- justify-content: center;- gap: 0.4rem;- }-- /* VALUE PROPOSITION BADGES GRID */- .value-props-grid {- display: grid;- grid-template-columns: repeat(2, 1fr);- gap: 0.75rem;- margin-top: 1.25rem;- padding-top: 1.25rem;- border-top: 1px solid var(--border);- }- .prop-pill {- display: flex;- align-items: center;- gap: 0.5rem;- font-size: 0.78rem;- font-weight: 600;- color: var(--text-muted);- }- .prop-pill .icon {- font-size: 0.95rem;- }-- /* --- ARCHITECTURE REQUIREMENTS & TRADEOFFS SECTION --- */- .requirements-section {- max-width: 1280px;- margin: 2.5rem auto 1.5rem;- padding: 0 1.5rem;- width: 100%;- }- .req-banner {- background: linear-gradient(135deg, #fffbeb 0%, #fef3c7 100%);- border: 2px solid #fcd34d;- border-radius: var(--radius-xl);- padding: 2rem;- box-shadow: var(--shadow-sm);- }- .req-grid {- display: grid;- grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));- gap: 1.5rem;- margin-top: 1.25rem;- }- .req-card {- background: #ffffff;- border: 1px solid #fde68a;- border-radius: var(--radius-lg);- padding: 1.5rem;- box-shadow: var(--shadow-sm);- display: flex;- flex-direction: column;- justify-content: space-between;- }- .req-card.danger-card {- border-color: #fca5a5;- }- .req-card.conditional-card {- border-color: #fed7aa;- }- .req-pill-badge {- font-size: 0.7rem;- font-weight: 800;- padding: 0.2rem 0.55rem;- border-radius: 9999px;- text-transform: uppercase;- letter-spacing: 0.04em;- }-- /* --- CAPABILITIES SECTION --- */- .specs-section {- max-width: 1280px;- margin: 2rem auto;- padding: 0 1.5rem;- width: 100%;- }- .section-heading-row {- text-align: center;- max-width: 720px;- margin: 0 auto 2.5rem;- }- .section-badge {- display: inline-block;- font-size: 0.75rem;- font-weight: 800;- text-transform: uppercase;- color: var(--primary);- background: var(--primary-light);- padding: 0.25rem 0.75rem;- border-radius: 9999px;- letter-spacing: 0.05em;- margin-bottom: 0.5rem;- }- .section-title {- font-family: 'Outfit', sans-serif;- font-size: 2rem;- font-weight: 800;- color: var(--text-heading);- letter-spacing: -0.025em;- }-- .features-quad-grid {- display: grid;- grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));- gap: 1.5rem;- margin-bottom: 3rem;- }- .quad-card {- background: #ffffff;- border: 1px solid var(--border);- border-radius: var(--radius-lg);- padding: 1.5rem;- box-shadow: var(--shadow-sm);- transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);- }- .quad-card:hover {- transform: translateY(-3px);- box-shadow: var(--shadow-md);- border-color: var(--border-hover);- }- .quad-icon {- width: 44px;- height: 44px;- border-radius: var(--radius-md);- background: var(--primary-light);- color: var(--primary);- display: flex;- align-items: center;- justify-content: center;- font-size: 1.35rem;- margin-bottom: 1rem;- }- .quad-title {- font-size: 1.05rem;- font-weight: 800;- color: var(--text-heading);- margin-bottom: 0.4rem;- }- .quad-desc {- font-size: 0.85rem;- color: var(--text-muted);- line-height: 1.5;- }-- /* COMPARISON TABLE */- .comparison-card {- background: #ffffff;- border: 1px solid var(--border);- border-radius: var(--radius-xl);- padding: 2rem;- box-shadow: var(--shadow-sm);- margin-bottom: 3rem;- overflow-x: auto;- }- .comparison-table {- width: 100%;- border-collapse: collapse;- font-size: 0.88rem;- }- .comparison-table th {- text-align: left;- padding: 0.85rem 1rem;- background: var(--bg-card-subtle);- color: var(--text-heading);- font-weight: 700;- border-bottom: 2px solid var(--border);- }- .comparison-table td {- padding: 0.85rem 1rem;- border-bottom: 1px solid var(--border);- color: var(--text-body);- }- .comparison-table tr:last-child td {- border-bottom: none;- }- .comparison-table tr:hover td {- background: rgba(37, 99, 235, 0.02);- }- .comparison-table .col-highlight {- background: rgba(37, 99, 235, 0.05);- color: #1d4ed8;- font-weight: 600;- }- .comparison-table th.col-highlight {- background: rgba(37, 99, 235, 0.08);- color: #1d4ed8;- border-bottom-color: #3b82f6;- }-- /* FOOTER */- footer {- background: #020617;- border-top: 1px solid #1e293b;- padding: 2.5rem 1.5rem;- margin-top: auto;- }- .footer-inner {- max-width: 1280px;- margin: 0 auto;- display: flex;- align-items: center;- justify-content: space-between;- gap: 1.5rem;- }- .footer-brand {- display: flex;- align-items: center;- gap: 0.75rem;- }-- /* LIGHTBOX MODAL */- .lightbox-modal {- display: none;- position: fixed;- inset: 0;- background: rgba(2, 6, 23, 0.92);- backdrop-filter: blur(8px);- z-index: 999999;- align-items: center;- justify-content: center;- padding: 2rem;- cursor: zoom-out;- }- .lightbox-modal.active {- display: flex;- }- .lightbox-close-btn {- position: absolute;- top: 1.5rem;- right: 1.5rem;- background: rgba(255, 255, 255, 0.15);- border: 1px solid rgba(255, 255, 255, 0.25);- color: #ffffff;- width: 40px;- height: 40px;- border-radius: 50%;- font-size: 1.25rem;- cursor: pointer;- display: flex;- align-items: center;- justify-content: center;- transition: background 0.2s;- }- .lightbox-close-btn:hover {- background: rgba(255, 255, 255, 0.3);- }- .lightbox-img {- max-width: 90vw;- max-height: 85vh;- border-radius: var(--radius-lg);- box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.5);- cursor: default;- object-fit: contain;- }-- /* CELEBRATION MODAL */- .celebration-modal {- display: none;- position: fixed;- inset: 0;- background: rgba(2, 6, 23, 0.8);- backdrop-filter: blur(6px);- z-index: 999998;- align-items: center;- justify-content: center;- padding: 1rem;- }- .celebration-modal.active {- display: flex;- }- .celebration-card {- background: #ffffff;- border-radius: var(--radius-xl);- padding: 2rem;- max-width: 440px;- width: 100%;- text-align: center;- box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);- animation: popIn 0.25s ease-out;- }- @keyframes popIn {- from { transform: scale(0.9); opacity: 0; }- to { transform: scale(1); opacity: 1; }- }- .celebration-icon {- width: 64px;- height: 64px;- border-radius: 50%;- background: #dcfce7;- color: #16a34a;- display: flex;- align-items: center;- justify-content: center;- font-size: 2rem;- font-weight: 800;- margin: 0 auto 1rem;- }- .receipt-box {- background: #f8fafc;- border: 1px solid var(--border);- border-radius: var(--radius-md);- padding: 1rem;- margin: 1.25rem 0;- text-align: left;- font-size: 0.85rem;- }- .receipt-row {- display: flex;- justify-content: space-between;- align-items: center;- padding: 0.35rem 0;- border-bottom: 1px dashed var(--border);- }- .receipt-row:last-child {- border-bottom: none;- }-- /* RESPONSIVE BREAKPOINTS */- @media (max-width: 1024px) {- .pdp-grid {- grid-template-columns: 1fr;- gap: 2rem;- }- .gallery-main-viewport {- height: 380px;- }- }-- @media (max-width: 768px) {- .top-announcement {- font-size: 0.72rem;- padding: 0.4rem 0.5rem;- gap: 0.35rem;- }- header {- padding: 0.75rem 1rem;- }- .header-inner {- flex-direction: column;- align-items: flex-start;- gap: 0.75rem;- }- .product-showcase-container {- padding: 1rem 0.75rem;- }- .gallery-main-viewport {- height: 260px;- }- .product-h1 {- font-size: 1.45rem;- }- .buy-box-card {- padding: 1.25rem 1rem;- }- .price-main {- font-size: 1.85rem;- }- .amount-selector-chips {- gap: 0.4rem;- }- .chip-btn {- padding: 0.45rem 0.65rem;- font-size: 0.8rem;- }- .thumbnails-grid {- gap: 0.35rem;- margin-top: 0.75rem;- }- .thumb-card {- height: 52px;- border-radius: var(--radius-sm);- padding: 2px;- }- .requirements-section {- padding: 0 0.85rem;- margin: 1.5rem auto 1rem;- }- .req-banner {- padding: 1.15rem 1rem;- border-radius: var(--radius-lg);- }- .req-grid {- grid-template-columns: 1fr;- gap: 1rem;- margin-top: 1rem;- }- .req-card {- padding: 1.1rem;- }- .specs-section {- padding: 0 0.85rem;- margin: 1.5rem auto;- }- .section-title {- font-size: 1.45rem;- }- .features-quad-grid {- grid-template-columns: 1fr;- gap: 1rem;- margin-bottom: 2rem;- }- .comparison-card {- padding: 1.15rem 0.85rem;- border-radius: var(--radius-lg);- margin-bottom: 2rem;- }- .comparison-table th, .comparison-table td {- padding: 0.65rem 0.5rem;- font-size: 0.8rem;- }- footer {- padding: 1.75rem 1rem;- }- .footer-inner {- flex-direction: column;- text-align: center;- gap: 1rem;- justify-content: center;- }- }- </style>+ <!-- MODULAR STORE STYLESHEET -->+ <link rel="stylesheet" href="/css/store.css" /></head><body>@@ -978,7 +30,7 @@<span class="brand-subtitle">Official Payment Gateway Demo</span></div></a>- <nav style="display:flex; align-items:center; gap:0.75rem; flex-wrap:wrap;">+ <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>@@ -987,6 +39,7 @@</nav></div></header>+<!-- MAIN E-COMMERCE PRODUCT DETAIL PAGE --><main class="product-showcase-container"><div class="pdp-grid">@@ -1276,55 +329,57 @@</div></div>- <!-- COMPARISON TABLE -->+ <!-- 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>- <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 & 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 & 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 & Custom Domain</strong></td>- <td>Aggregator Branding Mandatory</td>- </tr>- <tr>- <td><strong>POS Counter & Till Support</strong></td>- <td class="col-highlight"><strong>Included (Cash & Card Modalities)</strong></td>- <td>Separate Hardware / High Add-On Cost</td>- </tr>- </tbody>- </table>+ <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 & 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 & 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 & Custom Domain</strong></td>+ <td>Aggregator Branding Mandatory</td>+ </tr>+ <tr>+ <td><strong>POS Counter & Till Support</strong></td>+ <td class="col-highlight"><strong>Included (Cash & Card Modalities)</strong></td>+ <td>Separate Hardware / High Add-On Cost</td>+ </tr>+ </tbody>+ </table>+ </div></div></section>@@ -1561,13 +616,13 @@ app.post('/api/youpi-webhook', express.raw({ type: 'application/json' }), (req,});</code></pre></div>- <!-- FAQ ACCORDION: 18 DEVELOPER QUESTIONS -->+ <!-- 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:1fr 1fr; gap:1.25rem;">+ <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><script src="..." data-youpi-key="KEY"></script></code> and your button with <code>data-youpi-pay</code>.</p>@@ -1642,236 +697,7 @@ app.post('/api/youpi-webhook', express.raw({ type: 'application/json' }), (req,</div></div>- <!-- JAVASCRIPT: INTERACTIVE CONTROLLER & YOUPI CHECKOUT EMBED -->- <script>- // --- STATE MANAGEMENT ---- let currentAmount = 1.00;- const photos = [- {- url: '/assets/gateway_pc_checkout.png?v=2',- badge: '💻 Desktop 2-Column Checkout',- title: 'Desktop 2-Column Checkout',- desc: 'Authentic desktop 2-column checkout frame with real-time dynamic QR, clean card at counter, live order summary, and verified merchant branding.'- },- {- url: '/assets/gateway_mobile_checkout.png?v=2',- badge: '📱 Mobile Instant Sheet & UPI Intent',- title: 'Mobile Instant Sheet & UPI Intent',- desc: 'Native fluid mobile checkout bottom sheet with instant UPI app deep-linking (GPay, PhonePe, Paytm, CRED).'- },- {- url: '/assets/gateway_merchant_operations.png?v=2',- badge: '📊 Merchant Operations & Live Slots Hub',- title: 'Merchant Operations & Live Slots Hub',- desc: 'Crisp bright white operations dashboard with real-time slot allocation, floating cashier till dock, and observers status.'- },- {- url: '/assets/gateway_developer_dark_hub.png?v=2',- badge: '🌙 Developer Hub (Real Dark Mode)',- title: 'Developer Hub (Real Dark Mode)',- desc: 'Authentic obsidian real dark mode with multi-service supervisor, live host ports, and aggregate streaming terminal.'- },- {- url: '/assets/gateway_whitelabel_customizer.png?v=2',- badge: '🎨 White-Label Customizer & Mockup',- title: 'White-Label Customizer & Mockup',- desc: 'Live smartphone reflection with instant brand logo, custom color palette, trust seals, and conversion banners.'- }- ];- let currentPhotoIndex = 0;-- // --- GALLERY CONTROLLER ---- function switchGalleryPhoto(index, url, title, desc) {- currentPhotoIndex = index;- const mainImg = document.getElementById('mainGalleryImg');- const badgeText = document.getElementById('galleryBadgeText');-- if (mainImg) {- mainImg.style.opacity = '0.3';- mainImg.src = url;- setTimeout(() => { mainImg.style.opacity = '1'; }, 100);- }- if (badgeText) badgeText.textContent = title;-- // Update thumbnails active state- document.querySelectorAll('.thumb-card').forEach((el, i) => {- el.classList.toggle('active', i === index);- });- }- function openLightbox() {- const modal = document.getElementById('lightboxModal');- const img = document.getElementById('lightboxImg');- if (modal && img) {- img.src = photos[currentPhotoIndex].url;- modal.classList.add('active');- }- }-- function closeLightbox() {- const modal = document.getElementById('lightboxModal');- if (modal) {- modal.classList.remove('active');- }- }- }-- // --- AMOUNT MODIFIER & BUY BOX ---- function selectAmount(amt, chipEl) {- currentAmount = Number(amt);- updateAmountUI();-- document.querySelectorAll('.chip-btn').forEach(b => b.classList.remove('active'));- if (chipEl) chipEl.classList.add('active');- const customInput = document.getElementById('customAmountInput');- if (customInput) customInput.value = currentAmount.toFixed(2);- }-- function handleCustomAmountInput(val) {- const num = parseFloat(val);- if (!isNaN(num) && num >= 1) {- currentAmount = num;- updateAmountUI();- }- // Unset active chips if not exact match- document.querySelectorAll('.chip-btn').forEach(b => {- const chipVal = parseFloat(b.innerText.replace(/[^0-9.]/g, ''));- b.classList.toggle('active', chipVal === currentAmount);- });- }-- function updateAmountUI() {- const formatted = '₹' + currentAmount.toLocaleString('en-IN', { minimumFractionDigits: 2, maximumFractionDigits: 2 });- const dispEl = document.getElementById('displayPrice');- const btnDisp = document.getElementById('btnAmountDisplay');- if (dispEl) dispEl.textContent = formatted;- if (btnDisp) btnDisp.textContent = formatted;- }-- // --- PURCHASE INITIATION (Using Official Universal YouPI Integration) ---- async function startGatewayPurchase() {- const btn = document.getElementById('btnInitiateCheckout');- const oldHtml = btn.innerHTML;- btn.disabled = true;- btn.innerHTML = '<span>⏳ Preparing Gateway Session...</span>';-- try {- const orderId = `COIN-ORD-${Date.now()}`;- btn.setAttribute('data-amount', currentAmount.toFixed(2));- btn.setAttribute('data-order-id', orderId);-- // 1. Create order on store backend via YoupiPaymentClient- const res = await fetch('/api/checkout', {- method: 'POST',- headers: { 'Content-Type': 'application/json' },- body: JSON.stringify({- price: currentAmount,- productName: 'YOUPI PG Enterprise Gateway Suite',- coins: Math.round(currentAmount)- })- });-- const data = await res.json();- if (!res.ok || !data.checkoutUrl) {- alert(data.error || 'Failed to initiate checkout session.');- btn.disabled = false;- btn.innerHTML = oldHtml;- return;- }-- // 2. Launch checkout modal using official Youpi.pay() SDK- window.Youpi.pay({- checkoutUrl: data.checkoutUrl,- order_id: data.orderId,- amount: currentAmount,- currency: 'INR',- name: 'YOUPI Store',- description: 'YOUPI PG Enterprise Suite Top-Up',- successUrl: `/order-success?order_id=${encodeURIComponent(data.orderId)}&amount=${encodeURIComponent(currentAmount)}`,- failedUrl: `/order-failed?order_id=${encodeURIComponent(data.orderId)}`,- suspiciousUrl: `/order-suspicious?order_id=${encodeURIComponent(data.orderId)}`,- expiredUrl: `/order-expired?order_id=${encodeURIComponent(data.orderId)}`,- cancelledUrl: `/order-cancelled?order_id=${encodeURIComponent(data.orderId)}`,- handler: function(paymentResponse) {- btn.disabled = false;- btn.innerHTML = oldHtml;- showCelebrationModal(data.orderId, paymentResponse.utr || paymentResponse.paymentId || data.paymentId, currentAmount);- },- onClose: function() {- btn.disabled = false;- btn.innerHTML = oldHtml;- }- });- } catch (err) {- alert('Error launching YOUPI Gateway: ' + err.message);- btn.disabled = false;- btn.innerHTML = oldHtml;- }- }-- // --- OFFICIAL BROWSER PAYMENT EVENT LISTENERS ---- window.addEventListener('youpi:payment:success', function(e) {- console.log('[YOUPI PG Event] youpi:payment:success', e.detail);- const res = e.detail;- fetch('/api/verify-payment', {- method: 'POST',- headers: { 'Content-Type': 'application/json' },- body: JSON.stringify({- orderId: res.order_id,- amount: res.amount_received || currentAmount,- coins: Math.round(res.amount_received || currentAmount),- paymentId: res.utr || res.order_id- })- }).then(r => r.json()).then(d => {- if (d.coins !== undefined) {- const el = document.getElementById('topWalletBalance');- if (el) el.textContent = d.coins;- }- }).catch(() => {});- });-- window.addEventListener('youpi:payment:failed', function(e) {- console.warn('[YOUPI PG Event] youpi:payment:failed', e.detail);- });-- window.addEventListener('youpi:payment:suspicious', function(e) {- console.warn('[YOUPI PG Event] youpi:payment:suspicious', e.detail);- });-- window.addEventListener('youpi:payment:expired', function(e) {- console.warn('[YOUPI PG Event] youpi:payment:expired', e.detail);- });-- window.addEventListener('youpi:payment:cancelled', function(e) {- console.log('[YOUPI PG Event] youpi:payment:cancelled', e.detail);- });-- function showCelebrationModal(orderId, paymentId, amount) {- const modal = document.getElementById('celebrationModal');- const elOrder = document.getElementById('receiptOrderId');- const elPayment = document.getElementById('receiptPaymentId');- const elAmount = document.getElementById('receiptAmountPaid');-- if (elOrder) elOrder.textContent = orderId || 'YOUPI-ORD-LIVE';- if (elPayment) elPayment.textContent = paymentId || 'pay_verified';- if (elAmount) elAmount.textContent = '₹' + Number(amount).toFixed(2);- if (modal) modal.classList.add('active');- }-- function closeCelebrationModal() {- const modal = document.getElementById('celebrationModal');- if (modal) modal.classList.remove('active');- }-- // Keydown ESC to close modals- window.addEventListener('keydown', (e) => {- if (e.key === 'Escape') {- closeLightbox();- closeCelebrationModal();- }- });-- // Initialize UI on load- updateAmountUI();- </script>+ <!-- MODULAR JAVASCRIPT: INTERACTIVE CONTROLLER & YOUPI CHECKOUT EMBED -->+ <script src="/js/store.js"></script></body></html>\ No newline at end of file