13 lines
646 B
JavaScript
13 lines
646 B
JavaScript
// Stub: Task 7 ersetzt den Inhalt. Erstattung ueber Stripe Connect.
|
|
import { UkFehler } from './fehler.js'
|
|
|
|
export const _aufrufe = []
|
|
/** Aufrufprotokoll nur im Test (UK_TESTPROTOKOLL, setzt useTestEnv); in Produktion waechst nichts. */
|
|
const testProtokoll = () => process.env.NODE_ENV === 'test' || process.env.UK_TESTPROTOKOLL === '1'
|
|
|
|
export async function erstatte(ctx, anfrage, betragCent, { now, idempotencyKey } = {}) {
|
|
if (testProtokoll()) _aufrufe.push({ anfrageId: anfrage?.$id, betragCent, idempotencyKey })
|
|
if (!ctx?.einstellungen?.stripeAccountId) throw new UkFehler(409, 'online_aus')
|
|
return { erstattetCent: betragCent }
|
|
}
|