Buchungskalender: Verdrahtung, Router-Gerüste und API-Vertrag
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
1 parent
1d2ca2791d
commit
a68baf10d9
37 files changed
+888
-30
No files matched your search
@@ -6,6 +6,7 @@ import { connectEreignis, statusAusKonto, statusMitHinweis } from '../services/s
|
||||
import { meldeEingang, schliesseAb, verwirf } from '../services/shop/bestellungen.js'
|
||||
import { bucheStripeErstattung } from '../services/shop/erstattungen.js'
|
||||
import { ladeShop, leereCache } from '../services/shop/kontext.js'
|
||||
import { kontoAktualisiertUk, verarbeiteUkEreignis } from './unterkunftWebhook.js'
|
||||
|
||||
/**
|
||||
* Stripe-Connect-Webhook des Webshops: POST /api/shop/stripe-webhook (Plan 2026-10-05-webshop.md, Task D3).
|
||||
@@ -41,10 +42,18 @@ async function verarbeite(event, now) {
|
||||
|
||||
if (event.type === 'account.updated') {
|
||||
await kontoAktualisiert(accountId || objekt.id, objekt, now)
|
||||
// dasselbe Konto kann auch im Buchungskalender haengen
|
||||
await kontoAktualisiertUk(accountId || objekt.id, objekt, now)
|
||||
return
|
||||
}
|
||||
if (!accountId) return
|
||||
|
||||
// Buchungskalender: Checkout-Sitzungen mit wkUk, Erstattungen nach den Metadaten der Zahlung
|
||||
if (objekt.metadata?.wkUk === '1' || (event.type === 'charge.refunded' && objekt.metadata?.webklar === 'unterkunft')) {
|
||||
await verarbeiteUkEreignis(event, now)
|
||||
return
|
||||
}
|
||||
|
||||
if (event.type === 'charge.refunded') {
|
||||
await bucheStripeErstattung({ accountId, charge: objekt, now })
|
||||
return
|
||||
|
||||
Reference in new issue
Block a user