mirror of
https://github.com/Since-3/Kuma.git
synced 2026-10-12 21:41:17 +00:00
see comments
This commit is contained in:
parent
55d8838c0e
commit
85c2bd95eb
7 changed files with 153 additions and 47 deletions
|
|
@ -177,6 +177,25 @@ describe("Stripe-Webhook – Buchung", () => {
|
|||
expect(recordStripeFee).toHaveBeenCalledWith("pi_1", "acct_studio");
|
||||
});
|
||||
|
||||
it("bucht nicht mit Gebühr 0, wenn der PaymentIntent nicht abrufbar ist", async () => {
|
||||
// Mit 0 als Ersatz wäre die Gebühr dauerhaft falsch verbucht - eine erneute
|
||||
// Zustellung ändert eine bezahlte Buchung nicht mehr. Stattdessen 500,
|
||||
// damit Stripe das Event erneut zustellt.
|
||||
vi.mocked(stripe.paymentIntents.retrieve).mockRejectedValue(
|
||||
new Error("Stripe nicht erreichbar")
|
||||
);
|
||||
const consoleError = vi.spyOn(console, "error").mockImplementation(() => {});
|
||||
|
||||
const res = await deliver(
|
||||
sessionEvent("checkout.session.completed", { account: "acct_studio" }),
|
||||
"whsec_connect"
|
||||
);
|
||||
|
||||
expect(res.status).toBe(500);
|
||||
expect(tx.courseBooking.upsert).not.toHaveBeenCalled();
|
||||
consoleError.mockRestore();
|
||||
});
|
||||
|
||||
it("speichert die Rechnungsadresse aus dem Checkout an der Buchung", async () => {
|
||||
const event = sessionEvent("checkout.session.completed", { account: "acct_studio" });
|
||||
(event.data.object as Record<string, unknown>).customer_details = {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue