Stripe: Katalog Terminplaner-Einrichtung (149 €) und Checkout je Funktion aus dem Register
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
This commit is contained in:
1 parent
c584d220c8
commit
98fa03aad7
6 files changed
+238
-13
No files matched your search
@@ -260,3 +260,24 @@ test('news_einrichtung_einmalpreis', async () => {
|
||||
assert.equal(await ensurePrice('newsSetup'), id)
|
||||
assert.equal(st.calls.slice(again).filter((c) => c.method === 'POST').length, 0)
|
||||
})
|
||||
|
||||
test('termine_einrichtung_einmalpreis', async () => {
|
||||
const before = st.calls.length
|
||||
const id = await ensurePrice('termineSetup')
|
||||
const calls = st.calls.slice(before)
|
||||
const created = calls.filter((c) => c.method === 'POST' && c.path === '/v1/prices')
|
||||
assert.equal(created.length, 1)
|
||||
assert.equal(created[0].body['unit_amount'], '14900')
|
||||
assert.equal(created[0].body['lookup_key'], 'webklar_termine_einrichtung_14900')
|
||||
assert.equal(created[0].body['nickname'], 'Terminplaner-Einrichtung 149 €')
|
||||
assert.ok(!Object.keys(created[0].body).some((k) => k.startsWith('recurring')), 'kein recurring')
|
||||
assert.equal(st.prices.get(id).recurring, null)
|
||||
const products = calls.filter((c) => c.method === 'POST' && c.path === '/v1/products')
|
||||
assert.equal(products.length, 1)
|
||||
assert.equal(products[0].body['name'], 'Terminplaner – Einrichtung')
|
||||
assert.equal(products[0].body['metadata[webklar]'], 'termine-einrichtung')
|
||||
// zweiter Aufruf: kein zweiter Preis (auch ohne Cache per lookup_key gefunden)
|
||||
const again = st.calls.length
|
||||
assert.equal(await ensurePrice('termineSetup'), id)
|
||||
assert.equal(st.calls.slice(again).filter((c) => c.method === 'POST').length, 0)
|
||||
})
|
||||
Reference in new issue
Block a user