From 6bcdb2b73994b1556b569ad73a85b09be1b3c2c6 Mon Sep 17 00:00:00 2001 From: Developer Date: Sun, 15 Feb 2026 10:58:15 +0000 Subject: [PATCH] Migrate test checkout page to inline Dodo Payments checkout with theme customization - Replace modal-based checkout with true inline checkout embedded in page layout - Implement split layout: payment form on left, package selection + order summary on right - Add real-time order summary sync via checkout.breakdown events - Apply comprehensive theme customization matching app design (Shopify green, proper colors) - Add loading states and empty state for better UX - Use ES modules with proper DodoPayments SDK import --- chat/public/test-checkout.html | 1140 ++++++++++++++++---------------- 1 file changed, 573 insertions(+), 567 deletions(-) diff --git a/chat/public/test-checkout.html b/chat/public/test-checkout.html index dc91684..39dd2a9 100644 --- a/chat/public/test-checkout.html +++ b/chat/public/test-checkout.html @@ -10,9 +10,6 @@ - - - @@ -36,7 +33,7 @@ 600: '#16a34a', 700: '#15803d', 800: '#166534', - 900: '#008060', // Shopify Green + 900: '#008060', 950: '#004c3f', } } @@ -75,7 +72,7 @@ } .shell { - max-width: 1180px; + max-width: 1400px; margin: 0 auto; padding: 32px 20px 48px; } @@ -115,63 +112,6 @@ flex-wrap: wrap; } - .currency-section { - margin-bottom: 24px; - } - - .currency-label { - font-size: 13px; - font-weight: 600; - color: var(--muted); - text-transform: uppercase; - letter-spacing: 0.025em; - margin-bottom: 8px; - } - - .currency-select { - width: 200px; - padding: 10px 14px; - border-radius: 8px; - border: 1px solid var(--border); - font-size: 14px; - background: #fff; - color: #0f172a; - font-weight: 600; - transition: all 0.2s; - appearance: none; - background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 24 24' stroke='%23008060'%3E%3Cpath stroke-linecap='round' stroke-linejoin='round' stroke-width='2' d='M19 9l-7 7-7-7'%3E%3C/path%3E%3C/svg%3E"); - background-repeat: no-repeat; - background-position: right 12px center; - background-size: 16px; - padding-right: 40px; - cursor: pointer; - } - - .currency-select:focus { - outline: none; - border-color: var(--shopify-green); - box-shadow: 0 0 0 3px rgba(0, 128, 96, 0.1); - } - - .currency-select:hover { - border-color: rgba(0, 128, 96, 0.3); - } - - /* Currency dropdown styles */ - .currency-dropdown.open #currency-btn { - border-color: var(--shopify-green); - box-shadow: 0 0 0 3px rgba(0, 128, 96, 0.1); - } - - .currency-option { - transition: all 0.15s ease; - } - - .currency-option:hover { - background-color: #d1fae5; - color: #065f46; - } - .btn { display: inline-flex; align-items: center; @@ -217,65 +157,6 @@ border-color: rgba(0, 0, 0, 0.05); } - .grid { - display: grid; - grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); - gap: 16px; - } - - .card { - background: #fff; - border: 1px solid var(--border); - border-radius: 14px; - padding: 24px; - box-shadow: 0 12px 32px rgba(0, 0, 0, 0.05); - display: flex; - flex-direction: column; - gap: 16px; - position: relative; - transition: all 0.2s ease; - } - - .card:hover { - transform: translateY(-2px); - box-shadow: 0 16px 40px rgba(0, 0, 0, 0.08); - border-color: rgba(0, 128, 96, 0.2); - } - - .pill { - display: inline-flex; - align-items: center; - gap: 6px; - padding: 6px 12px; - border-radius: 999px; - font-size: 12px; - font-weight: 700; - letter-spacing: 0.02em; - background: var(--shopify-green-light); - color: var(--shopify-green); - border: 1px solid rgba(0, 128, 96, 0.15); - } - - .muted { - color: var(--muted); - font-size: 14px; - line-height: 1.5; - } - - .price { - font-size: 36px; - font-weight: 700; - letter-spacing: -0.01em; - color: #0f172a; - } - - .old-price { - color: var(--muted); - text-decoration: line-through; - font-weight: 500; - font-size: 20px; - } - .status { padding: 14px 18px; border-radius: 12px; @@ -309,19 +190,6 @@ color: #92400e; } - .discount { - color: #166534; - font-weight: 700; - font-size: 13px; - } - - .products-label { - font-size: 18px; - font-weight: 700; - margin-bottom: 20px; - color: #0f172a; - } - .nav-bar { background: white; border-bottom: 1px solid #e9ecef; @@ -411,6 +279,261 @@ position: relative; display: inline-block; } + + /* Checkout Layout */ + .checkout-layout { + display: grid; + grid-template-columns: 1fr 1fr; + gap: 32px; + min-height: 600px; + } + + @media (max-width: 968px) { + .checkout-layout { + grid-template-columns: 1fr; + } + } + + .checkout-left { + background: #fff; + border-radius: 16px; + border: 1px solid var(--border); + padding: 32px; + box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06); + } + + .checkout-right { + display: flex; + flex-direction: column; + gap: 20px; + } + + .package-selector { + background: #fff; + border-radius: 16px; + border: 1px solid var(--border); + padding: 24px; + box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06); + } + + .package-selector h2 { + font-size: 20px; + font-weight: 700; + margin: 0 0 16px 0; + color: #0f172a; + } + + .currency-section { + margin-bottom: 20px; + } + + .currency-label { + font-size: 13px; + font-weight: 600; + color: var(--muted); + text-transform: uppercase; + letter-spacing: 0.025em; + margin-bottom: 8px; + display: block; + } + + .currency-select { + width: 200px; + padding: 10px 14px; + border-radius: 8px; + border: 1px solid var(--border); + font-size: 14px; + background: #fff; + color: #0f172a; + font-weight: 600; + transition: all 0.2s; + appearance: none; + background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 24 24' stroke='%23008060'%3E%3Cpath stroke-linecap='round' stroke-linejoin='round' stroke-width='2' d='M19 9l-7 7-7-7'%3E%3C/path%3E%3C/svg%3E"); + background-repeat: no-repeat; + background-position: right 12px center; + background-size: 16px; + padding-right: 40px; + cursor: pointer; + } + + .currency-select:focus { + outline: none; + border-color: var(--shopify-green); + box-shadow: 0 0 0 3px rgba(0, 128, 96, 0.1); + } + + .grid { + display: grid; + grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); + gap: 12px; + } + + .card { + background: #fff; + border: 2px solid var(--border); + border-radius: 12px; + padding: 16px; + cursor: pointer; + transition: all 0.2s ease; + position: relative; + } + + .card:hover { + border-color: rgba(0, 128, 96, 0.3); + transform: translateY(-2px); + box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08); + } + + .card.selected { + border-color: var(--shopify-green); + background: var(--shopify-green-light); + } + + .pill { + display: inline-flex; + align-items: center; + gap: 6px; + padding: 4px 10px; + border-radius: 999px; + font-size: 11px; + font-weight: 700; + letter-spacing: 0.02em; + background: var(--shopify-green-light); + color: var(--shopify-green); + border: 1px solid rgba(0, 128, 96, 0.15); + margin-bottom: 8px; + } + + .price { + font-size: 24px; + font-weight: 700; + letter-spacing: -0.01em; + color: #0f172a; + margin-bottom: 4px; + } + + .old-price { + color: var(--muted); + text-decoration: line-through; + font-weight: 500; + font-size: 14px; + } + + .muted { + color: var(--muted); + font-size: 13px; + line-height: 1.5; + } + + .discount { + color: #166534; + font-weight: 600; + font-size: 12px; + margin-top: 4px; + } + + /* Order Summary */ + .order-summary { + background: #fff; + border-radius: 16px; + border: 1px solid var(--border); + padding: 24px; + box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06); + } + + .order-summary h2 { + font-size: 18px; + font-weight: 700; + margin: 0 0 16px 0; + color: #0f172a; + } + + .summary-row { + display: flex; + justify-content: space-between; + padding: 8px 0; + font-size: 14px; + color: var(--muted); + } + + .summary-row.total { + border-top: 1px solid var(--border); + margin-top: 8px; + padding-top: 16px; + font-weight: 700; + font-size: 18px; + color: #0f172a; + } + + /* Dodo Inline Checkout Container */ + #dodo-inline-checkout { + width: 100%; + min-height: 500px; + } + + .checkout-header { + margin-bottom: 24px; + } + + .checkout-header h2 { + font-size: 20px; + font-weight: 700; + margin: 0 0 8px 0; + color: #0f172a; + } + + .checkout-header p { + color: var(--muted); + font-size: 14px; + margin: 0; + } + + /* Loading state */ + .checkout-loading { + display: flex; + flex-direction: column; + align-items: center; + justify-content: center; + min-height: 400px; + color: var(--muted); + } + + .checkout-loading .spinner { + width: 40px; + height: 40px; + border: 3px solid var(--border); + border-top-color: var(--shopify-green); + border-radius: 50%; + animation: spin 1s linear infinite; + margin-bottom: 16px; + } + + @keyframes spin { + to { transform: rotate(360deg); } + } + + /* Empty state */ + .checkout-empty { + display: flex; + flex-direction: column; + align-items: center; + justify-content: center; + min-height: 400px; + text-align: center; + color: var(--muted); + } + + .checkout-empty-icon { + width: 64px; + height: 64px; + background: var(--shopify-green-light); + border-radius: 16px; + display: flex; + align-items: center; + justify-content: center; + margin-bottom: 16px; + font-size: 32px; + } @@ -439,8 +562,8 @@
Admin Tools
-

Test Payments Checkout

-

This is an admin-only test page for exercising the full Dodo Payments checkout flow.

+

Test Inline Checkout

+

Embedded Dodo Payments checkout with theme customization.

Admin Dashboard @@ -449,49 +572,102 @@
-
- -
- - - - \ No newline at end of file +