Webshop: fehlendes Stripe-Plattformprofil klar melden statt 'Stripe nicht erreichbar'
Lehnt Stripe die Kontoanlage ab, weil das Connect-Plattformprofil von WEBklar fehlt (oder Connect nicht aktiv ist), bekommt der Kunde 503 'plattform_nicht_bereit' mit eigenem Du-Text, und das Log nennt die Ursache (ohne Stripe-Text). Gefunden im Pilot 2026-10-06. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
1 parent
50f854ef1c
commit
8814c4aef1
2 files changed
+31
No files matched your search
@@ -57,6 +57,7 @@ const MELDUNG = {
|
||||
eingabe: 'Die Eingabe fehlt oder ist unlesbar.',
|
||||
stripeKundenansicht: 'In der Kundenansicht kann das Stripe-Konto nicht eingerichtet werden.',
|
||||
stripeFern: 'Stripe ist gerade nicht erreichbar. Bitte versuch es gleich noch einmal.',
|
||||
plattform: 'Die Stripe-Anbindung ist bei WEBklar noch nicht fertig eingerichtet. Wir kümmern uns darum – schreib uns gern im Chat.',
|
||||
keinKonto: 'Es ist noch kein Stripe-Konto angelegt.',
|
||||
}
|
||||
|
||||
@@ -484,11 +485,18 @@ const nurKundeStripe = (req, res, next) => {
|
||||
}
|
||||
|
||||
/** Stripe-Aufruf: jeder Fehler von Stripe wird zu 502 mit festem Text (Stripe-Texte verlassen den Server nie, geloggt wird nur Typ und Code). */
|
||||
// Connect im WEBklar-Konto nicht fertig (Plattformprofil fehlt oder Connect nicht aktiviert): das kann nur WEBklar beheben
|
||||
const PLATTFORM_FEHLT = /platform profile|signed up for Connect/i
|
||||
|
||||
async function ueberStripe(fn) {
|
||||
try {
|
||||
return await fn()
|
||||
} catch (err) {
|
||||
if (err?.status >= 400 && err.status < 500 && !err.type) throw err
|
||||
if (err?.type === 'StripeInvalidRequestError' && PLATTFORM_FEHLT.test(String(err.message || ''))) {
|
||||
console.error('[shop] Stripe Connect: Plattformprofil fehlt (Stripe-Dashboard → Connect → Fragebogen ausfüllen)')
|
||||
throw stop(503, MELDUNG.plattform, 'plattform_nicht_bereit')
|
||||
}
|
||||
console.error(`[shop] Stripe ${String(err?.type ?? err?.name ?? 'Fehler').slice(0, 60)} ${String(err?.code ?? '').slice(0, 60)}`.trim())
|
||||
throw stop(502, MELDUNG.stripeFern)
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user