diff --git a/admin/index.php b/admin/index.php index 9d59218..43f8e1c 100644 --- a/admin/index.php +++ b/admin/index.php @@ -117,8 +117,8 @@ if ($isAjax) { 'cta' => '', ], 'deposit' => [ - 'label' => 'Security Deposit', - 'detail' => 'A refundable security deposit is required at the time of pickup. Please have it ready — cash or card accepted. It will be returned in full upon safe return of the vehicle.', + 'label' => 'Balance Due at Pickup', + 'detail' => 'Your $' . number_format(DEPOSIT_AMOUNT, 2) . ' deposit hold has been placed on your card. The remaining balance is due at pickup — cash or card accepted. Your deposit hold will be released upon safe return of the vehicle.', 'cta' => '', ], 'license' => [ @@ -655,7 +655,7 @@ textarea.notes-ta:focus{border-color:#f97316}
- Security Deposit — $ + Deposit & Balance — $ held · $ at pickup N/A Captured — $ charged @@ -922,9 +922,9 @@ function squareAction(id, action, btn) { }; const [orig, working, done] = labels[action]; const confirmMsg = { - square_capture: 'Charge the deposit hold to this card?', - square_void: 'Void the deposit hold? The customer will NOT be charged.', - square_refund: 'Refund the full deposit to this card?', + square_capture: 'Charge the $ deposit hold to this card?', + square_void: 'Void the $ deposit hold? The customer will NOT be charged.', + square_refund: 'Refund the deposit to this card?', }[action]; if (!confirm(confirmMsg)) return; btn.disabled = true; diff --git a/contact.php b/contact.php index 9c612de..f68964c 100644 --- a/contact.php +++ b/contact.php @@ -66,6 +66,9 @@ $stmt->execute([$ref, $name, $email, $phone, $package, $rentalDate, $endDate, $p $dateLabel = date('F j, Y', strtotime($rentalDate)); $pkgLabel = $pkg['label']; $amountLabel = '$' . number_format($pkg['amount'], 2); +$depositLabel = '$' . number_format(DEPOSIT_AMOUNT, 2); +$balance = $pkg['amount'] - DEPOSIT_AMOUNT; +$balanceLabel = '$' . number_format($balance, 2); // Admin email $adminHtml = "
@@ -80,6 +83,8 @@ $adminHtml = "
Phone" . htmlspecialchars($phone ?: '—') . " Package{$pkgLabel} — {$amountLabel} Date{$dateLabel} + Deposit Hold{$depositLabel} (card held — not charged yet) + Balance Due{$balanceLabel} at pickup " . ($message ? "
" . nl2br(htmlspecialchars($message)) . "
" : "") . "

Submitted " . date('F j, Y g:i A') . " CT

@@ -100,6 +105,8 @@ $confirmHtml = "
Package: {$pkgLabel}

Requested Date: {$dateLabel}

Total: {$amountLabel}

+

Deposit (card hold today): {$depositLabel} — not charged until confirmed

+

Balance due at pickup: {$balanceLabel}

Next Step: Sign Your Rental Agreement

@@ -136,16 +143,14 @@ if ($squareToken) { } } -$depositLine = $depositStatus - ? "

Deposit Hold: \$" . number_format(DEPOSIT_AMOUNT, 2) . " authorized (not charged — released if booking is declined)

" - : ''; - -// Inject deposit line into confirmation email -$confirmHtml = str_replace( - "

Total: {$amountLabel}

", - "

Total: {$amountLabel}

{$depositLine}", - $confirmHtml -); +// Add Square authorization badge to customer email if hold was placed +if ($depositStatus) { + $confirmHtml = str_replace( + "

Deposit (card hold today): {$depositLabel}", + "

Deposit (card hold today): {$depositLabel} ✓ Authorized", + $confirmHtml + ); +} // Add deposit note to admin email if applicable if ($depositStatus) { diff --git a/db.php b/db.php index 0bb8f32..e29a9b5 100644 --- a/db.php +++ b/db.php @@ -17,7 +17,7 @@ define('SQUARE_ACCESS_TOKEN', 'EAAAl3FsAu_2ri8kZE_ENEyi2T_C8HXXm5XQFY6Lbnd8SX6Fq define('SQUARE_APP_ID', 'sq0idp-YSM7BU9IVyOWSzpeP-0nzQ'); define('SQUARE_LOCATION_ID', 'L8GZYHYKE95CE'); define('SQUARE_VERSION', '2024-01-18'); -define('DEPOSIT_AMOUNT', 100.00); // $100 refundable security deposit hold +define('DEPOSIT_AMOUNT', 45.00); // $45 deposit hold — balance due at pickup define('PACKAGES', [ 'half-day' => ['label' => 'Half Day (4 hrs)', 'amount' => 99.00, 'days' => 0], diff --git a/index.html b/index.html index d4af8bf..e92eb19 100644 --- a/index.html +++ b/index.html @@ -814,8 +814,11 @@

-

Refundable Deposit — $100

-

A $100 hold will be placed on your card — not charged until your booking is confirmed. Released in full if declined or at return.

+
+

Deposit — $45 today

+ +
+

A $45 hold is placed on your card to secure your date — not charged until confirmed. Remaining balance is due at pickup.

@@ -984,6 +987,24 @@ }); } + // ── Balance-due display ─────────────────────────────────────────────────────── + const PACKAGE_PRICES = { 'half-day': 99, 'full-day': 169, 'weekend': 299 }; + const DEPOSIT = 45; + const pkgSelect = document.querySelector('select[name="package"]'); + const balLabel = document.getElementById('balance-due-label'); + const balAmt = document.getElementById('balance-due-amount'); + if (pkgSelect) { + pkgSelect.addEventListener('change', function() { + const price = PACKAGE_PRICES[this.value]; + if (price && balLabel && balAmt) { + balAmt.textContent = '$' + (price - DEPOSIT).toFixed(2).replace(/\.00$/, ''); + balLabel.style.display = ''; + } else if (balLabel) { + balLabel.style.display = 'none'; + } + }); + } + // ── Square Web Payments ─────────────────────────────────────────────────────── let squareCard = null; async function initSquare() { @@ -1050,7 +1071,7 @@ return; } squareToken = result.token; - setDepStatus('Card verified — authorizing $100 deposit hold…', 'processing'); + setDepStatus('Card verified — authorizing $45 deposit hold…', 'processing'); } const data = { @@ -1069,7 +1090,7 @@ if (json.success) { if (json.deposit_held) { const holdSuffix = json.square_payment_id ? ' · Confirmation: …' + json.square_payment_id.slice(-10).toUpperCase() : ''; - setDepStatus('✓ $100 deposit hold authorized' + holdSuffix, 'success'); + setDepStatus('✓ $45 deposit hold authorized' + holdSuffix, 'success'); const cardEl = document.getElementById('card-container'); if (cardEl) cardEl.style.display = 'none'; } else {