Buchungskalender: Verwaltungs-API für Vermieter
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
1 parent
a94b50fbc1
commit
d0ab92658a
5 files changed
+1486
-8
No files matched your search
@@ -41,7 +41,7 @@ function liveUrl(project) {
|
||||
}
|
||||
|
||||
/** Legt das Haendlerkonto an und liefert die Konto-ID. Idempotent je Projekt (Stripe liefert bei gleichem Schluessel dasselbe Konto). */
|
||||
export async function kontoAnlegen({ customer, project }) {
|
||||
export async function kontoAnlegen({ customer, project, webklar = 'shop', idempotencyKey } = {}) {
|
||||
const customerId = String(customer?.$id || customer?.id || '')
|
||||
const projectId = String(project?.$id || project?.id || '')
|
||||
if (!projectId) throw fehler(400, 'Projekt fehlt.')
|
||||
@@ -60,9 +60,9 @@ export async function kontoAnlegen({ customer, project }) {
|
||||
requirement_collection: 'stripe',
|
||||
},
|
||||
capabilities: { card_payments: { requested: true }, transfers: { requested: true } },
|
||||
metadata: { webklar: 'shop', customerId, projectId },
|
||||
metadata: { webklar, customerId, projectId },
|
||||
},
|
||||
{ idempotencyKey: `shop-konto-${projectId}` }
|
||||
{ idempotencyKey: idempotencyKey || `shop-konto-${projectId}` }
|
||||
)
|
||||
return account.id
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user