Files
autocrm/resources/views/site/checkout-stub.blade.php
Vasyka 827bf12d89 Demo plan + Payment integrations (Stripe/PayPal/Bank)
Models & migrations:
- platform_settings table (key/value JSON store + Cache::remember 5min)
- plans: is_demo bool + trial_days int
- companies: is_demo bool

Plans:
- Demo plan seeded (is_demo=true, is_public=false, all features, 14 trial days)
- Trial 14-day plan seeded (is_public=true, basic features)
- Plan form: is_demo toggle + trial_days field
- Plan table: badge 🎬 Demo / 🎁 N zile trial

Central panel:
- PaymentSettings page (heroicon-credit-card, sort 90)
  Form sections: General, Date legale, Stripe, PayPal, Transfer bancar
  Each gateway collapsible, fields hidden until enabled toggle
  Saves to platform_settings keyed by `payments.{gateway}`
- CompanyResource: is_demo toggle + table description

Payment flow (PaymentController):
- GET  /billing                 — tenant invoices list with Pay button
- POST /pay/{sub}               — start checkout (stripe/paypal/bank)
- GET  /pay/{sub}/{success,cancel}
- POST /payments/stripe/webhook — mark paid + extend company.active_until
- POST /payments/paypal/webhook — same

Views:
- site/billing.blade.php       — invoices list with payment modal (3 methods)
- site/bank-instructions       — IBAN/BIC/reference for manual transfer
- site/checkout-stub           — placeholder until composer require stripe-php
- site/payment-{success,cancel}

Tenant panel:
- userMenuItems → "Facturile mele" link to /billing
2026-05-08 05:55:30 +00:00

31 lines
1.5 KiB
PHP

<!DOCTYPE html>
<html lang="ro">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width,initial-scale=1">
<title>{{ $gateway }} Checkout</title>
<style>
body { font-family: system-ui, sans-serif; background: #f3f4f6; padding: 60px 20px; color: #1f2937; text-align: center; }
.box { max-width: 540px; margin: 0 auto; background:#fff; padding:40px 24px; border-radius:12px; box-shadow:0 4px 12px rgba(0,0,0,.05); }
h1 { font-size: 22px; margin-bottom: 12px; }
.note { background: #fef3c7; border-left: 4px solid #f59e0b; padding: 12px 16px; border-radius: 6px; margin: 16px 0; text-align: left; font-size: 13px; line-height: 1.6; }
.btn { display:inline-block; padding: 10px 20px; background: #6366f1; color: #fff; border-radius: 8px; text-decoration: none; margin-top: 12px; font-size: 14px; }
</style>
</head>
<body>
<div class="box">
<div style="font-size:48px;margin-bottom:12px;">🚧</div>
<h1>{{ $gateway }} Checkout</h1>
<p style="color:#6b7280;font-size:14px;">Factură: <b>{{ $sub->invoice_number ?? '#' . $sub->id }}</b> · {{ number_format($sub->amount, 2) }} {{ $sub->currency }}</p>
<div class="note">
<b>Mod stub:</b><br>
{{ $note }}<br><br>
În prod, aici redirectează la pagina {{ $gateway }} Checkout cu sumele și metadatele facturii. La success, webhook-ul marchează automat factura ca plătită.
</div>
<a href="/billing" class="btn"> Înapoi</a>
</div>
</body>
</html>