Files
place4bees.com/backend
torbinus 794322d346 Online bezahlen an der Kasse, Storno- und Erstattungsmails
Normale Bestellungen gingen bisher nur auf Rechnung. Jetzt gibt es
"Online bezahlen" über Mollie (Karte, Sofortüberweisung, Überweisung),
gebaut wie die Abo-Kasse: Die Kasse legt die Zahlung an, der Webhook
schließt den Warenkorb ab, sobald Mollie bestätigt. Die Rückkehrseite
/bestellung/zahlung wartet darauf und leitet zur Dankeseite — oder sagt
bei Abbruch, dass nichts abgebucht wurde und der Warenkorb noch da ist.

Abschluss für Abo und Bestellung gemeinsam in lib/mollie-bestellung.ts,
neu mit Betragsprüfung: Passt der bezahlte Betrag nicht mehr zum
Warenkorb, wird nichts abgeschlossen.

Erstattungen: Die Mollie-Zahlung steht an der Bestellung. Erstattung im
Admin und Storno (dort ohne payment.refunded) gleichen mit Mollie ab und
buchen nur die Differenz zurück — gerechnet über amountRemaining, weil
amountRefunded eine frische Erstattung noch nicht zeigt.

Neue Mails: Storno, Erstattung, Abo-Abbuchung fehlgeschlagen, Abo
pausiert. Scheitert eine Abo-Abbuchung, wird die unbezahlte Lieferung
storniert, in drei Tagen neu versucht und nach drei Fehlversuchen
pausiert.

Im Testmodus durchgespielt: Kauf mit Karte (Bestellung, Label, Mails),
Abbruch, Teilerstattung 2,80 € im Admin, Storno mit Resterstattung
5,49 €, gescheiterte Folgezahlung nachgestellt.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
2026-10-26 11:51:34 +01:00
..
2026-07-06 13:37:08 +02:00
2026-07-06 13:37:08 +02:00
2026-09-17 16:02:51 +02:00
2026-07-06 13:37:08 +02:00
2026-07-06 13:37:08 +02:00
2026-09-17 16:02:51 +02:00
2026-07-06 13:37:08 +02:00
2026-07-06 13:37:08 +02:00

Medusa logo

Medusa DTC Starter

Documentation | Website

Building blocks for digital commerce

Medusa is released under the MIT license. Current CircleCI build status. PRs welcome! Product Hunt Discord Chat Follow @medusajs

Medusa DTC Starter

A production-ready monorepo starter for direct-to-consumer ecommerce stores powered by Medusa and Next.js. Includes a fully featured storefront with product browsing, cart, checkout, customer accounts, and order management.

Features

  • All of Medusa's commerce features
  • Multi-region support with automatic country detection
  • Product catalog with variant selection
  • Cart with promotion codes
  • Multi-step checkout with shipping and payment
  • Customer accounts with order history and address management
  • Order transfer between accounts

Getting Started

Deploy with Medusa Cloud

The fastest way to get started is deploying with Medusa Cloud:

  1. Create a Medusa Cloud account
  2. Deploy this starter directly from your dashboard

Local Installation

**Prerequisites:

  1. Clone the repository and install dependencies:
git clone https://github.com/medusajs/dtc-starter.git
cd dtc-starter
pnpm install
  1. Set up environment variables for the backend:
cp apps/backend/.env.template apps/backend/.env
  1. Set the database URL in apps/backend.env:
# Replace with actual database URL, make sure the database exists.
DATABASE_URL=postgres://postgres:@localhost:5432/medusa-dtc-starter
  1. Run migrations:
cd apps/backend
pnpm medusa db:migrate
  1. Add admin user:
cd apps/backend
pnpm medusa user -e admin@test.com -p supersecret
  1. Start Medusa backend:
cd apps/backend
pnpm dev
  1. Open the admin dashboard at localhost:9000/app and log in. Retrieve your publishable API key at Settings > Publishable API key.

  2. Set up environment variables for the storefront:

cp apps/storefront/.env.template apps/storefront/.env.local
  1. Update apps/storefront/.env.local with your Medusa publishable API key:
NEXT_PUBLIC_MEDUSA_PUBLISHABLE_KEY=pk_6c3...
  1. Start storefront:
cd apps/storefront
pnpm dev

The storefront runs on http://localhost:8000.

You can slo run the following command from the root to start both backend and storefront:

pnpm dev

Configuration

The storefront is configured via environment variables in apps/storefront/.env.local:

Variable Description Default
NEXT_PUBLIC_MEDUSA_PUBLISHABLE_KEY Publishable API key from your Medusa backend —
NEXT_PUBLIC_MEDUSA_BACKEND_URL URL of your Medusa backend http://localhost:9000
NEXT_PUBLIC_DEFAULT_REGION Default region country code dk
NEXT_PUBLIC_BASE_URL Base URL of the storefront https://localhost:8000
NEXT_PUBLIC_STRIPE_KEY Stripe publishable key (optional) —

Resources