Hosting-Abo: Preis 15 € -> 20 € pro Monat (Vertragsbedingungen v4, Katalog, Leitfaden)
- server/config.js: amountCents 2000, lookup_key webklar_hosting_monatlich_2000 - ensurePrice haengt einen neuen Preis an das vorhandene Stripe-Produkt (metadata.webklar), statt ein zweites "WEBklar Hosting-Abo" anzulegen - abo-bedingungen.html (Uebersicht, Preise, Leistungsbeschreibung) + PDF, Leitfaden + PDF - Tests auf 20 € umgestellt (399/399) Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
1 parent
78b4d7b7fe
commit
e4efdac226
18 files changed
+79
-59
No files matched your search
@@ -81,7 +81,7 @@ async function clearEvents(customerId) {
|
||||
test('GET /api/abo: Katalog, Hosting-Abo mit Speicher, kein Stundenkonto', async () => {
|
||||
aw.seed('subscriptions', { ...hostingDoc, storageUnits: 2 })
|
||||
const r = await get('/api/abo', { cookie: sessionCookie({ customerId: 'c1', appwriteUserId: 'u1' }) })
|
||||
assert.deepEqual(r.products.map((p) => [p.key, p.amountCents]), [['hosting', 1500], ['wartung', 5000]])
|
||||
assert.deepEqual(r.products.map((p) => [p.key, p.amountCents]), [['hosting', 2000], ['wartung', 5000]])
|
||||
assert.equal(r.subscription.productKey, 'hosting'); assert.equal(r.subscription.storage.units, 2)
|
||||
assert.equal(r.subscription.canSwitch, true); assert.equal(r.ledger, null)
|
||||
assert.equal(r.subscription.termsUrl, '/abo-bedingungen.html')
|
||||
@@ -134,10 +134,10 @@ test('Checkout Hosting: Preis, Beschreibung, Hinweistext', async () => {
|
||||
assert.equal(res.status, 200, JSON.stringify(res.body))
|
||||
assert.match(res.body.url, /^https:\/\//)
|
||||
assert.equal(call.body['subscription_data[description]'], 'WEBklar Hosting-Abo')
|
||||
assert.match(message(call), /15,00 € monatlich/)
|
||||
assert.match(message(call), /20,00 € monatlich/)
|
||||
assert.equal(call.body['subscription_data[metadata][productKey]'], 'hosting')
|
||||
assert.equal(message(call), `${INTRO_SOFORT} 15,00 € monatlich, ${TAIL}`)
|
||||
assert.equal(call.body['line_items[0][price]'], priceIdFor('webklar_hosting_monatlich_1500'))
|
||||
assert.equal(message(call), `${INTRO_SOFORT} 20,00 € monatlich, ${TAIL}`)
|
||||
assert.equal(call.body['line_items[0][price]'], priceIdFor('webklar_hosting_monatlich_2000'))
|
||||
assert.equal(call.body['discounts[0][coupon]'], undefined)
|
||||
assert.equal(call.body['subscription_data[trial_end]'], undefined)
|
||||
// Nachweis der Zustimmung nur am Abo (F41c): an der Checkout-Sitzung bleiben Zuordnung und Produkt
|
||||
@@ -156,7 +156,7 @@ test('Checkout Hosting nach der Widerrufsfrist: Probezeit bis zum Leistungsbegin
|
||||
const { res, call } = await checkout(orderBody('hosting', { startChoice: 'nach_frist', lateStartAt }))
|
||||
assert.equal(res.status, 200, JSON.stringify(res.body))
|
||||
assert.equal(call.body['subscription_data[trial_end]'], String(unix(lateStartAt)))
|
||||
assert.equal(message(call), `${INTRO_FRIST} Danach 15,00 € monatlich, ${TAIL}`)
|
||||
assert.equal(message(call), `${INTRO_FRIST} Danach 20,00 € monatlich, ${TAIL}`)
|
||||
// Veralteter Leistungsbeginn (Datumswechsel seit dem Laden der Seite) -> 409, kein Checkout
|
||||
const stale = await checkout(orderBody('hosting', { startChoice: 'nach_frist', lateStartAt: '2026-01-02T05:00:00.000Z' }))
|
||||
assert.equal(stale.res.status, 409)
|
||||
@@ -421,7 +421,7 @@ test('Webhook checkout.session.completed: K01 je Produkt mit PDF der zugestimmte
|
||||
assert.equal(k01.subject, 'Ihr WEBklar Hosting-Abo – Vertragsbestätigung')
|
||||
assert.deepEqual(k01.attachments.map((a) => [a.filename, a.contentType]), [['WEBklar-Abo-Vertragsunterlagen.pdf', 'application/pdf']])
|
||||
assert.ok(k01.attachments[0].content.length > 1000, 'PDF-Inhalt angehaengt')
|
||||
for (const text of ['15,00 € / Monat', 'gemäß § 19 UStG ohne Umsatzsteuer', '1 E-Mail-Postfach', `(Version ${config.abo.termsVersion})`]) {
|
||||
for (const text of ['20,00 € / Monat', 'gemäß § 19 UStG ohne Umsatzsteuer', '1 E-Mail-Postfach', `(Version ${config.abo.termsVersion})`]) {
|
||||
assert.ok(k01.text.includes(text), `${text}\n---\n${k01.text}`)
|
||||
}
|
||||
assert.ok(!k01.text.includes('Stunde Arbeitszeit') && !k01.text.includes('Stundenkontingent'), k01.text)
|
||||
|
||||
Reference in new issue
Block a user